Self-Hosted SSO: Run Your Own Identity Provider
A self-hosted SSO is an identity provider, such as Keycloak or Authentik, that you run on your own server to give your team one login, with multi-factor authentication, across all your applications. You keep your user directory and login data, and you stop paying per user. With Elestio, deploy one in a few clicks, fully managed, on the cloud provider and region of your choice.
Last updated:
Why self-host
Why self-host your identity provider?
No per-user pricing
Okta and Auth0 charge per user or per monthly active user. A self-hosted identity provider runs at a fixed price per instance: on Elestio, these tools start from $11/month.
Your identities stay yours
User directory, credentials and login logs live on your own instance, with the cloud provider and region you choose.
Standard protocols
OpenID Connect, SAML and LDAP connect your identity provider to the tools you already use, such as GitLab, Grafana, Nextcloud or Mattermost.
One login, MFA everywhere
Centralize sign-in, enforce multi-factor authentication and revoke all access in one place when someone leaves.
Compliance made easier
Choose where identity data is hosted, including EU-owned providers such as Hetzner, Netcup, Scaleway and OVHcloud. Elestio is SOC 2 and ISO 27001 certified.
Patched without delay
Identity software needs prompt security updates. Elestio applies updates, runs automated backups and monitors the service, so patches never wait for a free afternoon.
The tools
5 open source SSO and identity tools you can self-host
All five are released under an OSI-approved open source license. Authelia is an SSO and MFA portal rather than a full identity provider.
Keycloak
The enterprise standard
Complete identity and access management: OpenID Connect, SAML 2.0, LDAP and Active Directory federation, social login, roles and realms. The most complete of the five, and the heaviest to run and configure.
Best for: enterprises that need OIDC, SAML and LDAP or Active Directory federation in one place.
Deploy Keycloak →Authentik
Modern identity provider with custom flows
OIDC, SAML, LDAP and RADIUS providers, plus a built-in proxy to protect apps that have no login of their own. Login and enrollment flows are designed visually in a clean admin interface.
Best for: teams that want a modern admin UI and flexible login flows, including for apps without native SSO.
Deploy Authentik →Authelia
Lightweight SSO and MFA portal
Sits in front of your reverse proxy (Traefik, NGINX, Caddy...) to add single sign-on and two-factor authentication to web apps, and acts as an OpenID Connect provider. Not a full identity provider: no SAML, and no admin interface, it is configured through files.
Best for: protecting self-hosted web apps behind a reverse proxy, with minimal resources.
Deploy Authelia →Zitadel
Multi-tenant identity for B2B SaaS
API-first identity platform built for multi-tenancy: each customer organization gets its own users, roles, branding and login policies. OIDC, SAML, passkeys, and LDAP as an identity source.
Best for: SaaS products that need to give each customer its own identity space.
Deploy Zitadel →Logto
Developer-first auth for apps and SaaS
Ready-made sign-in experience, SDKs for most frameworks, organizations for B2B multi-tenancy and role-based access control. Works as an OIDC provider and can also act as a SAML identity provider for applications.
Best for: developers replacing Auth0 or Clerk in their own application.
Deploy Logto →Comparison
Comparison table
| Tool | OIDC | SAML | LDAP / AD | MFA | Multi-tenant | Admin UI | License | From |
|---|---|---|---|---|---|---|---|---|
| Keycloak | ✓ Yes | ✓ Yes | ✓ Yes | ✓ Yes | ✓ Yes (realms) | ✓ Yes | Apache 2.0 | $11/mo $16/mo for 4 GB (production) |
| Authentik | ✓ Yes | ✓ Yes | ✓ Yes | ✓ Yes | ~ Brands per domain | ✓ Yes | MIT + enterprise | $16/mo |
| Authelia | ✓ Yes (provider) | ✗ No | ✓ Yes (user backend) | ✓ Yes | ✗ No | ✗ No (config files) | Apache 2.0 | $11/mo |
| Zitadel | ✓ Yes | ✓ Yes | ✓ Yes (identity source) | ✓ Yes | ✓ Yes (core) | ✓ Yes | AGPL 3.0 | $11/mo |
| Logto | ✓ Yes | ✓ Yes (as IdP) | ~ Entra ID connector, no native LDAP | ✓ Yes | ✓ Yes (organizations) | ✓ Yes | MPL 2.0 | $11/mo |
How to pick
Which one should you choose?
You need SAML, LDAP and Active Directory federation
You want a modern admin UI and custom login flows
You only need SSO and 2FA in front of your self-hosted apps
You run a B2B SaaS and each customer needs its own tenant
You are adding sign-in to your own application
Limits
What to expect
Your identity provider becomes a critical service: if it goes down, nobody can log in to the applications behind it. Keep backups, test a restore, and for production plan a second instance or a documented emergency admin access. Elestio handles the infrastructure, security updates, backups and monitoring. The configuration of your realms, applications and login policies remains yours.
Setup takes real time. Keycloak in particular has a learning curve: realms, clients, mappers and federation need to be understood before going live. Authelia is the quickest to start, but it stays limited to what it was built for.
Size the server for the tool. An undersized server is the first cause of disappointment. Keycloak runs on Java: its official sizing guide puts base memory at about 1,250 MB of RAM per instance with 10,000 cached sessions, before the operating system and the database. Choose a plan with at least 4 GB of RAM for Keycloak in production: on Elestio, 4 GB plans start from $16/month. Authelia, written in Go, runs comfortably on the smallest plans.
Get started
Deploy your self-hosted SSO in 3 steps
Pick your tool
Keycloak, Authentik, Authelia, Zitadel or Logto, or any of the 400+ open source software in our catalog.
Choose provider and region
10 cloud providers, including AWS, Azure, Hetzner, DigitalOcean and OVHcloud, or bring your own VM.
Deploy
Ready in minutes. Installation, SSL, backups, updates, security and monitoring handled, with a 99.9% SLA.
Reviews
Trusted by 10,000+ Developers Worldwide
Real reviews from real users on Trustpilot.
"Super easy setup; great customer support! Very happy with the services."
FAQ
Frequently Asked Questions
-
What is the best open source alternative to Okta or Auth0?
It depends on what you replace. For workforce SSO across internal tools (the Okta use case), Keycloak and Authentik are the most complete, with OIDC, SAML and LDAP. To add sign-in to your own application (the Auth0 use case), Logto and Zitadel are closer, with SDKs, hosted login pages and multi-tenant organizations. All five are open source and run at a fixed price per instance instead of per user.
-
Keycloak vs Authentik: which one should I choose?
Keycloak is the long-standing enterprise standard, with the widest protocol and federation support, but it is heavier and takes longer to configure. Authentik is lighter to run, has a more modern admin interface and visual login flows, and includes a proxy for apps without native SSO. Choose Keycloak for complex enterprise federation, Authentik for a faster setup with a modern UI.
-
Does Authelia support SAML?
No. Authelia is an OpenID Connect provider and a forward authentication portal for reverse proxies. SAML 2.0 is on its roadmap but not available. If your applications need SAML, choose Keycloak, Authentik or Zitadel.
-
Can I connect my self-hosted SSO to Active Directory or LDAP?
Yes with Keycloak, Authentik and Zitadel, which can use LDAP or Active Directory as a source of users, and with Authelia, which uses LDAP as its user backend. Logto connects to Microsoft Entra ID through enterprise connectors but does not offer native LDAP.
-
Is a self-hosted identity provider secure?
It can be, provided it is kept up to date and well configured. On Elestio the server is updated, backed up and monitored, with SSL included, and Elestio is SOC 2 and ISO 27001 certified. Your team remains responsible for the identity configuration itself: password and MFA policies, admin accounts and the applications you connect.
Ready to run your own identity provider?
Deploy Keycloak, Authentik, Authelia, Zitadel or Logto in minutes, fully managed by Elestio.
Get started