Self-hosted SSO can turn a collection of Docker services into a manageable access layer, but only if identity, proxying, recovery, and application compatibility are planned together. This guide compares Authentik and Authelia, provides a practical identity-planning worksheet, and shows how to introduce centralized authentication without locking yourself out of your own homelab or VPS.
Overview
Centralized authentication gives users one account, consistent group membership, and a single place to apply MFA and access rules. It is particularly useful when a self-hosted server runs several web applications, such as a dashboard, file platform, monitoring system, documentation tool, and administration interface.
Authentik and Authelia can both sit alongside a reverse proxy and protect services that do not have a suitable login system of their own. They are not identical products, however. Authentik is generally a broader identity platform, with a user interface and support for identity-provider workflows such as OIDC and SAML alongside other integration methods. Authelia is commonly used as a focused authentication and authorization companion for a reverse proxy, with policy-driven access control and a configuration-oriented operating model.
Choose based on the applications you actually run. Before deploying either system, list every service, its authentication protocols, its current URL, and the consequence of an outage. Do not assume that placing an application behind an authentication gateway makes the application itself secure. Keep application-level accounts, authorization, updates, and backups under review.
| Requirement | Usually a better fit | Planning note |
|---|---|---|
| OIDC-based applications and a visual identity-management workflow | Authentik | Confirm the application’s redirect URI, scopes, and claim requirements. |
| Simple forward-auth protection for several web services | Authelia | Verify that your reverse proxy supports the required authentication-check flow. |
| Applications with LDAP support | Either, depending on the integration | Check directory schemas, bind permissions, group mapping, and TLS requirements. |
| Services with no external authentication support | Either with a compatible reverse proxy | Forward authentication protects the route, but may not provide user identity to the application. |
| Several identity providers or protocol types | Authentik is often worth evaluating first | Keep the design no more complex than your recovery and maintenance processes can support. |
What to track
1. Build an identity-planning worksheet
Record the following for each application before creating a client or policy:
- Service and owner: Name the application and the person responsible for its access rules.
- Public hostname: Record the exact HTTPS hostname and whether it is reachable from the internet, through a VPN, or only on the local network.
- Integration type: Mark OIDC, OAuth2, LDAP, forward authentication, or native application accounts.
- Groups: Define groups such as administrators, household users, or read-only operators before writing policies.
- Recovery dependency: Note whether the service depends on the identity provider to restore access.
- Data sensitivity: Identify services containing private files, credentials, business data, or administrative controls.
- Fallback owner: Document a controlled emergency route, such as console access or a local break-glass account.
This worksheet prevents a common mistake: adding SSO to the most important services first, without proving that the identity provider, reverse proxy, DNS, certificates, and backup process work as a complete system.
2. Track protocol compatibility
Use this application matrix when onboarding services:
| Application capability | Recommended integration path | What to verify |
|---|---|---|
| OpenID Connect (OIDC) | Create an OIDC provider and client | Issuer URL, client ID and secret, redirect URI, scopes, groups, and logout behavior. |
| OAuth2 through an authentication gateway | Use the gateway or OAuth2 proxy pattern | Callback URL, trusted headers, cookie domain, and whether the proxy forwards identity headers safely. |
| LDAP | Connect the application to the directory | Base DN, bind account, user and group filters, certificate validation, and password policy. |
| No external authentication | Protect the route with forward authentication | Proxy order, unauthorized redirects, WebSocket behavior, and whether direct backend access is blocked. |
For Docker deployments, place the identity service on a private network with its database and cache where appropriate. Expose only the reverse proxy to the public network. Use a secrets mechanism or protected environment files rather than committing client secrets, signing keys, or bootstrap passwords to a Compose file. Review the production-ready Docker Compose checklist before exposing another service.
Cadence and checkpoints
Initial deployment workflow
- Secure the base: Use HTTPS, restrict administrative ports, update the host, and apply a server hardening checklist before publishing the identity provider.
- Deploy the identity service: Configure persistent storage, its database dependencies, time synchronization, and an administrator account.
- Enable MFA: Start with administrator accounts and test the second factor on more than one device or recovery method where practical.
- Connect the reverse proxy: Add one low-risk application first. Confirm DNS, certificates, proxy headers, WebSockets, and access logs.
- Create groups and policies: Prefer group-based rules over individual exceptions. For example, allow the monitoring group to view dashboards while reserving configuration access for administrators.
- Onboard an OIDC application: Use a test client, restrict redirect URIs to exact HTTPS addresses, and grant only the scopes the application needs.
- Test failure paths: Try an unauthorized user, an expired session, a disabled account, a lost second factor, and an unavailable identity container.
For routine operations, perform a short monthly review: check failed sign-ins, unexpected new users, inactive clients, certificate status, container health, and available updates. Each quarter, test an account-recovery procedure and restore the identity provider or its database from backup in an isolated environment. A backup that has never been restored is only an assumption; use the self-hosted app backup strategy as a checklist.
When you update Authentik, Authelia, the reverse proxy, or an application, read the relevant release notes and stage the change if the service protects production access. Keep a record of the previous image reference and configuration so rollback is deliberate rather than improvised.
How to interpret changes
A rising count of failed logins does not automatically mean an account is compromised. It may indicate a stale password in a mobile client, a misconfigured OIDC redirect, clock drift, or ordinary internet scanning. Look for patterns: one account from many locations, repeated attempts against administrative users, new clients that nobody requested, or policy changes outside your maintenance window.
If users can authenticate but are denied by an application, inspect group claims, email or username mapping, and the policy order before rotating every credential. If users are redirected repeatedly, check the external URL, cookie domain, proxy scheme headers, and callback address. If only one application fails, compare its integration settings with a known-good client.
Track availability separately from authentication success. A healthy login page does not prove that the database is writable, backups are restorable, or protected applications can reach their backends. Monitor the identity container, database, reverse proxy, certificate renewal, and storage volume as separate components.
When to revisit
Revisit this design monthly or quarterly, and immediately after a major version change or a new application rollout. The review should answer five practical questions:
- Are all active users and groups still necessary?
- Do clients and redirect URIs match the current hostnames?
- Are MFA, recovery codes, and break-glass access tested and documented?
- Can you restore the identity provider, its database, and its secrets?
- Does every protected application still block direct backend access?
Update the article’s working notes whenever protocol support, default security behavior, or integration steps change in a new release. Also revisit the plan when you add a self-hosted password manager, file-sharing service, monitoring dashboard, or administrative tool; these applications often require different risk tolerances and group policies.
Start with one non-critical service, document the complete path from DNS to application authorization, and only then expand SSO across the rest of your self-hosted stack. Centralized access is valuable when it reduces duplicated account management without creating a single undocumented point of failure.