Self Hosted Identity Provider Options: 7 Compared by Situation
Picking a self hosted identity provider usually starts the same way: someone wires a login into one app, and a year later ten services depend on it. For most teams, Keycloak fits large user bases and many protocols, authentik fits custom login journeys on a lighter footprint, and Authelia fits gating internal tools behind a reverse proxy. The license is the cheap part, so choose based on who will patch, upgrade and restore it.
Key takeaways- Keycloak is the safest default for customer-facing login at scale and enterprise protocols, at the cost of real JVM and clustering skill.- authentik suits small platform teams that want custom flows; Authelia suits homelabs and internal tools that need an authentication gate, not a platform.- Zitadel, Ory and Dex solve narrower problems: B2B multi-tenancy, headless login UI, and Kubernetes cluster login respectively.- FreeIPA is a directory for Linux fleets, not a customer login system.- Self hosting moves patching, upgrades, backups and uptime onto you. Test export, token lifetimes and a failed-upgrade rollback before you commit.
The short answer: which self hosted identity provider to pick
Three defaults cover most cases. Keycloak for broad protocol support and large user bases. authentik for flexible flows with a lighter footprint. Authelia for homelab and reverse-proxy gating.
Five axes decide between them:
- Protocols: OIDC only, or SAML, LDAP and SCIM as well.
- User count: thousands of staff or hundreds of thousands of customers.
- Operations budget: how many engineer-hours per month you can give it.
- Customization: stock login screens or fully custom journeys.
- Who patches it: a named person, with a same-day process, or "whoever notices".
The last axis is the one people skip. Self hosting moves patching, upgrades, backups and uptime onto you. That is the real price, not the license.
The patching cost is not hypothetical. A LinkedIn post summarizing Verizon's 2026 DBIR reports that vulnerability exploitation overtook credential abuse as the top initial access vector, that only 26% of known exploited vulnerabilities were fully remediated, and that median remediation time rose to 43 days. That is a secondhand summary, so treat it as a clue, not proof. It still points the right way: an identity server is exposed infrastructure, and a 43-day patch habit does not suit it.
How I compare self hosted identity providers

I score six things: OIDC and SAML support, LDAP and federation, admin UX, Kubernetes deployment story, upgrade pain, and community health. I weigh operability over feature lists because a login outage stops every product behind it. A missing checkbox is an annoyance. A broken upgrade at the identity layer is an incident for every team.
My view comes from my background running platform, security and identity on a classifieds platform with 400K+ users, run on Kubernetes with Keycloak and zero-downtime releases. It shapes my bias toward reviewable config and rehearsed upgrades. It also means I know Keycloak best, and you should discount accordingly.
What to test in a trial
A demo shows the happy path. Three tests show the cost of ownership:
- Realm or tenant export: export the config, delete it, and rebuild a clean instance from the export. If users, clients or secrets do not come back cleanly, you have found a disaster-recovery gap early.
- Token lifetime control: check that you can set access token, refresh token and session lifetimes per client. Example values: a 5-minute access token and a 30-minute idle session for an admin app, longer for a low-risk internal wiki. Shorter lifetimes limit the damage of a stolen token but increase refresh traffic.
- Failed upgrade rollback: upgrade a staging copy, break it on purpose, and restore from backup. Time it. That number is your real recovery time.
Federation deserves one more sentence. NHI Mgmt Group's guide to NIST SP 800-63C-4 opens with the point that federation concentrates trust. I read that as an architectural warning: the more apps trust your provider, the more its compromise or outage costs you.
Practical rule: Judge a provider by how it fails and recovers, not by how it demos.
Keycloak: the heavyweight with the widest protocol coverage
Keycloak is a Java-based identity platform covering OIDC, OAuth2, SAML, user federation and fine-grained admin roles. One comparison post describes it as backed by the Linux Foundation and Red Hat, with LDAP support, social logins and passkeys. That is a short blog's summary, so check the current docs for exact feature status in your version. I would shortlist it for teams with 100K+ users or enterprise integrations that demand SAML.
Strength: config as code
The mature realm model is the main reason I run it. A realm can be managed as code with Terraform, so changes become pull requests instead of console clicks. I manage identity as code this way with Keycloak and Terraform. Reviewable, repeatable config across dev, staging and production is worth more than any single feature.
The trade-off: Terraform covers the realm, but not everything around it. Database state, user data and signing keys still need their own backup and restore plan.
Limitation: it needs operational skill
Three costs are real:
- JVM memory footprint: it needs more resources than the Go-based options, and sizing needs measurement under your own load, not a guess.
- Clustering with Infinispan: multi-node setups need care with caches, sessions and networking.
- Themes and major upgrades: custom themes can break across versions. Rehearse every major upgrade on a copy of production data first.
Keycloak is also the wrong choice if all you need is a login wall in front of five internal tools. You would carry the operational weight without using the protocol range.
authentik and Authelia: flexible flows versus lightweight gatekeeping
authentik
authentik is Python-based, with a visual flow and policy editor and a built-in proxy outpost. The project's own site claims over 1 million installations and support for Kubernetes, Terraform and Docker Compose, plus configurable templates and APIs for customizing authentication steps. Those are vendor claims. Installation counts say nothing about the quality or age of any single deployment.
It fits small platform teams that want custom login journeys: conditional enrollment, extra verification steps, different flows per application. The limit is ecosystem size. Expect fewer enterprise references and fewer third-party guides than Keycloak, so you will read more of the docs yourself.
One caution on that same vendor page: it includes a feature comparison against Keycloak and Authelia. A vendor-authored matrix is a starting list of questions, not a verdict. Verify every row you care about yourself.
Authelia
Authelia is a single Go binary built around forward-auth for reverse proxies, with 2FA and passkeys. A comparison post notes it is often paired with Nginx, Traefik or Caddy and runs on minimal hardware. That matches how I would use it: homelabs, small teams, internal tools.
The limit is scope. It is not a full OIDC provider for complex multi-tenant apps. If you find yourself needing per-customer tenants, rich admin delegation or SAML, you are outgrowing it.
Pick by asking one question
Do you need an identity platform or an authentication gate? A gate puts a login and second factor in front of apps that have none. A platform issues identities and tokens that your own applications consume.
Practical rule: If apps need to consume tokens, pick a platform; if apps just need to sit behind a login, pick a gate.
Zitadel, Ory and Dex: API-first and Kubernetes-native choices
None of the three has a source in this article's reference set, so I describe design intent and leave versions, licensing and limits to their official documentation.
Zitadel
Zitadel is written in Go, event-sourced, and multi-tenant by design, which makes it a strong candidate for B2B SaaS where each customer is an organization with its own users and settings. The limits are a younger ecosystem and licensing terms. Read the license against your plans before committing, because terms and editions change and I will not state them here.
Ory (Kratos, Hydra, Keto)
Ory is a set of composable, headless components: identity management, OAuth2/OIDC, and permissions. It suits teams building their own login UI who want identity as an API. The cost is that you assemble and own the integration. Expect a longer time to first login than with a packaged server, and more code to maintain.
Dex
Dex is a federation connector, not a user store. It sits in front of an existing directory or upstream provider and gives Kubernetes and CI systems an OIDC login. It fits cluster login where users already exist elsewhere. Do not try to grow it into a customer identity system.
FreeIPA and when a directory beats an identity provider
FreeIPA is a Linux-centric directory bundling Kerberos, LDAP and a certificate authority. It fits server fleets and internal staff. It does not fit customer-facing login.
Its strength is host-based access control and SSH key management, which web-first providers do not match. If your main question is "who can SSH to which servers, under what rules", a directory answers it directly.
The limits are a weak fit for modern OIDC apps without a bridge and a dated admin experience. A common pattern is FreeIPA as the staff directory, with a web-first provider federating to it.
Practical rule: Use a directory for machines and staff, an identity provider for applications and customers, and bridge them only when you must.
The seven side by side
Option | Best fit | Main cost | Where it misleads |
|---|---|---|---|
Keycloak | Large user bases, SAML and OIDC | JVM sizing, clustering, upgrade rehearsal | "Mature" can hide the operations skill it needs |
authentik | Custom flows, small platform teams | Smaller ecosystem | Install counts are vendor claims, not references |
Authelia | Homelab, reverse-proxy gating | Not a full multi-tenant OIDC provider | Easy setup tempts you to outgrow it silently |
Zitadel | B2B multi-tenant SaaS | Younger ecosystem, license terms | Multi-tenant by design does not mean free of licensing limits |
Ory | Headless, custom login UI | You build and own the integration | Composable means slower first login |
Dex | Kubernetes and CI login | No user store | It is a connector, not an identity provider |
FreeIPA | Linux fleets, staff | Weak OIDC story, dated UI | Directory strength does not translate to customer login |
Choose by situation, then run this routine
Here is how I would map situation to choice:
- Customer-facing at scale: Keycloak, because of protocol breadth and a large user base track record.
- Internal tools: Authelia for a simple gate, or authentik if you need custom flows or an app proxy.
- B2B multi-tenant: Zitadel first, Keycloak with a realm-per-tenant design second. Check realm counts against your tenant plans in a trial.
- Cluster access: Dex in front of your existing directory.
- Server fleets: FreeIPA.
- Custom login UI: Ory, if you have the engineering time to assemble it.
If you want Keycloak's protocol coverage without running it, a managed Keycloak is an option. I list one among my side projects including a managed Keycloak offering, currently marked coming soon. Weigh any managed option on export rights and exit cost, the same way you would test a self hosted one.
If you are building a SaaS and want auth and other plumbing already wired, MakeV1: Ship your SaaS with the hard parts already done. is a starter worth a look. It does not replace the decision above, but it shortens the path to a first working product.
Whatever you pick, run the same routine. For more notes like this, see more platform engineering notes.
- Write down protocols, user count and tenancy needs. One page. If SAML or multi-tenancy is a maybe, treat it as a yes.
- Shortlist two providers and deploy both in staging. Two forces a real comparison; one is a rubber stamp.
- Export config and rebuild it from code. Use Terraform or the provider's API where supported, and prove a clean rebuild works.
- Rehearse an upgrade and a restore. Break the upgrade on purpose, restore, and record the time.
- Set a same-day patch process and scan images in CI. I run same-day CVE response across Kubernetes clusters and scan every image with Trivy in CI. An identity server deserves the fastest lane you have.
- Review the choice every year. User count, tenancy and team size change, and so does each project's health.