Keycloak vs OpenLDAP

Keycloak handles single sign-on and federation for applications, while OpenLDAP stores directory entries that apps query over LDAP. Most enterprises that run both use the directory as the user source and Keycloak as the login front end.

On this page

Keycloak vs OpenLDAP: when each one is the right choice

Keycloak and OpenLDAP solve different problems, so the real question is which of them your applications need to talk to. Keycloak is an SSO and federation server: it signs users into web applications over OpenID Connect, OAuth 2.0 and SAML 2.0, brokers logins to external identity providers, and can read users from an LDAP or Active Directory directory through its LDAP user federation. OpenLDAP is an LDAPv3 directory server (slapd) that stores users, groups and other entries and answers LDAP queries and binds. It does not issue tokens or run a login flow for browser apps. Before you choose, inventory three things: which applications speak OIDC or SAML, which clients can only speak LDAP, and whether a directory already holds the identities you need.

If your estate is mostly web and SAML applications and no legacy client binds to LDAP, Keycloak can usually stand alone, with its own user store or with federation to an existing directory. If you have LDAP-only clients such as older Linux login, mail or NAS appliances, you still need a directory that answers LDAP, and the directory must be the place where those clients authenticate. In that case, the common pattern is to keep the directory as the system of record and point Keycloak at it with LDAP user federation, so applications get SSO while the LDAP clients keep working. Confirm in the Keycloak server administration guide how your chosen federation mode handles password validation and attribute writes before you settle on the design.

Treat this as a complementary decision rather than a pick-one one. A directory alone is enough when every client uses LDAP and you do not need browser SSO, tokens or SAML. Keycloak alone is enough when identities already live in a system Keycloak can federate or when applications can hold their own accounts. Running both is normal when a directory is the authoritative store and Keycloak is the front door for modern apps. Plan for a dependency: if the directory goes down, federated logins fail, so the directory's replication design matters as much as Keycloak's database and high availability setup. Ask your team to map every application to its protocol and to the store that holds its accounts, and let that map decide the architecture.

Which platform fits which scenario

This table maps common identity scenarios to the platform that fits each one, and names the condition that tips the decision. Keycloak handles browser and API single sign-on, while OpenLDAP stores directory entries and serves LDAP clients, so many rows point to using both together.

ScenarioBetter fitCondition that drives the choice
Web SSO for SaaS and internal apps using OIDC or SAMLKeycloakChoose Keycloak when applications need browser-based login, token issuance or SAML. OpenLDAP speaks LDAP only and does not issue OIDC or SAML tokens.
Legacy clients that only speak LDAP bind and searchOpenLDAPChoose OpenLDAP when the application cannot use a modern protocol and needs a native LDAP server. Keycloak can federate from an LDAP directory but does not replace the directory for these clients.
An existing directory with no SSO layerOpenLDAP (add Keycloak later)If you already run a directory and only need a few apps, the directory may be enough for LDAP authentication. Add Keycloak once you need SSO, MFA or several protocols across applications.
Linux and Unix login with host-based policyOpenLDAPOpenLDAP provides directory entries for accounts and groups, but Kerberos, host policy and certificates are outside its scope. For a fuller Linux identity stack, confirm whether FreeIPA is a better fit.
B2B tenants that manage their own usersKeycloakKeycloak's organization and realm features suit multi-customer products. Confirm the exact tenant model for your version before design, since OpenLDAP has no tenant concept beyond directory tree design.
Central user store with SSO in front of itBothKeep users in OpenLDAP where legacy clients need them, and point Keycloak at the directory through LDAP user federation. Passwords and group data stay in one place while SSO is handled by Keycloak.
Multi-provider replication for the directory tierOpenLDAPslapd supports multi-provider replication when a single point of failure is not acceptable. Keycloak's high availability depends on its own synchronously replicated database, so plan both tiers separately.
Team with no operations capacity for two systemsKeycloak or OpenLDAP aloneRunning both adds a second service, a federation link and its upgrades. If one protocol set covers your needs, choose that one and confirm the support model in writing.

How each platform is built and what that means for operations

Keycloak and OpenLDAP solve different problems, so they are built differently and fail differently. The cards below cover what each one stores, how it is deployed, how it replicates and what each choice asks of the team that runs it.

What Keycloak stores

Keycloak keeps realms, clients, users, roles and sessions in a relational database. In production that database is required, and Keycloak supports PostgreSQL 14 to 18, MariaDB, MySQL, Microsoft SQL Server, Oracle Database and Amazon Aurora PostgreSQL. The default dev-file database is for development only. Your database team becomes part of the identity service, so confirm backup, restore and patching ownership before go-live.

What OpenLDAP stores and serves

OpenLDAP's slapd stores LDAPv3 entries, typically in its MDB backend, a transactional store built on LMDB. It serves directory lookups and binds over IPv4, IPv6 and Unix IPC, with SASL and TLS certificate authentication. It does not issue tokens or run a login flow. Applications that need OIDC or SAML still need a separate service in front of the directory.

Keycloak deployment routes

You can run the Keycloak server distribution on virtual machines or deploy it with the Keycloak Operator on Kubernetes or OpenShift, installed through Operator Lifecycle Manager or kubectl. The Operator does not provision your database. The Keycloak docs strongly recommend manual approval mode for operator updates, so upgrades stay a scheduled change rather than an automatic one.

OpenLDAP replication topologies

slapd supports single-provider, multiple-consumer replication, where one writable server feeds read-only copies, and multi-provider replication, where several servers accept writes. Multi-provider suits sites where a single point of failure is not acceptable, but it adds conflict handling to the design. Confirm which topology your directory needs before you choose the number of servers.

Keycloak high availability designs

Keycloak documents a single cluster optionally spread across availability zones, a multi-cluster v2 design without an external Infinispan cluster, and the deprecated multi-cluster v1 design. Both supported designs require a synchronously replicated database. Ask your database team whether that replication is available across your sites before you commit to a topology, since latency will shape it.

Who runs each platform

A Keycloak deployment needs people who handle realm configuration, OIDC and SAML client setup, database administration and clustering. An OpenLDAP deployment needs people who manage schema, access control lists, TLS and replication. Teams that already operate PostgreSQL and Kubernetes can absorb Keycloak more easily. Teams that only run LDAP for Linux or legacy apps will need to plan that skill gap explicitly.

Capability comparison: Keycloak vs OpenLDAP

This table sets Keycloak, an SSO and federation server, against OpenLDAP, an LDAPv3 directory server, row by row on role, protocols, storage, federation, brokering, administration, database needs and high availability. Read it by asking which rows your applications depend on: if they need web SSO tokens, Keycloak covers that; if they need a directory that speaks LDAP, OpenLDAP does. Many teams use both, with OpenLDAP as the user store and Keycloak in front of it.

CapabilityKeycloakOpenLDAP
Primary roleIdentity and access management server for single sign-on, identity brokering, user federation and fine-grained authorizationLDAPv3 directory server (slapd) and tools for storing and serving directory entries, plus a load balancing proxy (lloadd)
ProtocolsOpenID Connect, OAuth 2.0 and SAML 2.0LDAPv3 over IPv4, IPv6 and Unix IPC, with strong authentication through SASL and certificate authentication through TLS
User storageKeeps its own user store in the relational database; can also read users from an existing LDAP or Active Directory directoryStores directory entries in its MDB backend (built on LMDB); it is the store, not a consumer of one
LDAP user federationReads users from LDAP or Active Directory, so applications sign in through Keycloak while the directory remains the source of passwords and attributesNot applicable as a federation client; it serves entries to LDAP clients, and Keycloak sits on the client side of that relationship
Identity brokeringBrokers logins to external OpenID Connect or SAML identity providersNot supported; OpenLDAP does not broker logins to external identity providers
Admin consoleIncludes an admin console for realms, clients, users and rolesNo web console in the supplied facts; administration uses LDIF files and command line LDAP utilities. Confirm tooling you plan to use
Database requirementA relational database is required in production (PostgreSQL 14 to 18, MariaDB, MySQL, SQL Server, Oracle and others); the dev-file database is for development onlyNo relational database; the slapd main backend is MDB. Confirm backend choices for your version before deployment
Replication or high availabilityDocumented high availability designs need a synchronously replicated database; cluster architecture is a separate design decisionSupports single-provider, multiple-consumer replication and multi-provider replication where a single point of failure is not acceptable
Current releasesKeycloak 26.8.1, published October 13, 2026Feature release 2.7.1 and long term support release 2.6.15; confirm which line your support model requires
LicenseApache 2.0OpenLDAP Public License, described by the project as a non-restrictive, free, open-source license

Licensing and editions: what is free and what is paid

Keycloak is licensed under Apache-2.0, and the project's LICENSE file governs use, modification and redistribution of the community server. You can run the upstream release in your own infrastructure without a license fee, and the cost of running it is the people, database and infrastructure you provide. The project is also a Cloud Native Computing Foundation incubating project, which describes its governance rather than any paid tier.

  • No license fee for the upstream server: Apache-2.0 places no per-user or per-instance charge on the community distribution.
  • Current release: Keycloak 26.8.1, published October 13, 2026, is the current community release.
  • Release cadence: Since Keycloak 26.0, the project plans four minor releases a year and a major release every two to three years.
  • Opt-in breaking changes: The project says breaking changes in a minor release will be opt-in, which affects how much upgrade work each minor release creates.
  • Database and operator costs: Production needs a supported relational database, and the Operator installs Keycloak but leaves the database to you.

Confirm with your legal team how Apache-2.0 applies to any modifications or custom extensions you plan to build, and confirm with the project which release line your support plan will cover.

How Keycloak's LDAP user federation works and where it stops

Keycloak reads users and groups from OpenLDAP through user federation, so passwords and directory records can stay where they are while Keycloak issues OpenID Connect and SAML tokens to applications. Keycloak authenticates the user against the directory, then maps the directory entry to a Keycloak user for token claims and role or group mapping. The LDAP provider's connection settings, bind credentials, user object classes, attribute mappers and group mappers decide what Keycloak sees. Because the directory remains the source for these attributes, a change made in OpenLDAP reaches Keycloak through its periodic and on-demand sync, not instantly. Confirm with your directory administrator which attributes are read-only in Keycloak, whether any write-back (such as password changes) is enabled, and how deleted or disabled entries are handled, since these depend on your schema and the provider mode you select.

Federation does not remove the need for Keycloak's own database. Keycloak stores realms, clients, sessions, consents, local users and the federation mappings in its relational database, which must be production grade (the Keycloak database guide lists the supported engines). Plan for that database as a separate component with its own backup, high availability and upgrade path. Some identities also live outside OpenLDAP by design: Keycloak-only accounts such as service or break-glass users, and logins brokered to an external OIDC or SAML identity provider. Inventory these before go-live, because an audit of "who can sign in" must cover the directory and Keycloak's local store together.

A directory alone is enough when every client speaks LDAP directly, sessions are local to each application, and there is no need for web single sign-on, SAML, a central login page or token-based access for browsers and APIs. In that case, adding Keycloak adds a database, an admin console and a token service to operate without solving a problem you have. Keycloak becomes worth its operating cost once applications need SSO across several web apps, SAML service providers, or OIDC clients, and then it sits in front of OpenLDAP rather than replacing it.

What drives the running cost of each option

Running Keycloak and OpenLDAP costs different things. Keycloak adds application nodes and a production database, while OpenLDAP adds directory servers and replicas that most teams already run. The cards below cover where that cost sits, what is paid once, what recurs and what to put in a written quote.

Infrastructure footprint

Keycloak needs application nodes and a production relational database. The supported databases include PostgreSQL 14 to 18, MariaDB, MySQL, Microsoft SQL Server, Oracle Database and Amazon Aurora PostgreSQL, and the default dev-file database is not for production. OpenLDAP needs slapd servers and replicas, and its MDB backend stores data without a separate database server. Ask whether the quote includes the database, its backups and its high availability design, since a Keycloak high availability design also requires a synchronously replicated database.

Platform and Operator skills

A Keycloak deployment on Kubernetes depends on Operator, Operator Lifecycle Manager and kubectl knowledge, and the Operator manages Keycloak, KeycloakRealmImport, KeycloakOIDCClient and KeycloakSAMLClient resources. A virtual machine deployment shifts that work to service management and load balancing. OpenLDAP depends on LDAPv3 schema design, ACLs, TLS and replication topology skills, which are rarer in many teams than web platform skills. Ask who will own each skill set after handover and whether the quote includes knowledge transfer.

Upgrade cadence and change control

Since Keycloak 26.0, the project plans four minor releases a year and says breaking changes in a minor release will be opt-in. The Keycloak Operator documentation strongly recommends manual approval mode for operator updates to avoid unintended automatic upgrades. OpenLDAP is split between the feature line 2.7.1 and the long term support line 2.6.15, so the team must choose a line and plan its move. Ask who tests each upgrade, how schema migrations are reviewed and whether the quote covers upgrades or only one-time installation.

Recurring operations

Patching, certificate renewal, backup restore tests and monitoring recur for both platforms, and they cover every TLS endpoint, every replica and every database. Keycloak exposes metrics for monitoring, and its certificates and database credentials need rotation alongside its LDAP federation bind account. OpenLDAP certificates and replica health need the same attention. Ask which of these tasks are included in a retainer, how often they run and who responds when a replica falls behind.

Vendor and subscription support

Keycloak is Apache-2.0 licensed, and the Red Hat build of Keycloak is Red Hat's supported distribution based on the open source project and replaces Red Hat Single Sign-On. A Red Hat subscription is therefore a decision about support terms and bundled components, not a feature unlock. OpenLDAP is available under a free, open-source license, and support depends on which third party or internal team you engage. Ask whether a support subscription is required for production and what response terms apply to each option.

One-time design and migration work

The main one-time costs are architecture design, the Keycloak user federation mapping to LDAP attributes, the realm and client setup, and any migration of existing directory data or application logins. Federation mapping is where most surprises appear, because attribute names, group membership and password policy decide what Keycloak can read. For illustrative purposes, a team that federates an existing directory will pay for the mapping and testing once, then pay recurring costs to keep it running. Ask for these items as separate line items in the written scope.

Moving between a directory-only setup and Keycloak on top of OpenLDAP

This sequence adds Keycloak in front of an existing OpenLDAP directory one application at a time, so that login moves to Keycloak without a single risky switchover. It also covers the reverse path, where Keycloak is retired and applications return to direct LDAP binds.

  1. Inventory every application that binds to LDAP

    The platform team lists each application, service account and script that binds to slapd or reads from the directory, and records the protocol it uses (LDAP simple bind, SASL, or LDAPS). Application owners confirm which features depend on group membership, attributes or password changes made through the directory. The output is a register of consumers, each marked as a candidate for SSO, direct LDAP, or retirement. Nothing moves until this register is signed off.

  2. Confirm the directory schema and data quality

    The directory team reviews the object classes, attribute names, group model (static groups, groupOfNames or posixGroup) and the DNs used for users and groups. They check which attributes Keycloak will need to map, such as mail, uid, and the group membership attribute, and flag duplicates or missing values. Keycloak's LDAP user federation expects a consistent user identifier, so this review determines the attribute used as the username. Done means a written attribute map and a short list of data fixes completed in OpenLDAP.

  3. Configure LDAP federation in a non-production realm

    The identity team deploys Keycloak with a production-grade database, not the dev-file default, and creates a test realm. They configure an LDAP user federation provider pointing at a read-only bind account, with the mappings confirmed in the previous step. Keycloak can read users from the directory, but the team should confirm with the directory owners whether password validation and writes will stay in OpenLDAP or be handled in Keycloak. Done means test users authenticate through Keycloak and their attributes appear as expected.

  4. Test authentication, lockout and password policy

    Testers run a scripted set of cases covering successful logins, wrong passwords, disabled accounts, password expiry and lockout thresholds. They compare results with the policy enforced by slapd (for example, ppolicy overlay settings) and with what Keycloak applies on its side, and confirm which layer is authoritative. They also check attribute mapping for group and role membership, and that a password change made in one place is visible in the other. Done means a signed test report with each mismatch either fixed or accepted by the owner.

  5. Rebuild clients, SAML metadata and role mappings

    For each application chosen for SSO, the team re-registers it as an OIDC client or SAML client in Keycloak, because client IDs, redirect URIs and signing certificates do not carry over from directory binds. They regenerate SAML metadata for service providers, rebuild login flows and map LDAP groups to Keycloak roles or claims. Application owners test their own sign-in path in the test realm. Done means each target application logs in through Keycloak with the expected claims.

  6. Cut over one application at a time

    The team moves applications in small groups, starting with a low-risk internal app, and keeps the direct LDAP bind available until the new login path has run without incident for the owner's acceptance period. Each cutover has a written rollback step that restores the previous configuration. Operators watch login errors and lockout counts during the window. Done means the application's owner signs off and the old bind configuration is marked for removal.

  7. Decommission legacy binds and document the end state

    Once every application in the register is either on Keycloak or confirmed as direct LDAP, the team removes unused bind accounts, rotates any remaining service credentials and disables the unused ACLs. They update the runbook with the authoritative location for passwords, lockout and group membership. In the reverse case, when Keycloak is retired, the same register is used to point each application back at slapd and to restore the old bind settings. Done means the register shows no orphaned consumers and the runbook matches the live configuration.

What implementing each involves and where projects run long

OpenLDAP implementation centers on four decisions: the schema you publish, the access control lists that decide who reads and writes which attributes, the TLS configuration that protects bind credentials and directory traffic, and the replication topology that keeps consumers answering when a provider fails. slapd's MDB backend and its single-provider or multi-provider replication options are straightforward to configure once those decisions are made, but each one is hard to change later without disturbing applications that already bind to the tree. Keycloak implementation centers on different decisions: realm design, client registration for each OIDC or SAML application, federation mapping from LDAP attributes to Keycloak user attributes, the production database, and the high availability design. Keycloak needs a relational database in production, and both supported high availability designs depend on a synchronously replicated database, so that database is a platform commitment, not a detail to settle late.

Projects usually run long in four places. The first is undocumented LDAP-only applications: legacy systems that bind directly to the directory, often with service accounts nobody remembers, and that break when the tree, the bind DN or the attribute names change. The second is inconsistent attribute schemas across directories, where mail, uid, sAMAccountName or group membership mean different things in different sources and Keycloak's federation mappings must reconcile them. The third is coexistence with Active Directory, where OpenLDAP and AD both claim authority over the same users and passwords, and the team must decide which source is authoritative for each attribute and each login. The fourth is load testing before cutover, which is easy to skip because the directory looks lightly loaded during pilots. Before scoping, inventory every application that binds to the directory or reads it, the attributes and groups each one uses, the service accounts and their passwords, the databases and TLS certificates in use, and the peak login volume you expect to test against.

Questions buyers ask before choosing Keycloak or OpenLDAP

Can Keycloak replace OpenLDAP entirely?

Not in most directory-backed estates. Keycloak is an SSO and federation server that stores its own users and reads from LDAP or Active Directory through user federation, but it does not act as a general LDAPv3 directory for every client that needs to bind and search. If legacy applications, network devices or Linux hosts speak LDAP directly, you still need a directory they can query. Confirm which clients authenticate over LDAP before you decide the directory can be retired, and check the Keycloak server administration guide for how user federation maps to your environment.

Is OpenLDAP alone enough for single sign-on?

OpenLDAP can hold identities and passwords, but it does not issue OpenID Connect or SAML tokens, broker logins to external providers, or manage browser sessions for web applications. Applications that only speak LDAP can authenticate against it directly, while modern web and SaaS applications usually need an identity provider in front of the directory. Teams that want SSO with MFA, consent and federation typically add Keycloak, and the directory remains the source of truth for accounts.

What does the internal team need to run this?

Operating either option requires people who understand directory schemas, TLS certificates and replication, and the Keycloak side adds a relational database, container or VM operations, and upgrade planning. Keycloak needs a production database, and its schema migrates at startup by default unless you choose manual migration. Identify who will own user lifecycle, certificate renewal, backups and patching for each component before you commit to the design, because those duties recur long after go-live.

Can our own team implement this without outside help?

A team with directory and platform experience can implement a basic setup internally, especially a single Keycloak realm federated to one existing LDAP server. The effort rises with multiple federation sources, custom protocol mappers, high availability, audit evidence and integration with many applications. Be honest about bench depth during an incident, not just during the first build. An outside partner can take on a fixed-scope piece of this work, but the decision depends on your skills and on what you need to hand over.

How long does implementation take?

Timeline depends on scope, not on the product name alone. The drivers are the number of directories and attributes to map, how many applications move to OIDC or SAML, the target high availability design, the database and hosting platform, and how much testing and cutover planning your change process requires. Ask any partner for a written scope with phases and dependencies, and confirm which items are included, such as migration of existing passwords, client onboarding or documentation.

How do licenses affect commercial use of Keycloak and OpenLDAP?

Keycloak is licensed under Apache-2.0, a permissive license that allows commercial use, modification and redistribution with notice obligations. OpenLDAP is available under the OpenLDAP Public License, which the project describes as non-restrictive and free. Neither license limits internal production use, but both have notice and attribution terms that your legal team should review if you distribute or embed the software. Red Hat's supported Keycloak build is a separate paid subscription, so confirm which distribution you plan to run before you budget.

What should we ask a partner for in a quote?

Ask for a written, fixed scope that lists the directories, applications, protocols and environments in play, plus the deliverables and acceptance criteria for each phase. Request the assumptions behind the effort, what is one-time work such as design, migration and hardening, and what recurs such as upgrades, patching and support. Confirm who holds the administrator credentials and documentation at handover, how backups and restore tests are covered, and what happens if the scope changes during the engagement.

How DeployOpen helps teams choose, implement or migrate

DeployOpen plans, implements and supports self-hosted open-source platforms inside your own infrastructure, so a Keycloak and OpenLDAP decision can be tested against your real directory, applications and network before anything is built. We start from the written scope, then build, document and hand over the result so your team can run it.

How we scope

  • Map which applications need OIDC or SAML and which only speak LDAP or Kerberos.
  • Inventory existing directory data, schemas, groups and the users who must authenticate.
  • Agree in writing whether Keycloak federates OpenLDAP, replaces it or sits beside it.
  • Engagements are fixed-scope, with deliverables and timelines agreed before work starts.

How we build

  • Deploy Keycloak and any directory in your cloud accounts, data centers or air-gapped networks.
  • Configure the production database, TLS, LDAP federation mappings and client registrations.
  • Test login, group mapping, password and MFA flows against each application in scope.
  • Harden the configuration and document the setup, including high availability choices made.

How we hand over

  • Deliver runbooks for backups, upgrades, certificate rotation and directory replication.
  • Document every realm, client, federation setting and directory schema change made.
  • Walk your operations team through the running system and the recovery procedures.
  • Provide evidence and configuration records that your compliance assessors can review.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers.
  • Plan Keycloak upgrade windows and review release notes against your federation setup.
  • Re-test directory integrations after changes to OpenLDAP, Keycloak or connected applications.
  • Ask any support provider to confirm response terms in writing before you sign.

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.