Running Keycloak without outbound internet access
An identity platform has to sign people in even when the network it sits in has no internet egress or only a narrow allowlist. Keycloak can run in that setting. It is an identity and access management server licensed under Apache 2.0 that supports OpenID Connect, OAuth 2.0 and SAML 2.0, so core sign-in, token issuance and single sign-on need only network paths between users, applications and Keycloak itself. The risk is that several features make outgoing requests, and a design drawn as if nothing leaves the network will fail on the first federated login, token exchange or certificate check. This section identifies those features and what each one needs.
The features that reach outside the Keycloak host are identity provider federation, token exchange, backchannel logout, OCSP and CRL validation, and SAML artifact resolution. Each calls a remote endpoint: an upstream identity provider, a token exchange partner, a logout endpoint on another application, a certificate authority's OCSP responder or CRL distribution point, or a SAML artifact resolution service. In a restricted network most of these targets are internal, so the work is to confirm that each endpoint is reachable through an internal route or an approved proxy, and to decide whether revocation checks can use internal responders. The outgoing HTTP guide describes the proxy and truststore settings that apply to these calls. Confirm the option names against your Keycloak version, and list which of these features your login design actually uses before the network plan is final.
Delivery planning comes first because every part of Keycloak arrives from outside the network: the server image or distribution, custom providers, themes, extra certificates, the database driver and each later release. The project plans four minor releases a year, so the upgrade process needs a repeatable way to mirror each new version and its dependencies. Decide who builds images, where they are stored in an internal registry, how they are scanned and approved, and how each release is tested against a copy of the realm before production. Software integrity and authenticity checks for anything carried across the boundary are often an explicit procurement requirement in regulated sectors. Ask your distributor to confirm the offline delivery method and the dependency list for the build you choose.
Which Keycloak features reach outside the network
Several Keycloak features open connections from the server to systems outside it, even when users never leave the network. In an air-gapped or restricted network, each one needs a reachable internal endpoint, a proxy decision or a documented reason to stay disabled. Review them together before go-live so that no login path fails silently in production.
Identity provider federation
Keycloak calls out to upstream identity providers and directories such as LDAP, Active Directory and OIDC or SAML brokers when users sign in or when federation syncs run. In a restricted network, the directory and any upstream IdP must sit inside the boundary or be reachable through an approved path. Decide which federation links are needed on day one, confirm that each one resolves to an internal address, and test a full sign-in from a clean session before cutover.
Outgoing HTTP guideToken exchange
Token exchange lets a client trade one token for another, and it can call external services to validate or obtain tokens for downstream systems. Each exchange path needs a reachable target and a trust relationship that is approved by the security team. Before go-live, list every client allowed to exchange tokens, the target audiences it can request, and the internal services those audiences depend on, and remove any exchange path nobody has justified.
Backchannel logout
Backchannel logout sends server-to-server logout notifications from Keycloak to registered client endpoints. Clients that run on other segments or behind separate proxies must be reachable on those internal URLs, which often differ from the public frontend address. Confirm the backchannel logout URL for each client, verify the route from Keycloak to it, and check how a failed notification is handled, since a client that never receives it may keep a session open.
OCSP and CRL validation
When Keycloak validates client certificates for X.509 login, it can check revocation status through OCSP responders or CRL distribution points. In a restricted network, these checks fail if the responder or CRL host is outside the boundary. Decide whether an internal OCSP responder or a hosted CRL is the source of truth, publish the revocation data inside the network, and define the behavior when a check cannot complete, because that choice determines whether revoked certificates keep working.
SAML artifact resolution
With the SAML artifact binding, the browser carries only a reference, and Keycloak must call back to the partner's artifact resolution service over a back channel to fetch the assertion. That service must be reachable from Keycloak, and the partner's certificate and endpoint details must be correct for the internal route. Before go-live, confirm the artifact resolution endpoint for each partner, test one artifact exchange end to end, and decide whether the artifact binding is needed at all or whether the HTTP-POST binding will serve the same partner.
Choosing an offline deployment path
Choose this path when your organization already runs, or plans to run, a Kubernetes cluster inside the restricted network and wants Keycloak deployed onto it. The cluster itself has to reach its control plane images and workload images from somewhere inside the boundary. The Kubernetes documentation describes fetching control plane images in advance with kubeadm config images list and kubeadm config images pull, and pointing kubeadm init at a private registry through the --image-repository flag. Keycloak then runs as ordinary workloads that pull from the same internal registry.
- Image staging: Every Keycloak image, database image and sidecar must be pulled on a connected system, scanned, and pushed to the internal registry before the cluster needs it.
- Registry ownership: Someone must own the internal registry, its certificates, storage and access control, because nothing in the cluster can fetch a missing image on its own.
- Operator delivery: Operator bundles and manifests are copied in through the same mirror, so the cluster never reaches a public catalog.
- Cluster lifecycle: Kubernetes upgrades also need offline images, which adds a second release stream to track alongside Keycloak.
- Skills required: Your team needs cluster administration skills in the restricted network, not only Keycloak knowledge.
Confirm with your platform team whether the cluster, registry and Operator upgrade process are already in place before choosing this path.
Choose this path when Keycloak runs directly on a virtual machine or a single container host without a cluster scheduler. Installation artifacts are prepared on a connected system, transferred through your approved media process, and installed on hosts that never open an outbound connection. The trade-off is simplicity against manual repetition: every host gets the same artifacts by hand, and each upgrade is a file transfer and a controlled restart rather than a rollout managed by a platform.
- Artifact set: The transfer usually includes the Keycloak distribution or container image archive, the database driver, custom providers and themes, and any certificate bundles.
- Tag discipline: Mirror images by digest or immutable tag so that the copy inside the network matches the copy you tested.
- Host consistency: Each node needs the same version and configuration, so configuration as code or a single build artifact reduces drift.
- Restart planning: Without an orchestrator, high availability depends on your load balancer and database design, and each node is restarted separately.
- Operating system packages: Any OS packages the host needs must come from an internal repository, not a public mirror.
Confirm how your transfer media is scanned and who signs off on each import before you plan the first deployment.
Choose this path when the restricted network already runs OpenShift or another Operator-capable platform with a private catalog. The Keycloak Operator is installed through Operator Lifecycle Manager, the recommended method, and it manages the Keycloak, KeycloakRealmImport, KeycloakOIDCClient and KeycloakSAMLClient custom resources. In this model the platform team mirrors the catalog content and the Operator, and application teams manage Keycloak through custom resources. The Keycloak Operator documentation strongly recommends manual approval mode for operator updates to avoid unintended automatic upgrades, and that setting matters even more when no outbound path exists to check for new releases.
- Catalog mirroring: The catalog index, Operator bundles and every referenced image must be mirrored to the internal registry before installation.
- Approval mode: Set manual approval so that a mirrored update is applied only after your change process signs off on it.
- Upgrade sequencing: Mirror the target Operator and the matching Keycloak image together, then review upgrade notes before approving.
- Support boundary: Decide whether you use the community Operator or the Red Hat build of Keycloak, because the packaging, catalog source and support terms differ.
- Database and secrets: The database and secrets must also come from inside the boundary, so plan them with the Operator rather than assuming defaults.
Confirm with your platform vendor which catalog entries are available in your offline subscription before you commit to this path.
How artifacts and requests cross the isolation boundary
The flow starts in a staging zone with internet access, where the Keycloak image, providers, themes and OS packages are pulled and checked before they cross the boundary. Once inside, they are loaded into a private registry and artifact store that the restricted network uses for every install and upgrade. Outbound calls for brokering and revocation checks leave the restricted network only through the outbound proxy, which is the one path to confirm with your network team. Verify each hand-off, since nothing should reach the restricted network unchecked.
Artifacts move one way across the boundary, while outbound calls use a single proxy path.
Options for each outbound dependency
This table compares the four ways to handle a Keycloak feature that calls out of your network: an approved egress proxy, an internally hosted endpoint, disabling or replacing the feature, or a documented exception. Read each row against the features your realm actually uses, since the right option depends on whether the feature is needed for sign-in. The main takeaway is that most outbound calls can be routed or hosted internally, and exceptions should be the last resort.
| Option | When it fits | Trade-off |
|---|---|---|
| Approved egress proxy | Brokering to external identity providers, token exchange with partner systems, or backchannel calls that must reach a specific external host through a controlled gateway | Keeps one audited exit point, but the proxy becomes a dependency for sign-in and needs its own allow list, logging and failover |
| Internally hosted OCSP responder or CRL distribution point | X.509 client certificate login or certificate validation where your PKI already issues and publishes revocation data | Revocation data must be kept current on a schedule, and staleness can cause valid certificates to be rejected or revoked ones accepted |
| Internal identity provider or directory in place of external brokering | Users already exist in an on-premises directory, so LDAP or Active Directory federation can replace a cloud identity provider that would need internet access | Requires directory connectivity inside the boundary and mapping work to keep attributes and group membership consistent |
| Disable the feature | The feature is not required for sign-in, such as a social provider, backchannel logout to external relying parties or an unused SAML artifact flow | Removes the call entirely, but users and applications that depended on it need a documented alternative and a change record |
| Replace with an approved alternative | A required capability, such as a particular upstream protocol, can be met by an internal service the organization already approves | Adds an internal component to build, patch and monitor, and the replacement must be tested against the same token and claim expectations |
| Documented exception | No technical option meets the requirement within the agreed timeline, and the risk owner accepts the residual exposure in writing | Needs a named owner, scope, compensating controls, an expiry date and periodic review, and assessors will ask for this evidence |
How to stage Keycloak for a restricted network
This sequence moves Keycloak from a connected build into a network with no outbound internet access, with each external dependency inventoried, mirrored, tested and documented before production use. The result is a staged deployment and a repeatable bundle process for future upgrades.
Inventory every outbound dependency
Start by listing each Keycloak feature in your design that makes outgoing requests. The Keycloak outgoing HTTP guide covers identity provider federation, token exchange, backchannel logout, OCSP and CRL validation, and SAML artifact resolution. For each feature, record the destination host, protocol, port, whether it is used in production, and the owner who will approve it. Also list the image registry, the database driver source and any email relay. Done when the inventory is signed off by the security and platform owners and every feature is marked either mirrored, proxied or removed from scope.
Mirror the Keycloak image and providers
Pull the exact Keycloak release you have chosen, along with any custom providers, themes and base images, and push them into your private registry. Confirm the image digests match the upstream values so the bundle can be verified later. Mirror any JDBC driver, provider JAR or certificate authority file that the build needs. Record the release version in your change log. Done when a clean host with no internet access can pull every artifact from the private registry and the image starts in a development profile.
Configure proxy and trust settings
Set the outbound proxy and truststore values for the features you kept in scope, so that Keycloak only reaches the destinations approved in the inventory. Add internal certificate authorities to the truststore used for OCSP responders, CRL endpoints, identity providers and backchannel logout targets. Where a feature cannot reach its endpoint, decide whether to mirror the responder or disable the feature with a documented risk acceptance. Check the proxy configuration against the current outgoing HTTP guide before applying it. Done when the settings are stored in version control and reviewed.
Run a connection test before and after proxy configuration
Before applying the proxy and trust settings, run a connection test from the Keycloak container to each approved destination and capture the failure. Typical checks are a TCP connect, a TLS handshake and an HTTP request to the OCSP responder or CRL URL. Then apply the configuration and repeat the same tests. The reader should see the blocked connections fail before the change and succeed only for approved destinations after it. Any destination that succeeds without being in the inventory is a finding to resolve before continuing. Done when the before and after results are recorded.
Deploy to a non-production environment
Deploy the mirrored image into a non-production environment that matches the production network controls, including the blocked egress path, reverse proxy, database and metrics setup. Use the production database engine and version rather than the dev-file database, so schema behavior matches production. Confirm that the admin console and Administration REST API are reachable only on the intended hostname or path, and that TLS is enforced on all communication. Done when the health checks pass, the admin console loads from the internal network and no unexpected outbound traffic appears in the egress logs.
Test each external-reach feature
Exercise every feature in the inventory that makes an outgoing request, one at a time. Test an identity provider login from a federated source, a token exchange, a backchannel logout to a registered client, a certificate revocation check for X.509 login, and a SAML artifact resolution if it is in use. For each feature, define the expected result before the test and record the observed result. Features that depend on an external service you cannot mirror should fail closed or be documented as unavailable. Done when every in-scope feature has a passing test, or a documented exception approved by the owner.
Document the upgrade bundle process
Write a procedure for building an upgrade bundle on a connected system and moving it across the boundary. The bundle should include the Keycloak image, provider JARs, themes, the Operator or Helm artifacts if used, the list of image digests, and a checksum or signature record for each file. Review the release notes for each target version before the bundle is built, including breaking changes and new outbound behavior. Keep a runbook for rollback. Confirm the procedure on the non-production environment before the next version is needed. Done when a second person can follow the document, rebuild the bundle and verify it without help.
Upgrading Keycloak when the network has no internet access
Keycloak's release cadence makes offline upgrades a recurring operational task, not a one-time event. Since Keycloak 26.0, the project plans four minor releases a year, according to its October 2024 release blog, so a disconnected environment that waits for a convenient moment to upgrade will fall behind quickly. The practical approach is to treat each upgrade as a repeatable bundle: the target image or artifact, its checksums, the upgrade notes for that version, and the staging evidence that proves it works. Before any bundle crosses the boundary, the team should read the upgrade notes for the exact target version, since the project says breaking changes in a minor release are opt-in, which means defaults can still change behavior for existing configurations. Confirm the target version against the Keycloak upgrading guide before scheduling the change.
Custom images need the most attention. If the deployment carries providers, themes or extra certificates in a custom image, that image must be rebuilt on the new Keycloak base and the rebuilt image must be mirrored into the isolated registry along with every dependency it pulls. Decide in advance whether the database schema migrates automatically at startup, which is the default, or whether administrators apply the SQL manually. The upgrading guide suggests manual migration for large deployments because it lets a DBA review the changes and schedule them. Either way, the rollback path depends on a database backup taken immediately before the change, so confirm the restore procedure works in the disconnected environment as well.
Test every bundle against a recent copy of production data in a staging environment that matches the production network restrictions, not a connected lab. The 26.8 upgrade notes show why. They enforce SMTP StartTLS without plaintext fallback, so a mail relay that never offered encryption will stop delivering password reset and notification mail. They also require signature validation of backchannel logout tokens from external providers, so an upstream that signs tokens with keys Keycloak cannot reach offline will fail logouts. Check each item in the notes against your own configuration, and record the results as the evidence the change board will ask for.
Security controls for isolated Keycloak environments
An isolated Keycloak is still an identity provider that handles credentials and tokens, so the controls that matter most are about what crosses the boundary and how the server is exposed inside it. The cards below cover artifact verification, transport encryption, hostname separation, metrics exposure and secret handling, which should be reviewed together during design rather than one at a time.
Verify every artifact crossing the boundary
Every image, provider JAR, theme, operator bundle and database driver carried into the network is a supply chain input. NERC CIP-013-2 expects procurement processes to address verification of software integrity and authenticity for vendor software and patches, so the transfer process should record where each artifact came from, its checksum or signature, and who approved it. Check the signature of the Keycloak release itself before mirroring it, and confirm with your vendor how signed artifacts are published for your chosen distribution.
CIP-013-2 textTLS on all communication
Keycloak's production guidance calls for TLS on all communication, which includes traffic between the proxy and Keycloak and traffic to the database and any internal identity providers. Inside a restricted network it is tempting to skip certificates for internal hops, but an internal CA is still needed for those links. Confirm which certificates the Keycloak truststore must trust, because outbound checks such as OCSP and CRL validation depend on reaching revocation endpoints that may be internal only.
Production guideSeparate admin hostname from frontend URLs
The production guide recommends exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. In an isolated network this usually means the admin endpoint is reachable only from a management subnet or jump host, while application users reach a separate hostname. Test that the admin hostname does not resolve or route from the user segment, and that the reverse proxy blocks admin paths on the public listener.
Production guideRestrict metrics to the management interface
Keycloak exposes Prometheus-format metrics at /metrics on its management interface when started with --metrics-enabled=true. The metrics endpoint can reveal request volumes, cache behavior and runtime details, so it should be bound to the management interface and scraped only from the monitoring network. Confirm that the reverse proxy never forwards /metrics from the public listener, and confirm which histograms your team enables, since HTTP request and cache histograms add detail.
Metrics guideKeep credentials out of exported configuration
Realm exports and configuration-as-code files are easy to carry across an isolated boundary, but they can contain client secrets, SMTP passwords and provider keys. Before any export moves between environments, strip or replace secrets and load them at runtime from a vault or environment variables inside the target network. Document who may run exports, where export files are stored, and how a leaked file would be handled, including rotating every secret it contained.
Review inbound and outbound paths
Features such as identity brokering, token exchange, backchannel logout and OCSP or CRL checks make outgoing requests, and each one is a path through the boundary. Build an allowlist of destinations for each feature, route outbound calls through an approved proxy where one exists, and log denied connections. Verify each rule by testing from the Keycloak host itself, since the application path and the admin path may use different routes.
Outgoing HTTP guideQuestions buyers ask about air-gapped Keycloak
Does Keycloak work fully offline without internet access?
Keycloak can run in a network with no outbound internet, but only after you have mirrored its images, providers and any dependencies into that network and confirmed which features still need outside reach. Keycloak makes outgoing requests for identity provider federation, token exchange, backchannel logout, OCSP and CRL validation and SAML artifact resolution. Features that call external endpoints need a route that your security team approves, such as an internal endpoint, an outbound proxy or a deliberate exception. Login with local users, OIDC clients and internal directories generally needs no internet path, but you should confirm each feature against the Keycloak outgoing HTTP guide before you assume it works offline.
What does an air-gapped Keycloak engagement cost, and what drives the effort?
Cost depends on the work in the written scope, not on a fixed package. The main drivers are the number of outbound dependencies that must be replaced or proxied, the number of custom providers, themes or extensions that must be rebuilt and retested, the upgrade cadence you expect, and the size of the high availability design. Each dependency adds an allowlist decision, a test and a document. Upgrades recur: Keycloak plans four minor releases a year, so your process for mirroring each new image and provider set is an ongoing cost. Ask for a quote that separates one-time build and staging work from the recurring upgrade and support work, and that lists each outbound dependency in scope. DeployOpen does not publish prices, and the quote follows from that written scope.
How long does staging an air-gapped Keycloak take?
Duration follows from scope, so ask for a timeline that is tied to named deliverables rather than a generic estimate. Staging usually covers an inventory of outbound calls, a mirrored image and provider repository, a build of the Keycloak image with your certificates and providers, a database and high availability design, a test run of login, federation and logout inside the isolated network, and a documented upgrade procedure. Each of these steps grows with the number of identity sources and custom components. The Keycloak project plans four minor releases a year, so the upgrade procedure is tested as part of the handover, not left for later. Confirm the sequence and dependencies in the statement of work before work starts.
What must our team provide before staging starts?
The engagement depends on information only your organization holds. Expect to provide the following before design begins:
- Network diagrams showing zones, the isolated boundary, transfer points and any proxy or reverse proxy in the path
- Identity source details, including directory type, connection endpoints, certificate chains and which attributes are needed
- Named approvers for the software transfer process, the allowlist of outbound destinations and the certificate authority
- Database, hostname and TLS standards your security team already requires
- Test accounts and a window for validating login, federation and logout in the isolated network
Missing items usually show up as rework later, so ask the provider to list every input and its owner in the quote.
Can our own team run and upgrade air-gapped Keycloak after handover?
Often yes, if the team has Linux, container and database skills and the handover includes a tested runbook. Running Keycloak in a restricted network adds steps that a standard internet-connected deployment does not need: mirroring each release image and provider, verifying what you carry across the boundary, applying the database migration (which Keycloak runs automatically at startup by default, or which you can apply manually for large deployments), and checking the release notes. The Keycloak 26.8 upgrade notes, for example, enforce SMTP StartTLS and mandatory signature validation of backchannel logout tokens from external providers, so your team must test those changes before promotion. Ask the provider to walk your team through a full upgrade in the test environment and to name which tasks stay with you and which stay with the provider under a retainer.
How do we verify packages and images we carry across an isolated boundary?
Each image, provider and library you move into the network should be checked for integrity and authenticity, recorded and approved before it enters. NERC CIP-013-2 is one example of a requirement in the energy sector that asks procurement processes to address verification of software integrity and authenticity for vendor software and patches, so regulated operators often need this evidence. Other frameworks ask for similar controls in their own terms. Ask the provider how the transfer process records checksums, signatures and approvals, and confirm with your compliance team which controls the evidence must satisfy. DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors and certification bodies issue any audit report or attestation.
Which Keycloak features stop working when outbound access is blocked?
Features that call external endpoints are the ones to check first. According to the Keycloak outgoing HTTP guide, these include identity provider federation, token exchange, backchannel logout, OCSP and CRL validation, and SAML artifact resolution. Social providers and hosted identity sources also need reachable endpoints. If an identity provider lives on the public internet, that federation will not work without a route. For certificate status checks, you may need an internal OCSP responder or a CRL distribution point inside the network. The safe approach is to list every feature you enable, mark whether it needs outside reach, and test each one before cutover.
How offline controls support compliance readiness
Offline controls only help an assessment when they leave records behind. Three records do most of the work: the artifact chain, which shows where each Keycloak image, provider JAR, theme and OS package came from, who verified it and when it crossed the isolated boundary; the egress inventory, which lists every outbound destination Keycloak is allowed to reach, such as identity provider metadata endpoints, OCSP responders, CRL distribution points, token exchange partners and the proxy used for them, along with the reason each one is needed; and the test results, which show that the blocked paths fail as designed and that the required paths work through the approved proxy. Keep these in version control next to the realm and configuration exports so the evidence matches the running system. Ask your compliance team which of these records their assessment will request and in what format before you build the process around them.
DeployOpen prepares systems, controls and evidence, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies decide whether your controls meet a framework's requirements. Our role is to configure the environment, document the controls, collect the records described above and test them so your team walks into an assessment with material that is organized and reproducible. Where a framework requires an outside assessment, that assessor will review the evidence on its own terms. Confirm the scope of the framework that applies to you and the evidence format the assessor expects before any work starts, because those answers determine how the egress inventory and test results should be structured.
If you operate BES Cyber Systems, confirm with your compliance team how NERC CIP-005-7 applies to Keycloak. That standard, which covers electronic security perimeters, requires Interactive Remote Access to high and medium impact systems to pass through an Intermediate System with encryption and multi-factor authentication. Whether a Keycloak instance that sits inside or beside that perimeter falls under it depends on your asset classification and network design, and only your compliance team can make that determination. If it does apply, ask them which Keycloak paths they consider remote access and which records they will need to show for them.
How DeployOpen scopes and delivers offline Keycloak
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including air-gapped networks. For Keycloak, that means working out which features need outbound reach before any image is moved across the boundary, then building, testing and handing over a deployment that your own team can run and upgrade without the internet.
How we scope
- Inventory every Keycloak feature that makes outgoing requests, such as federation, token exchange, backchannel logout and OCSP or CRL checks.
- Confirm which database, high availability design and hostnames the environment needs before any packages are staged.
- Agree the written scope, deliverables and timelines in writing before work starts, since most engagements are fixed-scope.
How we build
- Mirror the Keycloak image, the database driver and any custom providers into your private registry and artifact store.
- Configure outbound proxy settings, internal CRL or OCSP endpoints and trust stores for only the destinations you approve.
- Test login, brokering, token exchange and the admin console from an isolated network segment that matches production.
How we hand over
- Document the offline package list, checksums and the steps for each approved transfer into the boundary.
- Deliver runbooks for upgrades without internet access, including how database schema migration is run and verified.
- Provide configuration as code and evidence for access control and logging so your security and compliance teams can review it.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer when your team wants DeployOpen to stay involved.
- Retest after each Keycloak release, since minor releases ship on a regular cadence and may change behavior.
- Prepare upgrade packages and notes for each new release so your team can apply them through your own transfer process.

