Every new homelab service adds another login, another password, and another account to rotate when someone leaves. Authentik solves this with self-hosted single sign-on: one identity provider that handles authentication for your apps, so users sign in once and administrators manage access in one place.
This guide covers a practical Docker deployment, forward authentication through a reverse proxy, and the operational habits that keep SSO reliable. Pair it with our homelab security rules and Docker supply-chain guide.
Why centralize logins
Without SSO, each service keeps its own user database. Passwords drift out of sync, forgotten accounts linger, and disabling access means visiting every app. With Authentik, you manage users and groups centrally and connect services through standard protocols such as OIDC, OAuth2, SAML, LDAP, or proxy-based forward auth.
Typical homelab wins include:
- One login for dashboards, wikis, and media tools
- Group-based access: admins, family, guests
- Faster offboarding when access needs to end
- Consistent password and MFA policy
- Audit visibility into who can reach what
SSO is infrastructure, not magic. It adds a critical dependency, so plan for availability and recovery from the start.
Requirements
Use a Linux host with Docker Compose, persistent storage, a domain name, and HTTPS. Authentik needs PostgreSQL and Redis alongside the server and worker containers. Keep the database on a private network and expose only what the reverse proxy requires.
Create a dedicated directory and keep generated secrets outside version control.
Docker Compose deployment
Follow the current Authentik release documentation for exact image tags and configuration keys. Pin reviewed versions for production rather than tracking floating tags.
services:
db:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_DB: authentik
POSTGRES_USER: authentik
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- internal
redis:
image: redis:7-alpine
restart: unless-stopped
command: --save 30 1 --loglevel warning
volumes:
- redis_data:/data
networks:
- internal
server:
image: ghcr.io/goauthentik/server:latest
restart: unless-stopped
command: server
depends_on:
- db
- redis
environment:
AUTHENTIK_POSTGRESQL__HOST: db
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__USER: authentik
AUTHENTIK_POSTGRESQL__PASSWORD: ${POSTGRES_PASSWORD}
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY}
ports:
- "127.0.0.1:9000:9000"
volumes:
- authentik_media:/media
networks:
- internal
worker:
image: ghcr.io/goauthentik/server:latest
restart: unless-stopped
command: worker
depends_on:
- db
- redis
environment:
AUTHENTIK_POSTGRESQL__HOST: db
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__USER: authentik
AUTHENTIK_POSTGRESQL__PASSWORD: ${POSTGRES_PASSWORD}
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY}
volumes:
- authentik_media:/media
networks:
- internal
volumes:
postgres_data:
redis_data:
authentik_media:
networks:
internal:
Start the stack, then inspect logs before creating users:
docker compose up -d
docker compose ps
docker compose logs --tail=100 server
Resolve immutable digests after testing and record them. Store POSTGRES_PASSWORD and AUTHENTIK_SECRET_KEY in a protected .env file with restricted permissions.
Put it behind HTTPS
Do not expose Authentik’s internal port directly. Serve it through Caddy or your existing reverse proxy:
auth.example.com {
reverse_proxy 127.0.0.1:9000
}
Use a stable hostname because applications will redirect to it during login. Changing the identity URL later means reconfiguring every connected app. Keep the admin interface reachable only through trusted networks or an access-controlled path.
First-run setup
Open the admin interface and create the initial administrator account with a unique password. Configure SMTP so password resets and invitations work. Set the correct base URL before connecting applications.
Create groups first, then users:
admins: infrastructure accessfamily: everyday apps and mediaguests: limited dashboards or shared tools
Assign applications to groups rather than individual users wherever possible. Group membership becomes the access control list, making future changes predictable.
Connect applications
There are two common patterns.
OIDC and OAuth2
Modern apps support OpenID Connect. Create a provider and application inside Authentik, copy the client ID, secret, issuer URL, and redirect URI into the downstream app, and test login with a non-admin user. This is the cleanest option when available.
Forward auth
For apps without native SSO, use forward authentication at the reverse proxy. The proxy asks Authentik whether the request is allowed before passing it to the application. This protects dashboards, internal tools, and legacy apps without changing their code.
Document which method each service uses. Mixed setups are normal, but every exception should be intentional.
Enable MFA
SSO centralizes authentication, which makes it a high-value target. Require multi-factor authentication for administrator accounts at minimum, and preferably for all remote users.
Use authenticator apps or hardware keys where supported. Store recovery codes offline and test the enrollment process before requiring it for everyone. A lockout from your own identity provider is painful without a tested recovery path.
Backups and recovery
Back up PostgreSQL, Authentik media, configuration values, and the secret key material. Without the secret key and database, rebuilding the same identity provider and re-linking applications is difficult.
A PostgreSQL dump is a starting point:
docker compose exec -T db pg_dump -U authentik authentik \
| gzip > "backups/authentik-$(date +%F).sql.gz"
Keep multiple backup generations off the host, encrypt them, and test restoration in an isolated directory. Document the recovery order: database, Redis, server, worker, reverse-proxy routes, then application checks.
Upgrades
Read the release notes before upgrading. Back up first, update the image version deliberately, and verify admin login, OIDC logins, forward-auth routes, email delivery, and background tasks.
Keep the previous known-good image reference available for rollback. Avoid upgrading SSO immediately before travel or major changes elsewhere. If logins fail, services behind forward auth can all fail together, so maintenance timing matters.
Common mistakes
- Changing the public hostname after apps are connected
- Giving every user administrator rights
- Skipping SMTP and discovering broken password resets later
- Exposing the admin interface to the internet without extra protection
- No tested backup of the database and secret key
- Connecting apps with full admin tokens instead of scoped credentials
FAQ
Should every homelab run Authentik? Not necessarily. Two or three services may not justify an identity provider. Once logins multiply or multiple people need access, SSO pays off.
Is forward auth as good as OIDC? It protects access well, but OIDC gives richer identity information to the app. Use native OIDC when supported and forward auth for everything else.
Can Authentik replace a VPN? No. SSO controls application logins; a VPN controls network reachability. Many setups use both, especially for administration.
What happens if Authentik goes down? Apps depending on it may refuse logins. That is why backups, monitoring, stable hosting, and a documented recovery procedure matter.
Is self-hosted SSO more secure than separate logins? It can be, because policy and MFA are consistent. But centralization also concentrates risk, so secure, back up, and monitor the identity provider carefully.
Authentik turns scattered logins into one managed system. Start with a few applications, use groups deliberately, protect admin access, automate backups, and expand only after recovery is tested.