How to run a Keycloak upgrade without taking sign-in offline
Whether a Keycloak patch can go out without taking sign-in offline depends on three things: the upgrade notes for the target release, the database, and the deployment topology. A rolling change works only when old and new nodes can run side by side for a while, sharing the same database and serving the same users. The current release is 26.8.1, published October 13, 2026. The project plans four minor releases a year and a major release every two to three years, and since Keycloak 26.0 it has said that breaking changes in a minor release will be opt-in. That lowers the risk of a surprise, but it does not remove the need to read each release's notes before you roll it out.
Start with the target release. The 26.8 upgrade notes show what to look for: enforced SMTP StartTLS without plaintext fallback, mandatory signature validation of backchannel logout tokens from external providers, login failures persisted to the database by default, and a recommendation to move from the deprecated multi-site feature to the stateless feature. Each of these can change how a running cluster behaves. Read the notes for your exact source and target versions, then mark which items touch your mail relay, your logout integrations, or your high availability design. Any item you mark needs a test before the change window.
The database sets how much overlap you can safely create. By default, Keycloak migrates its schema automatically at startup, so the first node on the new version may change the schema while older nodes still handle traffic. For large deployments, the upgrading guide suggests manual migration, where administrators apply the SQL before they roll any node. Decide which mode you will use, take a verified backup, and confirm your engine and version appear in the supported list, which includes PostgreSQL 14 to 18, MariaDB, MySQL, Microsoft SQL Server, Oracle Database, EnterpriseDB Advanced, Amazon Aurora PostgreSQL and Azure SQL. The supported high availability designs also need a synchronously replicated database, so confirm that your replication setup meets that requirement before you begin.
Topology determines the mechanics of the roll. A single cluster, optionally spread across availability zones, can be updated node by node if the load balancer only routes to healthy nodes. Multi-cluster v2 deployments need the same discipline for each site. The deprecated multi-cluster v1 design, which used a separate Infinispan cluster per site, makes overlap harder to reason about. If you run the Keycloak Operator, check the update approval mode, because the operator documentation strongly recommends manual approval so that an operator update does not change Keycloak outside a planned window.
Before you schedule the change, write down the source and target versions, the migration mode, the database engine and replication setup, and the number of nodes that must keep serving sign-in during the roll. Rehearse the same sequence in staging, using a copy of production data where your policies allow it, and record the sign-in checks you will run after each node restarts. Those records give you a clear rollback point if a node fails its checks.
What changed in the 26.8 release line and what each change requires
This table lists the four changes named in the Keycloak 26.8 upgrade notes and what each one does to a deployment that is already running. Read each row as a pre-upgrade check: the impact column says what may fail or grow, and the action column says what to test or change. Breaking changes in minor releases are opt-in, so confirm in the 26.8 release notes which changes apply to your configuration before you plan the window.
| Change in 26.8 | Impact on a running deployment | Action before or during the upgrade |
|---|---|---|
| Enforced SMTP StartTLS, no plaintext fallback | Mail from Keycloak fails if the relay does not offer STARTTLS, which can stop password resets and verification emails. | Confirm the relay supports STARTTLS on your port and certificate trust, then send a test email in staging. |
| Mandatory signature validation of backchannel logout tokens | Logout requests from external identity providers that are unsigned or fail validation will be rejected, leaving sessions open. | Confirm each external provider signs logout tokens and that its keys are current in Keycloak before upgrading. |
| Login failures persisted to the database by default | Every failed login writes a record, so database write load and table size grow with failed-login volume. | Size database capacity and retention for failure records, and check whether the release notes allow disabling persistence. |
| Deprecated multi-site feature | Deployments on the multi-cluster v1 design, with a separate Infinispan cluster per site, are on a deprecated path. | Plan the move to the stateless feature as a separate project, outside the patch window, and confirm the target design in the release notes. |
Why a patch release can still change the database and running nodes
A Keycloak patch release can look like a low-risk change, but it may still alter the database that every node shares. By default, Keycloak migrates its database schema automatically at startup. The first node that starts on the new version can therefore apply schema changes before the rest of the cluster has been upgraded. The database becomes a shared change that every node depends on. Before the maintenance plan is written, the team should confirm from the upgrade documentation for the exact target version whether that patch includes schema changes at all. The answer shapes every later decision in the runbook.
Keycloak also supports manual migration, in which administrators apply the schema SQL themselves before starting nodes on the new version. The upgrading guide suggests this approach for large deployments. It moves the schema change into a step the team can review, schedule and hand to a database administrator, and it keeps the change out of the first node's startup sequence. The cost is more operational work. The team has to obtain the correct script for the target version, run it against the production database in a planned window, and confirm the result before any node starts. Ask whether the target version's script is documented for manual application and what the documentation says about reversing it if the rollout fails.
The harder question is whether old and new nodes can run side by side. A rolling restart replaces nodes one at a time, so for a period the cluster serves requests from both versions against the same database. If the new version changed the schema or the data it writes, an old node may fail to read it, or a new node may expect data that an old node has not written. The team must confirm from the release notes for the specific release whether mixed-version operation is supported. The patch number alone does not establish that support. If the notes do not state it, the rolling plan is not safe as written, and the team should plan a window in which all nodes stop and restart together.
Turn these points into three checks before the change request is approved. First, read the release notes and upgrade notes for the exact target version and record whether the release changes the schema, whether migration runs at startup, and whether mixed-version operation is supported. Second, rehearse the upgrade on a copy of the production database and observe the startup of the first node, since that node is where automatic migration would run. Third, if the team uses the Keycloak Operator, keep manual approval mode for operator updates, which the Operator documentation strongly recommends, so that a new version is applied only when the team chooses. Record each answer in the runbook so the approver can see which path was chosen and why.
What to prepare before a Keycloak patch goes near production
A patch that restarts cleanly in a lab can still fail against production data, extensions or settings. The four areas below establish a restore point and a rehearsal environment close enough to production to trust. Complete them in order, because the rehearsal is only useful once it holds a copy of the production database and configuration.
Verified production database backup
Keycloak stores realms, users, clients and credentials in its database, so this backup is the rollback point if a schema migration or patch fails. Use the engine you run in production: PostgreSQL 14 to 18, MariaDB, MySQL, SQL Server, Oracle, Aurora PostgreSQL, EnterpriseDB Advanced or Azure SQL. Confirm the backup restores to a separate instance, and record who can run the restore and how long it took. The default dev-file database is for development only and is not a valid base for this work.
Inventory of custom providers and federation
List every custom provider, theme, user federation link (LDAP, Active Directory or Kerberos) and identity brokering provider, including social providers. For each item, record the Keycloak version it was built against and the team that owns it. Custom providers depend on Keycloak's internal interfaces, so each one needs a test against the target patch release. Include brokered identity provider settings and federation mappers, since they are easy to miss when the realm export looks complete.
Configuration export and secrets inventory
Export realm configuration so you can compare it before and after the patch. Keep that export in access-controlled storage, because it can reference client secrets and other sensitive values. Separately list every secret the deployment reads, including database credentials, LDAP bind passwords, SMTP credentials, keystore material and brokered provider client secrets. For each one, record its source and who can rotate it. If your target is 26.8, the upgrade notes enforce StartTLS for SMTP, so confirm mail relay TLS settings too.
Test environment matching production topology
Build the rehearsal environment on the same database engine and major version as production, with the same number of Keycloak nodes, load balancer, sticky session settings and reverse proxy path restrictions. Restore the production backup into it and run the patch there first. Both supported high availability designs assume a synchronously replicated database, so confirm the test database follows the same replication pattern. A single-node test cannot show how rolling restarts behave behind your proxy, so treat it as a functional check only.
The upgrade sequence for a rolling Keycloak patch
This sequence moves a Keycloak deployment to a patch release one node at a time, with a tested rollback point at each stage. Each step ends with a named check, and each check has a stop condition that halts the rollout before users are affected.
Confirm the target release and read its notes
The platform owner confirms the exact target patch version against the Keycloak release listing and reads its upgrade notes from start to finish. Patch notes can carry configuration or database changes, so the team records every item that touches this deployment, such as SMTP, logout token handling or proxy settings. The step is complete when the change record names the target version and lists each applicable note with an owner. Stop if any note requires a change the team has not yet scheduled or tested.
Back up the database and record a rollback point
The database administrator takes a full backup of the Keycloak database and the team exports the current server configuration, realm exports, and deployment manifests. Keycloak runs schema migrations automatically at startup by default, so the database backup is the only reliable way back if a migration fails. The step is complete when the team restores the backup to a separate instance and confirms it opens, and the change record holds the rollback point. Stop if the backup cannot be restored or the restore test fails.
Rehearse the update in staging
The team deploys the current production configuration and a copy of production data to a staging environment that uses the same database engine and version as production. They run the target release there, watch the startup logs for schema migration output, and run the login, token and admin flows their applications depend on. The step is complete when staging starts cleanly and every critical flow passes with the target version. Stop if migration errors appear, if any application login fails, or if a configuration item from the upgrade notes behaves differently than expected.
Set the Operator to manual approval
For deployments managed by the Keycloak Operator, the platform owner confirms that the Operator subscription is in manual approval mode. The Operator documentation strongly recommends this mode to avoid unintended automatic upgrades. The owner then reviews the pending install plan, checks that it names the target version that passed staging, and approves it deliberately. The step is complete when the approval record matches the change record. Stop if the subscription is in automatic mode, or if the pending version differs from the tested version.
Roll nodes one at a time with checks
The operator updates one Keycloak node at a time while the others continue serving traffic behind the load balancer and sticky sessions. After each node restarts, the team checks the node's health endpoint, reviews its logs for errors, and runs a test sign-in and token refresh through the load balancer. Only when a node passes all three checks does the rollout move to the next node. The step is complete when every node runs the target version and passes the same checks. Stop if a node fails a check, if sessions are dropped unexpectedly, or if error rates rise on the remaining nodes.
Confirm the rollout and close the change
After the last node passes, the team runs the full set of application sign-in, logout and admin console checks against production and confirms that metrics and logs show normal behavior. They keep the pre-upgrade database backup for the retention period set by their change policy and record the final version on each node. The step is complete when the change record shows all checks passed and the rollback point has been retained. Stop and begin the rollback procedure if production checks fail after the final node is updated.
How rolling restarts behind sticky sessions keep users signed in
A rolling restart keeps users signed in only when the load balancer continues to send each existing browser session to a node that stays up, and when the session state that session needs is held somewhere other than the node being restarted. With sticky sessions, the load balancer pins each browser to one Keycloak node, usually through a routing cookie or a similar affinity mechanism. While one node restarts, requests from browsers pinned to the other nodes continue normally. Browsers pinned to the restarting node lose their affinity target for the length of the restart, and whether those users stay signed in depends on whether another node holds their session data. Confirm the affinity mechanism your load balancer uses and how Keycloak encodes node identity in its cookies in the upgrade documentation for your target release.
Session state is distributed through the Infinispan caches that Keycloak uses in its high availability architectures. Keycloak documents three designs: a single cluster optionally spread across availability zones, multi-cluster deployments (v2) without an external Infinispan cluster, and the deprecated multi-cluster v1, which used a separate Infinispan cluster per site. For a single cluster across zones, check how many nodes hold a replica of each session, how the cluster forms across zones, and what happens when a zone or node leaves. For multi-cluster v2, confirm how sessions reach the other site and what a restart in one site does to sessions that were pinned there. Do not assume a single node restart is safe until replication has been verified in a test environment that matches your topology.
Both supported high availability designs need a synchronously replicated database, and this requirement matters during rolling restarts. Each restarting node reads and writes the same user, session and schema state as the nodes that remain, so a database that lags behind its primary can hand a node stale data after a failover. Keycloak migrates its database schema automatically at startup by default, which means a patched node that starts while another node is still working against the old schema is a risk to plan for. For large deployments, the upgrading guide suggests manual migration, where administrators apply the SQL themselves before any node restarts. Confirm which migration approach and ordering your patch release requires in its upgrade notes.
If you run Keycloak on Kubernetes with the Keycloak Operator, the rolling behavior depends on the Operator's rolling update strategy along with your readiness probes and disruption settings, not on Keycloak alone. Verify that strategy against the Keycloak version you run before you rely on it, because the Operator's behavior can differ between releases. The Operator is installed through Operator Lifecycle Manager (the recommended method), with kubectl, or with an experimental Helm chart. The Operator documentation strongly recommends manual approval mode for operator updates, which keeps an upgrade from starting until your team has reviewed the target release.
Before you schedule a production patch, run a rehearsal on a copy of your topology. Sign in several test users so that sessions are pinned to each node, restart nodes one at a time in the order your rollout will use, and record which sessions survive each step. Confirm the exact rolling behavior for the target patch in the upgrade documentation and through this test, not from the general description on this page. Agree with your load balancer and database owners on the rollback point and the criteria for pausing the rollout before the first production node restarts.
What makes a Keycloak patch upgrade take longer than planned
This table lists the factors that most often stretch a Keycloak patch upgrade beyond the original estimate, with how each one changes effort and what to ask a provider to scope. Read each row against your own estimate, and use the third column as a checklist of questions to send before accepting a fixed-scope quote. The main takeaway is that the size of your test surface, more than the patch itself, usually sets the schedule.
| Effort driver | How it changes effort | What to ask a provider to scope |
|---|---|---|
| Realms and clients | Each realm and client with custom mappers, authentication flows or redirect rules adds regression checks. Many realms multiply that work. | Count of realms, clients per realm, and which clients use custom protocol mappers or non-default authentication flows. |
| Custom SPI providers and themes | Custom providers and themes are rebuilt and retested against the target release. Each one adds build and test time. | Inventory of SPI providers and themes, their current versions, and whether source code and build pipelines are available. |
| LDAP, Active Directory and brokered logins | Federation links and social or SAML brokers need login tests for each source, often with test accounts drawn from that source. | Which federation links, identity brokers and social providers are in scope, and who supplies test accounts and directory access. |
| Database size and migration time | Startup runs schema checks, and a large database lengthens startup and any manual migration. Confirm whether the target patch changes the schema. | Database engine and version, data size, backup and restore timing, and whether schema migration runs automatically or as manual SQL. |
| Deployment topology | A single cluster rolls node by node behind sticky sessions. Multi-cluster v2 adds per-site sequencing. Deprecated v1 adds Infinispan coordination. | Which of the three topologies is deployed, the number of sites, and whether a move off the deprecated v1 design is planned. |
| Operator or manual install | Operator upgrades depend on the update approval mode and the rolling update strategy. Manual installs need hand-built rolling steps and a dedicated runbook. | Installation method, Operator approval mode, and whether the rolling update strategy has been tested in a non-production cluster. |
| Environments to promote | Each environment needs the same patch, verification and evidence. Promotion from test to production repeats checks already run. | Number of environments, promotion path, and whether verification evidence is kept per environment for change records. |
How to test a Keycloak patch and roll it back safely
Start the test plan with the sign-in paths your applications depend on, because a patch can start cleanly and still break a token exchange. Run a scripted smoke test for each client in the realm: OpenID Connect and OAuth 2.0 clients through their configured flows, and SAML 2.0 service providers through their SSO bindings. Sign in as a test user, confirm that the ID token or SAML assertion carries the expected claims and audience, and confirm that token refresh and logout still work. Include the admin console and the Administration REST API, using a service account with the same permissions and token lifetimes as production. Record each result in a form you can compare between the current and target versions, so a failure points to one flow.
Next, test the identity sources and factors that sit outside the core login path. For LDAP or Active Directory user federation, authenticate a directory test account, confirm group and role mappings, and check that scheduled synchronization completes. For each brokered identity provider, whether OIDC, OAuth or SAML, complete a login and confirm that first-login account linking behaves as configured. Repeat the check for any social providers you have enabled. For MFA, test OTP enrollment and verification, WebAuthn security keys, passkeys in both conditional and modal UI, and recovery code use. Passkey and WebAuthn behavior depends on the origin, so run these tests against the exact public hostname your users sign in through.
Email and metrics need their own checks because both can change silently after a patch. Keycloak 26.8 enforces SMTP StartTLS without plaintext fallback, according to the upgrade notes, so any realm whose mail relay was reached without encryption will fail to send password reset, verification or notification messages. Send a test message from each realm that mails users, using the production SMTP host and port, and confirm that the relay certificate validates. Ask your mail team to confirm that the relay offers STARTTLS on that port. If you scrape Prometheus metrics, start the target version with --metrics-enabled=true on the management interface and confirm that /metrics returns the series your dashboards and alerts query, including any HTTP or cache histograms you enabled.
Rollback is the step teams most often underestimate. Keycloak migrates its database schema automatically at startup by default, and a newer release may write a schema that the previous release cannot read. Once the migration has run, returning to the old binary may not work without restoring a database backup taken before the upgrade. Define the rollback point before the first node starts against the migrated database, and write down who can authorize the restore. Consider manual migration, where administrators apply the SQL themselves. The upgrading guide suggests this for large deployments, and it gives you a reviewed script and a deliberate pause before the schema changes. Take a database backup immediately before the migration, and rehearse restoring it into a scratch environment so you know how long the restore takes.
Confirm the rollback procedure for the specific target version in the Keycloak upgrading documentation before you schedule the window. A downgrade path documented for one minor release should not be assumed to apply to another. If you run the Red Hat build of Keycloak, confirm the procedure with Red Hat support as well. Ask whether any changes in the target release, such as login failures persisted to the database by default in 26.8, would be lost in a restore, and plan how you will handle sessions and audit records created between the backup and the rollback. Assign one owner for the go or no-go decision and agree on the failure conditions in advance, such as any failed flow from the test plan, so the team does not improvise under pressure.
Questions teams ask before they upgrade Keycloak patches
What drives the cost of a Keycloak patch upgrade?
The main driver is how much of your Keycloak setup the patch touches. A single development instance costs far less to patch than a clustered production deployment with custom providers, LDAP or Active Directory federation, brokered identity providers and many client applications. Cost has three parts: internal staff time for planning and sign-off, environment preparation and testing, and any outside engineering time. Ask for a quote that lists the number of nodes, the high availability design (single cluster, multi-cluster v2, or the deprecated v1), the database product, whether custom providers or themes need retesting, the deployment method (Operator or manual), and the number of environments to promote through. Write-up of the first runbook is one-time work. Each later patch cycle recurs, so ask which items the quote covers each time.
How long does a Keycloak patch upgrade take?
The duration depends on the number of environments, the size of the cluster, the number of login methods to test and how quickly your change approvals move. A patch to a lab instance with no custom code is short, while a production rollout that needs compatibility checks, database backup verification, node-by-node restarts and regression testing takes longer. Ask for the schedule in the written scope, with each stage listed separately: compatibility review of the release notes, lower-environment testing, change approval, production rollout and post-upgrade verification. Confirm which stages wait on your team, such as test account creation or maintenance window approval. Keep patch planning separate from feature upgrades, because the project plans its minor releases on its own cadence.
What does a Keycloak patch need from our internal team?
The work needs decisions and access more than hours. Name an owner for the identity platform who knows the configurations, client applications and user federation links. Provide access to the Kubernetes or virtual machine environment, the database with tested backup and restore rights, and the metrics endpoint if you enable it with the metrics option. Someone with change approval authority must sign off the test results and the rollback plan. Your team should also supply test accounts for each sign-in method in use, including passwords, one-time passwords, WebAuthn or passkeys, and any brokered identity provider. Confirm these people and windows before the schedule is fixed, because delays in approvals usually cost more time than the technical work.
Can our own team apply a Keycloak patch without outside help?
Many teams that already operate Keycloak can apply patches themselves, provided they have a written rollout procedure, tested backups and a regression test set that covers every sign-in path. Check whether your team has run a clustered deployment, understands sticky session configuration, knows how the database schema migrates at startup, and can read the release notes for changes that affect your settings. The usual gaps are untested custom providers, unclear rollback steps and skipped compatibility checks. Outside help is often most useful for the first cycle, for testing custom code, or for writing the runbook that later cycles reuse. Assess these skills honestly before deciding, and ask any provider to state in writing what knowledge transfer is included.
Can a Keycloak patch be applied with zero downtime?
A patch can often be applied without a full outage when Keycloak runs as several nodes behind a load balancer with sticky sessions, and the nodes are restarted one at a time. The approach works only if the database and cache stay available throughout, and if the patch does not require a coordinated restart of every node. A single-node deployment cannot avoid a restart window. Check the release notes for changes to session handling, token behavior or schema migration, and test token refresh and logout in a staging environment that matches production. The project states that breaking changes in minor releases are opt-in, but patch notes should still be read for any change that needs action. Ask for the rollout plan and the observed behavior in staging before accepting the approach.
How should we handle Operator approval mode for Keycloak updates?
Use manual approval mode. The Keycloak Operator documentation strongly recommends it to avoid unintended automatic upgrades. Install the Operator through Operator Lifecycle Manager, which the documentation recommends, and pin the subscription to a channel your team chooses. For each patch, review the release notes, promote the change through lower environments, and approve the install plan in each environment separately. Keep the Keycloak custom resources in version control so that every change is traceable. Confirm with the Operator documentation what a version change does to custom resource definitions and how the Operator performs the rolling update in your configuration. Document who may approve production installs, because automatic approval removes that control.
What should we do if a Keycloak release changes SMTP, logout tokens or multi-site behavior?
Treat each change as a configuration task that needs testing before rollout. The 26.8 upgrade notes list three changes that affect many deployments. SMTP now requires StartTLS without plaintext fallback, so a mail relay that offers only plaintext will break password reset and notifications. Backchannel logout tokens from external providers must have their signatures validated, so confirm each provider signs them and that the keys are configured. Login failures are persisted to the database by default, which adds write load and needs a retention decision. The notes also recommend moving from the deprecated multi-site feature to the stateless feature, which is usually a separate project. Inventory these settings, test mail delivery and logout with every external identity provider, and confirm whether your target release carries each change.
How DeployOpen scopes and delivers a Keycloak patch upgrade
DeployOpen plans and applies Keycloak patch releases inside your own infrastructure, so the identity service keeps answering sign-in requests while nodes restart. Each engagement starts with a written scope that names the Keycloak version, the database, the deployment topology and the rollout method. Engagements are fixed-scope, and ongoing patch support is available as a retainer.
How we scope
- The written scope names your current Keycloak version, the target patch release and the database in use.
- Scope records the deployment topology, including clustering, reverse proxy and whether the Operator manages Keycloak.
- Scope lists the sessions, custom providers and federation settings the patch must leave unchanged.
How we build
- We run the update-compatibility check against your realm exports and custom providers before any change is made.
- Rolling restarts are sequenced behind sticky sessions so active logins stay with a node during each restart.
- Where the Operator manages Keycloak, we use its rolling update strategy and keep operator updates under manual approval.
How we hand over
- Handover includes a runbook with pre-patch checks, the restart order and the rollback steps for your team.
- Test evidence from the staging rollout is documented, covering the sign-in, token and logout checks agreed in scope.
- Your team receives configuration and version records so future patch releases can follow the same procedure.
How we support
- Ongoing patch support can run as a retainer that covers each future Keycloak patch release as it is published.
- Retainers can include continuous testing of the upgrade path against new patch releases before your production rollout.
- Confirm response expectations, release coverage and metrics checks in the written agreement before you sign.

