Keycloak 24 to 25 upgrade

A Keycloak 24 to 25 upgrade changes hostnames, session persistence, password hashing, metrics endpoints and token claims. This page explains what to change, in what order, and how to test and roll back.

On this page

Why a Keycloak 24 to 25 upgrade is the first step toward 26

A team running Keycloak 24 that needs to reach 26 must go through 25 first if user sessions have to survive the move. The 24 to 25 step changes hostname handling, persists user sessions, switches password hashing to Argon2, moves metrics and health endpoints to a management port, removes the session_state claim and adds the basic client scope. Those changes touch login URLs, token contents, monitoring and stored credentials, so each one needs a check before the next major step begins. The supported path is 24, then 25, then 26, with the minor releases in between handled as their own upgrades.

The Keycloak 26 upgrade guide tells teams to reach 25 and enable persistent sessions before moving on. Its reason is specific: Keycloak 26 replaced JBoss Marshalling with Infinispan Protostream, and a team that skips the persistent session step can lose active user sessions during the change. For that reason, the 24 to 25 upgrade is planning work for the sessions and cache layer, not only a version bump. Confirm in your own environment whether your deployment stores sessions in the database today, which determines how much of the persistent session setup is already in place.

Plan the 24 to 25 step with the 26 move in mind, and check the target line before you set dates. The current release line is 26.8.1, published October 13, 2026, so the upgrade you plan now will land on a line that has already moved on. Review the Keycloak upgrading guide for every release between your current version and your target, and record which hostname, metrics and token changes affect your own clients and monitoring before you schedule the work.

What changes in Keycloak 25 and what each change asks of you

This table lists each change in the Keycloak 25.0.0 migration notes, the effect it has on a running 24 deployment, and the action to take before or during the upgrade. Read the impact column first to find the changes that touch your realms, clients, monitoring or container image, then use the action column to plan the work. Exact option names and values are in the upgrading guide, so confirm them there before you change any configuration.

ChangeImpactAction needed
New hostname optionsThe hostname settings are reworked, so a configuration that worked on 24 may resolve public URLs differently after the upgrade.Reconfigure: review your hostname settings against the upgrading guide and confirm issuer and redirect URLs in a test realm.
Persistent user sessionsUser sessions are stored in the database rather than only in memory, which affects database load and how sessions survive restarts.Check and test: size the database for session writes and confirm the behavior during a rolling restart.
Argon2 password hashingNewly set passwords can use Argon2, which is more resource intensive than the previous hashing. Existing hashes stay valid until users change passwords.Test: measure login and password change latency on realistic node sizes before you change the default policy.
Metrics for embedded caches and HTTP endpoints enabled by defaultMetrics output changes, and cache and HTTP series appear without opting in, which can raise scrape volume and storage.Check: review your Prometheus scrape configuration and retention, and confirm which metrics dashboards and alerts still match.
Management port for metrics and health endpointsMetrics and health endpoints move off the main HTTP port, so existing probes and scrape jobs can fail after the upgrade.Reconfigure: update liveness, readiness and Prometheus targets, and confirm the management port is not exposed publicly.
New default client scope basicTokens for clients that rely on default scopes can contain different claims after the upgrade.Test: compare token contents for each client before and after, and assign the basic scope where your applications need it.
Removal of the session_state claimApplications or resource servers that read the session_state claim from tokens will no longer receive it.Check and change: search your applications for session_state use and move to a supported claim or session check.
Sub claim added to access tokens through a protocol mapperAccess tokens gain a sub claim through a mapper, which matters if your mappers or resource servers already produce or validate that claim.Check: review existing mappers for duplicate or conflicting claims and confirm how your resource servers validate subject identifiers.
Oracle Database driver no longer shippedDeployments that use Oracle Database cannot rely on the driver included in the distribution.Add a driver yourself: place a supported Oracle JDBC driver in the image or server before the upgrade and test database connectivity.

How hostname and management port changes affect your proxy and monitoring

The hostname and management port changes in Keycloak 25 alter what your load balancer, Kubernetes probes and Prometheus scrapes talk to, so inventory them before any cutover. Keycloak 25.0.0 introduced new hostname options and moved metrics and health endpoints to a separate management port. A proxy rule, liveness probe or scrape job that points at the old port or path can fail even though Keycloak itself is running. Confirm the exact hostname and management settings in the 25 documentation in the Keycloak upgrading guide before you edit any configuration file, because the option names and defaults are what your team will be checking against.

The production guide asks for TLS on all communication, a reverse proxy that restricts paths, and a separation between the admin console and Administration REST API and the public frontend URLs. In practice, the proxy should expose only the paths users need on the public hostname, while the admin surface sits on its own hostname or context path reachable from your internal network. Review every route, including any rule that forwards /admin or /realms to the public side, and check that forwarded headers still produce the correct external URLs for redirects and token issuers. A mismatch here often shows up as login redirects to the wrong host rather than as a clear error.

Build a written inventory of every probe and scrape target: load balancer health checks, Kubernetes livenessProbe and readinessProbe entries, monitoring agents, and Prometheus jobs that scrape /metrics. For each one, record the current address, port and path, the owner, and the alert that depends on it. Then confirm each entry against the 25 documentation and test it in a non-production environment with the management port enabled. Plan the cutover so that probes and scrape configs change in the same window as the Keycloak nodes, and keep the old endpoints available during the switch if your proxy and orchestration allow it.

What to prepare before you touch the 24 installation

Keycloak 24 to 25 changes how hostnames, metrics, health endpoints and sessions behave, so most of the risk sits in preparation rather than in the upgrade command itself. The six items below cover recovery, inventory, compatibility, testing, monitoring and approval, and each one should be closed before the change window is booked.

Restorable database backup and tested restore

Keycloak stores realms, users, clients and sessions in its database, and the schema migrates automatically at startup by default. Take a full backup of the database that your Keycloak 24 installation uses, then restore it into a separate instance and confirm that you can log in to a test realm. A backup that has never been restored is an assumption, not a rollback plan. Record who owns the restore step and how long it took.

Upgrading guide

Inventory of custom code and configuration

List every custom login theme, SPI provider, realm export and client configuration that runs on the 24 installation. Note the version of each provider and which Keycloak APIs it calls, because a provider built for 24 may need rebuilding against 25. Export realms and clients as files and store them under version control, so you can compare the 24 and 25 configurations side by side after the upgrade.

Supported database and migration mode

Confirm that your database is on Keycloak's supported production list, including PostgreSQL 14 to 18, and that the version you run falls inside that range. Then choose between automatic schema migration at startup, the default, and manual migration, where your administrators apply the SQL themselves. Manual migration is the route the upgrading guide suggests for large deployments, so decide this before the change window rather than during it.

Database guide

Production-like test environment with real realm data

Build a staging installation that matches production in Keycloak version, database engine, proxy setup and cluster size. Load a copy of production realm data, not a small seed set, so that user counts, federation links and client mappings behave as they will in production. Run your login, token refresh, logout and admin workflows against the 25 build there first. Staging data must be handled under the same access and privacy rules as production data.

Metrics and health check inventory

In Keycloak 25, metrics and health endpoints move to a management port, and HTTP endpoints for metrics are enabled by default. List every dashboard, alert, load balancer probe and monitoring job that reads from the 24 endpoints, along with its current URL and port. Update each one to the management interface and confirm that scrapes and probes succeed in staging. Without this list, a monitoring gap can appear after the upgrade with no visible error on the login page.

Change approval and Operator approval mode

Name the person who approves the upgrade, the person who runs it and the person who can call a rollback. If you run Keycloak on Kubernetes through the Keycloak Operator, the Operator documentation strongly recommends manual approval mode for operator updates, so that a new version is never applied without a reviewed plan. Agree the approval step in writing, including the test evidence you need before signing off.

Operator installation

Upgrade in stages: 25 first, then 26 with persistent sessions already on

The diagram starts with inventory and a backup, then tests the upgrade on a staging copy before any production node changes. Next comes a choice between automatic schema migration at startup and manual SQL, followed by upgrading the first node. Checks on hostnames, the management port probes, metrics and login flows gate a proceed or roll back decision. A proceed path leads to running on 25 with persistent user sessions enabled, which is the step that prepares the move to 26.

Staged path from Keycloak 24 to 25, ending with persistent sessions ready for 26.

How to sequence the 24 to 25 upgrade with checks and rollback points

This sequence moves a Keycloak 24 deployment to 25 in an order where each stage has a verified backup, a tested result and a recorded rollback point, so a failed check stops the work before it reaches production users.

  1. Take and verify the database backup

    The database owner takes a full backup of the Keycloak database before any change, then restores it to a separate instance to confirm it is usable. Keycloak stores realms, clients, users and sessions there, so this backup is the primary rollback point for the schema. Done means a restore test completes and someone other than the person who took the backup has signed off on the restore log. Rollback note: if the restore test fails, stop here, because no later step has a valid way back without it.

  2. Freeze realm configuration changes

    The Keycloak administrators agree a change freeze covering realms, clients, identity providers, authentication flows, themes and custom providers for the upgrade window. They export the current realm configuration as a reference copy and record the running Keycloak version and the database version. Done means the freeze is announced, the export is stored with the backup set, and the team can name who may still make an emergency change. Rollback note: the export is the reference for comparing realm state after a rollback.

  3. Rehearse the upgrade in staging with a database copy

    The platform team restores the verified backup into a staging environment, deploys Keycloak 25 with the same configuration and custom providers, and starts it against the copy. They run the full set of login, token and admin checks from the later steps against this copy. Done means the staging start completes, the migration log shows no errors, and every custom provider loads. Rollback note: staging can be rebuilt from the same backup, so a failed rehearsal costs nothing in production.

  4. Review hostname and proxy settings

    The engineers compare the Keycloak 24 hostname and proxy configuration with the hostname options introduced in the 25.0.0 release, and check that the public frontend URL differs from the admin console and Administration REST API hostname or path, as the production guide advises. They confirm TLS terminates correctly at the reverse proxy and that path restrictions still apply. Done means the staging configuration is written down and a login through the proxy redirects to the correct public hostname. Rollback note: keep the 24 configuration file under version control so the previous values can be restored in one change.

  5. Choose automatic or manual schema migration

    The database administrator decides whether Keycloak applies the schema changes at startup or whether the SQL is applied by hand. The upgrading guide suggests manual migration for large deployments, so the team should measure table sizes in staging before choosing. Done means the chosen method is recorded, and if manual, the generated SQL has been reviewed and run successfully against the staging copy. Rollback note: schema changes are the hardest part to reverse, so the rollback point for this step is the verified backup from the first step, and it must be restorable before production work begins.

  6. Update the management port and monitoring targets

    The operations team moves metrics and health endpoints to the management port introduced in 25.0.0 and updates Prometheus scrape targets, liveness and readiness probes, and load balancer health checks to match. They confirm that metrics are enabled with the setting that exposes them, and that the new port is reachable only from monitoring and orchestration networks. Done means the scrape targets show as up and the probes report healthy in staging. Rollback note: keep the old target definitions in the monitoring repository so they can be reapplied if the new port is not reachable.

  7. Deploy to production in a rolling or maintenance window

    The release owner deploys Keycloak 25 to production using either a rolling replacement of nodes or a maintenance window, based on the sessions and client impact agreed for the environment. The team records a rollback point before each node or stage, including the image or package version and a fresh backup marker. Done means each node starts, passes its health check and joins the cluster before the next one is replaced. Rollback note: if a node fails its health check, stop the rollout and return that node to version 24 using the recorded point.

  8. Verify login, tokens, admin access and metrics

    The QA and operations teams test a sign-in for each client type, decode a sample access token to confirm the sub claim is present and the session_state claim is absent, open the admin console, and confirm that metrics and health responses come from the management port. They compare the realm configuration with the export from the freeze step. Done means every check passes and the results are logged with the release record. Rollback note: if a token check fails for a client, keep production on version 25 only if that client can be fixed without a schema reversal, otherwise return to the recorded point.

How the upgrade differs by deployment model

On a virtual machine or a container host run by your own tooling, your team owns every step: pulling the new distribution or image, updating configuration, running the server against a copy of the database and restarting nodes. Nothing applies the update for you, so the change is only as controlled as your change process. Keycloak applies database schema migration automatically at startup by default, and the upgrading guide also describes manual migration, which administrators run as SQL themselves. Choose the mode before the change window opens.

  • Who applies the update: your platform or infrastructure team, using the release notes and the 25.0.0 migration notes in the Keycloak upgrading guide.
  • Migration mode: automatic startup migration is the default, while manual SQL suits large databases. Decide and rehearse this in advance.
  • Configuration changes: the new hostname options and the move of metrics and health endpoints to the management port must be reflected in your launch configuration and reverse proxy rules.
  • Restarts: stop and start nodes in a sequence your load balancer can absorb, and confirm that the 24 to 25 step itself is not a zero-downtime change in your own test.
  • Rollback: keep a restorable database backup taken before the first startup on 25.

Confirm the exact procedure and any node-by-node restart guidance against your own rehearsal in a non-production copy.

What makes a Keycloak 25 upgrade take longer

This table lists the factors that most often lengthen a Keycloak 24 to 25 upgrade and explains why each one matters. Use it to scope your own environment before asking for a quote, since each row points to something you can count or inventory. The main takeaway is that custom code, token consumers and monitoring tied to old endpoints usually cost more time than the server upgrade itself.

DriverWhy it mattersHow to size it
Custom SPI providers and themesProviders and login themes are compiled against the server and must be tested, and sometimes rebuilt, on 25 before any production change.Count each provider and theme, note which Keycloak APIs each one uses, and test them on a copy of the server.
Oracle Database driverKeycloak 25 no longer ships the Oracle Database driver, so deployments on Oracle need the driver supplied separately before they start.Confirm whether the database is Oracle, then check how the JDBC driver is added to your image or distribution.
Realms and clients relying on session_stateApplications or mappers that read the removed session_state claim will fail or behave differently after the change.Search client mappers, application code and gateway rules for session_state, and list each realm and client that depends on it.
Token contents read by applicationsThe new sub claim in access tokens through a protocol mapper and the new basic client scope change what applications receive, which matters for strict token parsers.Inventory every application that validates or parses tokens and record which claims each one reads.
Size of user session and event tablesPersistent user sessions write session data to the database, so large session and event tables affect migration time and database load.Check row counts for session and event tables and plan a restorable backup before the schema migration starts.
Number of environments and clustersEach environment, including development, test, staging and every cluster node set, must be upgraded and verified in the same order.List every environment and cluster, then decide which are upgraded first and which validate the result.
Probes, scrapes and dashboards tied to old endpointsMetrics and health endpoints move to the management port, so health checks, Prometheus scrapes and dashboards can stop reporting silently.Inventory load balancer probes, Prometheus jobs, alert rules and dashboards that query Keycloak, and update each one.

Why enabling persistent sessions on 25 protects the move to 26

Enable persistent user sessions on Keycloak 25 before you move to 26. Keycloak 26 replaced JBoss Marshalling with Infinispan Protostream as the way session data is serialized in caches, and the upgrading guide says that teams who skip the 25 step can lose user sessions when they move on to 26. The practical risk is that people signed in across your applications are forced to authenticate again, and any long-running service or client that depends on an existing session may fail until it obtains new tokens. Reaching 25 first gives you a release where the persistent session setting can be turned on and tested while the old serialization format is still in use.

Persistent sessions in 25 sit alongside the other changes in this release. The new hostname options and the management port change how the server builds URLs and where it exposes health and metrics, so a session test that passes against an old hostname configuration may not reflect production. Set --hostname and proxy settings to the values you will run in production, confirm your reverse proxy forwards headers as expected, and then test with persistent sessions enabled. Confirm the exact configuration keys and their defaults for your deployment against the Keycloak upgrading guide before you change anything.

Validate session behavior with a test user population before you go further. Pick a set of test accounts that cover your realms, identity brokers and applications, sign them in, leave sessions idle, restart a node, and check that single sign-on, token refresh and logout still behave as expected. Record the results so you can compare them after the move to 26. The detailed steps for the 26 change, including the Protostream cache behavior and testing custom providers, are covered on the sibling page for the Keycloak 25 to 26 upgrade.

Questions teams ask before a Keycloak 24 to 25 upgrade

What does a Keycloak 24 to 25 upgrade cost?

The cost is the labor to plan, test and carry out the upgrade, plus any change to the environment it requires. Whether your own team or a partner does the work, the main cost components are the review of your current configuration, the test environment, the upgrade runs themselves, and the documentation and handover at the end. Costs rise with the amount of custom code, such as themes or SPI providers that must be retested against 25, with the number of realms and clients, with the size of the database, and with the number of environments that must be brought up to the new release. Costs also rise with testing depth, for example if you need regression testing of every application that signs in through Keycloak. A standard configuration with few customizations costs far less to move than a heavily extended one. Ask any provider for a quote built from a written scope that lists these items, and ask which items are one-time and which recur, such as ongoing patch upgrades.

How long does a Keycloak 24 to 25 upgrade take?

Duration depends on the size and complexity of your deployment, not on the version number alone. The main drivers are the number of nodes and environments, the number of custom providers and themes that need testing, the number of applications whose sign-in flows must be checked, and how long the database schema migration takes on your data. Your change control process and the test window you can get from application owners also set the pace. Keycloak migrates the database schema automatically at startup by default, but the upgrading guide also describes manual migration, which some teams choose for large deployments so a database administrator can review the SQL first. Plan for a staging run that mirrors production before any production change. Ask for a timeline in the written scope that separates the staging rehearsal, the production window and the post-upgrade monitoring period.

What does the upgrade need from our team?

The work needs four groups of people, and their availability is often the real constraint. Realm owners confirm which realms, clients, identity providers and authentication flows matter and sign off on test results. Application owners confirm that their applications still complete sign-in, token refresh and logout after the upgrade. A database administrator checks backups, reviews the schema migration plan and confirms the database engine and version are supported by the target release. Someone who owns the platform or infrastructure handles the deployment, load balancer and proxy configuration, and the test window. Your team also needs access to a staging environment that resembles production and a documented rollback plan. Agree these roles and dates before the work starts so the test window is not lost to scheduling.

Can our team do a Keycloak 24 to 25 upgrade alone?

Yes, for a simple deployment that is fully documented, has few customizations and has a test environment with a clear rollback path. The upgrade guide for each release lists the changes that affect configuration, and a team that already runs Keycloak in a controlled way can work through them in order. The 25 release has changes that need deliberate decisions, including the new hostname options, the move of metrics and health endpoints to the management port, the removal of the session_state claim and the new basic client scope, and the new Argon2 password hashing. Those are manageable for an experienced team but can break monitoring, proxy rules and client code if missed. A team with custom providers, many realms, a multi-node cluster or no staging environment should get a second review before the production change.

Does the Keycloak Operator change how the upgrade is done?

Yes, the Operator changes how the new version reaches your cluster, but the upgrade checks stay the same. If you deploy Keycloak with the Keycloak Operator, the version is tied to the operator release, so you must check the Operator installation and update settings before changing anything. The Operator documentation strongly recommends manual approval mode for operator updates to avoid unintended automatic upgrades, so an update cannot land on production without someone reviewing it. Confirm the release channel, the Keycloak custom resource version and whether your Keycloak resources are managed through GitOps tooling, because a change in those places can roll out differently. Test the new Operator version and the 25 configuration in staging, including the metrics and health port changes, before you approve the production update. Ask your provider to show the approval steps as part of the written scope.

Do we need a consultant or partner for the Keycloak 26 follow-on?

Not always, but the 26 step is where teams most often need outside help. The upgrading guide advises upgrading to Keycloak 25 first and enabling persistent user sessions before moving to 26, because Keycloak 26 replaced JBoss Marshalling with Infinispan Protostream, and sessions can be lost without that preparation. Your team can complete the 25 upgrade and then plan 26 as a separate project with its own test cycle. A partner is most useful when your deployment has custom providers or themes that need rebuilding, when the hostname and proxy settings must change, or when you need evidence for an internal or external review. DeployOpen plans, implements, tests, documents and supports self-hosted Keycloak inside your own infrastructure, and it prepares evidence for compliance assessments without issuing audit reports. Most engagements are fixed-scope, so ask for the 26 work to be scoped in writing separately from the 25 work.

How DeployOpen works on this

DeployOpen plans and carries out Keycloak 24 to 25 upgrades inside your own infrastructure, with the scope agreed in writing before work starts. We work through the 25.0.0 changes against your realms, clients, hostname and monitoring setup, then document and hand over the result so your team can run it.

How we scope

  • We inventory your current Keycloak 24 deployment, database, hostname settings, clients and custom providers before agreeing the work.
  • Engagements are fixed-scope, with the upgrade path, deliverables and timelines agreed in writing before work starts.
  • We confirm which 25.0.0 changes touch your environment, such as hostname options, the management port and removed session_state claim.

How we build

  • We test the upgrade in a non-production copy of your realms, using a database backup you can restore if a step fails.
  • We update hostname, proxy and metrics configuration, then check that sign-in, token issuance and logout work for each client.
  • We record every configuration change and test result so the production change follows a repeatable sequence.

How we hand over

  • You receive a written upgrade record covering configuration changes, test results, rollback steps and open items.
  • We walk your platform and security teams through the new management port, metrics endpoints and monitoring changes.
  • We confirm with you which follow-on work, such as the 26 upgrade path, remains with your team and which we can scope next.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers for Keycloak after the 25 upgrade.
  • A retainer can cover the next Keycloak release steps, including reviewing per-release migration notes before each change.
  • Ask any provider which parts of the upgrade remain your responsibility, and get that split written into the scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.