Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Security

Self-hosted SSO: Keycloak, authentik, ZITADEL or Authelia

Keycloak, authentik, ZITADEL and Authelia compared for self-hosted single sign-on: protocols, licenses, databases, operations, and which one fits your stack.

CloudSat teamNovember 18, 20266 min read
Abstract illustration of one glowing key ring connected by thin lines to many small application windows
On this pageThe short version

Once a team runs more than a handful of self-hosted tools, separate logins become a security problem: a password per app, no central way to switch someone off, and multi-factor authentication only where each app happens to support it. A self-hosted identity provider fixes that with one login, one place for MFA and one switch for offboarding. Four open-source projects cover most needs in 2026, and they differ more in philosophy than in feature checklists.

This comparison is about workforce SSO: your own people signing in to Grafana, Nextcloud, Gitea, a wiki or an admin panel. If you need sign-up and login for the customers of your product, read the comparison of Auth0 alternatives for customer login instead.

The short version

Keycloak authentik ZITADEL Authelia
Language Java (Quarkus) Python and Go Go Go
License Apache-2.0 MIT core, enterprise features under their own license AGPL-3.0 (APIs and SDKs Apache-2.0) Apache-2.0
Protocols OIDC, OAuth 2.0, SAML 2.0 OIDC, OAuth 2.0, SAML, LDAP, RADIUS OIDC, OAuth 2.0, SAML 2.0, SCIM 2.0 OIDC, plus forward auth for reverse proxies
Database PostgreSQL, MySQL, MariaDB and others PostgreSQL only PostgreSQL 14 or later SQLite, PostgreSQL or MySQL
Admin model Web console, realms Web console, visual flows Web console, organizations and projects YAML configuration files
Best fit Many apps, SAML, Active Directory Mixed apps, including ones with no SSO support SSO plus multi-tenant B2B needs Web apps behind a reverse proxy, small footprint

What to check before choosing

  1. Protocols your apps speak. Modern apps support OpenID Connect. Older business software often supports only SAML. Some apps support neither and need forward authentication at the reverse proxy, where the proxy asks the identity provider before letting a request through.
  2. Where users live today. If you already have Active Directory or LDAP, federation matters more than any other feature.
  3. MFA methods. All four handle TOTP authenticator apps and WebAuthn security keys and passkeys. Check push-based options if your team relies on them.
  4. Operations. The identity provider becomes the front door to everything. Count the components you will patch, back up and monitor.
  5. License. AGPL obligations apply if you modify ZITADEL and offer it as a network service. The other three use permissive licenses.

Keycloak

Keycloak is the reference point. It is a CNCF project, implements OIDC, OAuth 2.0 and SAML 2.0 thoroughly, and has the deepest integration story: federation with LDAP and Active Directory, Kerberos, identity brokering to Google, GitHub or another SAML provider, and authorization services for fine-grained permissions. Realms separate tenants or environments, and a newer organizations feature covers basic B2B scenarios. Red Hat sells a supported build for companies that want a vendor behind it.

The cost is weight and surface. It runs on the JVM and needs more memory than the other three. Its admin console exposes hundreds of settings, and theming means editing templates. Teams with SAML-heavy software or an existing directory rarely regret it; a three-person homelab usually finds it more than it needs.

authentik

authentik's distinctive idea is the flow: login, enrollment, recovery and consent are chains of stages that you assemble in the web interface. It speaks OIDC and SAML, and its outposts add an LDAP server for applications that only understand LDAP, a RADIUS endpoint for network gear, and a proxy that puts SSO in front of apps with no authentication of their own.

Operations got simpler in release 2025.10, which removed the Redis dependency: caching, the embedded outpost and WebSocket handling moved to PostgreSQL, so a deployment is now the server, a worker and the database. The core is MIT-licensed, with some enterprise features under a separate license, so read the feature list for the edition you plan to run.

ZITADEL

ZITADEL was designed around multi-tenancy. Its hierarchy of instances, organizations and projects lets one deployment serve many customer organizations, each with its own policies, branding and identity providers. Every change is written as an event, which gives a complete audit trail through the API. It supports passkeys, SAML 2.0, a SCIM 2.0 server for user provisioning, and actions for custom logic and token enrichment.

Version 3 changed two things to plan around. First, the core is now AGPL-3.0 instead of Apache-2.0, though the APIs and SDKs keep the Apache-2.0 license. Second, CockroachDB support was removed, leaving PostgreSQL as the database to run. For pure workforce SSO it works well; it earns its place when the same system must also serve your customers' organizations.

Authelia

Authelia takes a different route. It sits beside your reverse proxy (nginx, Traefik, Caddy, HAProxy, Envoy or Skipper) and answers one question for every request: is this user allowed here? Access rules match domains, paths, users and groups, and second factors include TOTP, WebAuthn passkeys and Duo push. It also acts as an OpenID Connect provider, OpenID Certified for several profiles, for apps that support OIDC.

There is no SAML and no admin web interface: configuration is YAML, and users come from a file of hashed passwords or from an LDAP directory. In return it is a single small Go service that is easy to reason about. Pair it with a lightweight directory such as LLDAP when a YAML user file stops scaling.

Where each one fits

Situation Good first choice
Homelab or small team, web apps behind one reverse proxy Authelia
Mixed apps: some OIDC, some LDAP only, some with no auth at all authentik
SAML software, Active Directory, Kerberos, many separate realms Keycloak
You also need per-customer organizations and a full audit trail ZITADEL

Wiring an app usually starts with the provider's OpenID Connect discovery document. The paths differ:

Provider Discovery URL pattern
Keycloak https://sso.example.com/realms/<realm>/.well-known/openid-configuration
authentik https://sso.example.com/application/o/<app-slug>/.well-known/openid-configuration
ZITADEL https://<instance-domain>/.well-known/openid-configuration
Authelia https://auth.example.com/.well-known/openid-configuration

The parts that bite after installation

  • It is now a single point of failure. If the identity provider is down, nobody signs in anywhere. Monitor it, back up its database daily, and keep one local break-glass admin account on critical systems such as the hypervisor and the backup server.
  • URLs and clocks must be exact. The issuer URL an app expects must match what the provider publishes, behind every proxy. Tokens carry timestamps, so keep NTP running.
  • Upgrades need a rollback plan. Releases often include database migrations. Read the notes, test on a copy, and take a snapshot first. CloudSat offers Keycloak and authentik as one-click apps, and a snapshot before each upgrade gives you a quick way back.
  • Offboarding only works if every app uses SSO. Audit for local accounts that bypass the identity provider.

FAQ

Which one is lightest on a small server?

Authelia, by a wide margin: one Go process, with SQLite possible for small setups. ZITADEL and authentik sit in the middle, and Keycloak, running on the JVM, needs the most memory.

Do I still need LDAP?

Only for applications that cannot speak OIDC or SAML. authentik can expose an LDAP interface through its outpost, and LLDAP is a small directory built for exactly this role.

Should a very small team self-host SSO at all?

If you already self-host the apps, yes: central MFA and offboarding pay off quickly. If most of your tools are SaaS products, the identity provider those products already integrate with is usually the simpler choice.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.