SSO
Authentik Overview - Architecture, Features, and Comparison with Keycloak
Also available in: RU
Part 3 of 3 in the series IAM-решения
- Authentik vs Authelia vs Keycloak vs Zitadel - SSO Compared
- TOTP vs WebAuthn vs Passwordless - What's the Difference and Which One to Choose
- Authentik Overview - Architecture, Features, and Comparison with Keycloak
Contents
Why you need Authentik at all (and what IAM / IdP means in a homelab / production)
Why solutions like Authentik / IAM / IdP are needed
In basic setups, each service (application, web interface, API) often implements its own form of login - its own users, password storage, session mechanism, and so on. This creates:
- Duplicated authentication/authorization logic
- Different passwords across different systems
- A larger security-error surface
- Difficulties with centralized user management, MFA, and auditing
- Problems with a unified session (SSO) across systems
Solutions like IAM / IdP (Identity Provider) allow you to centralize authentication and authorization: services "delegate" the login process to the IdP solution, and the IdP issues a token/session/assertions that the services trust.
Benefits in a production environment
- Centralized security policy (MFA, IP restrictions, time-limited access)
- Unified auditing and logging
- Integration with LDAP, AD, and third-party OAuth providers
- Scalability: adding new services without duplicating authentication
In a homelab / self-hosted environment
- Control over your own data and passwords
- The ability to experiment with policies and customization
- Single sign-on for multiple home services (Nextcloud, Home Assistant, etc.)
- Levelling up your infrastructure to a production-grade level
Bottom line: Authentik is one of the solutions that combines convenience, flexibility, and an open-source approach, making it suitable for both home labs and production.
What Authentik is - a brief overview
Authentik is an open-source / open-core Identity Provider (IdP) and Single Sign-On (SSO) system, built with an emphasis on flexibility and extensibility.
Key capabilities
- Support for standards: OAuth2 / OIDC, SAML2, LDAP, SCIM, RADIUS
- A Flows / Stages mechanism for building authentication scenarios
- A convenient UI for admins and users
- Self-service (registration, password recovery, MFA)
- Conditional access policies
- API, Terraform, Blueprints - configuration as code
- Scaling from Docker to Kubernetes / Helm
- Support for external identity providers
An IdP is a critically important security element. Authentik needs to be regularly updated and monitored. In 2024, vulnerabilities related to certificate management were reported, but they were promptly fixed.
Core concepts
| Concept | Description |
|---|---|
| Flows / Stages | The logic of the authentication sequence (password, MFA, IP check, etc.). |
| Applications / Providers | Configuration of applications and login providers (OIDC, SAML, etc.). |
| Policy / Conditions | Access control based on attributes (group, IP, time of day). |
| SCIM / LDAP / Federation | Syncing users from external systems. |
| Self-Service / Enrollment | Interface for users (password change, MFA, etc.). |
| Consent / Attribute Mapping | Managing the attributes passed to applications. |
| API / Automation | Full automation of configuration via API, Terraform, Blueprints. |
Advantages and limitations
Advantages
- High flexibility and customizability (flows, policies).
- Support for a wide range of protocols (OIDC, SAML, LDAP, RADIUS).
- Suits small/medium environments and Kubernetes clusters.
- Simpler interface compared to Keycloak.
- API and Terraform for automation.
- Open source - control over your data and code.
Limitations
- A smaller community than Keycloak's.
- May require optimization under heavy load.
- Requires regular updates and auditing.
- Some features are available only in the enterprise version.
- Configuring flows requires experience.
Comparing Authentik with competitors
| Characteristic | Authentik | Keycloak | Authelia | Auth0 / Okta (SaaS) |
|---|---|---|---|---|
| Solution type | Self-host / open core | Self-host / enterprise | Self-host / gateway | SaaS / managed |
| Supported protocols | OAuth2 / OIDC, SAML2, LDAP, SCIM, RADIUS | OAuth2 / OIDC, SAML2, Kerberos, LDAP / AD | SSO / 2FA, limited protocols | OAuth2 / OIDC, SAML, social login |
| Customization | Very flexible (flows, policies) | High (plugins) | Simple | Minimal |
| Integrations | LDAP, SCIM, external OAuth | LDAP / AD, federation | LDAP | Many ready-made ones |
| Installation | Docker, Helm, UI | Java stack (heavy) | Lightweight | No installation |
| Scalability | Medium loads, clustering | Enterprise | Small scenarios | Unlimited |
| Community | Young, fast-growing | Mature | Niche | Huge |
| Security | Requires updates | Mature | Simplified | High (SLA) |
| Cost | Free / enterprise support | Free / Red Hat support | Free | Subscription |
| Best use case | Homelab, SMB, customization | Enterprise | Simple SSO / 2FA | No admin overhead |
Authentik is often called the "golden middle ground" between heavy IAM solutions and simple proxy systems like Authelia.
A more detailed comparison of Authentik, Authelia, Keycloak, and ZITADEL against each other (by features, installation complexity, resource usage) is in a separate comparison article.
Installation and architectural recommendations
Installation approaches
- Docker Compose - ideal for a homelab and testing
- Kubernetes / Helm - for production
- Cloud AMI / Marketplace - ready-made images (AWS, etc.)
Architecture and tips
- Separate the services: PostgreSQL, Redis, Authentik web/worker.
- Use external DB and Redis.
- Set up backups.
- Ensure TLS/HTTPS for the interfaces.
- Set up monitoring and updates.
- Use clustering and replication if needed.
Minimal installation example (Docker Compose) version 2025.10.1
Update note. At the time of publication, the current version was 2025.10.1, but Authentik releases often - as of August 2026, the current branch is 2026.5.x. Don't blindly copy the version tag: before installing, check the releases page on GitHub and substitute the current AUTHENTIK_TAG. The overall structure of the docker-compose file hasn't fundamentally changed since then.
---services: postgresql: image: docker.io/library/postgres:16-alpine container_name: authentik_postgres restart: unless-stopped healthcheck: interval: 30s retries: 5 start_period: 20s test: - CMD-SHELL - pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER} timeout: 5s volumes: - database:/var/lib/postgresql/data environment: POSTGRES_PASSWORD: ${PG_PASS:?database password required} POSTGRES_USER: ${PG_USER:-authentik} POSTGRES_DB: ${PG_DB:-authentik} env_file: - .env networks: authentik:# server: command: server depends_on: postgresql: condition: service_healthy env_file: - .env image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.1} container_name: authentik_server restart: unless-stopped environment: AUTHENTIK_REDIS__HOST: redis AUTHENTIK_POSTGRESQL__HOST: postgresql AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik} AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik} AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} TZ: Europe/Moscow volumes: - ./media:/media - ./custom-templates:/templates networks: authentik: proxy: labels: - "traefik.enable=true" - "traefik.http.routers.authentik.entrypoints=web" - "traefik.http.routers.authentik.rule=Host(`authentik.domain.ru`)" - "traefik.http.middlewares.authentik-https-redirect.redirectscheme.scheme=https" - "traefik.http.routers.authentik.middlewares=authentik-https-redirect" - "traefik.http.routers.authentik-secure.entrypoints=websecure" ## Individual Application forwardAuth regex (catch any subdomain using individual application forwardAuth) - "traefik.http.routers.authentik-secure.rule=Host(`authentik.domain.ru`) || HostRegexp(`{subdomain:[a-z0-9]+}.domain.ru`) && PathPrefix(`/outpost.goauthentik.io/`)" - "traefik.http.routers.authentik-secure.tls=true" - "traefik.http.routers.authentik-secure.service=authentik" - "traefik.http.services.authentik.loadbalancer.server.port=9000" - "traefik.docker.network=proxy"# worker: image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.1} restart: unless-stopped command: worker container_name: authentik_worker environment: AUTHENTIK_REDIS__HOST: redis AUTHENTIK_POSTGRESQL__HOST: postgresql AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik} AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik} AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} TZ: Europe/Moscow # `user: root` and the docker socket volume are optional. # See more for the docker socket integration here: # https://goauthentik.io/docs/outposts/integrations/docker # Removing `user: root` also prevents the worker from fixing the permissions # on the mounted folders, so when removing this make sure the folders have the correct UID/GID # (1000:1000 by default) #user: root volumes: - /var/run/docker.sock:/var/run/docker.sock - ./media:/media - ./certs:/certs - ./custom-templates:/templates env_file: - .env depends_on: postgresql: condition: service_healthy networks: proxy: authentik:#volumes: database: driver: local#networks: proxy: external: true authentik: external: truePG_PASS=passAUTHENTIK_SECRET_KEY=secret# SMTP Host Emails are sent toAUTHENTIK_ERROR_REPORTING__ENABLED=trueAUTHENTIK_EMAIL__HOST=smtp.gmail.comAUTHENTIK_EMAIL__PORT=465# Optionally authenticate (don't add quotation marks to your password)AUTHENTIK_EMAIL__USERNAME=mail@gmail.comAUTHENTIK_EMAIL__PASSWORD=password# Use StartTLSAUTHENTIK_EMAIL__USE_TLS=false# Use SSLAUTHENTIK_EMAIL__USE_SSL=trueAUTHENTIK_EMAIL__TIMEOUT=10# Email address authentik will send from, should have a correct @domainAUTHENTIK_EMAIL__FROM=mail@gmail.comAUTHENTIK_ERROR_REPORTING__ENABLED=true


