Authelia — Single Sign-On & 2FA for Your Homelab
OpenID Connect certified SSO portal that sits in front of your reverse proxy and adds TOTP, WebAuthn, or passkey login to any self-hosted app.
What it is
Authelia is a self-hosted authentication and authorization server that adds single sign-on (SSO) and two-factor authentication (2FA) to any web application behind a reverse proxy. It supports TOTP, WebAuthn (hardware keys), passkeys, and push notifications for second factors. Authelia is OpenID Connect certified.
Authelia targets homelab users and small teams who run self-hosted applications (Grafana, Nextcloud, Gitea) and want unified login with strong authentication without paying for enterprise identity providers.
How it saves time or tokens
Authelia centralizes authentication for all your self-hosted services. Instead of configuring separate login systems for each application, users authenticate once with Authelia and get access to all authorized services. This reduces password fatigue and eliminates per-app 2FA setup.
Integration with reverse proxies (Nginx, Traefik, Caddy, HAProxy) means you add authentication to any application without modifying the application itself.
How to use
- Deploy Authelia with Docker Compose:
services:
authelia:
image: authelia/authelia:4
volumes:
- ./config:/config
ports:
- 9091:9091
environment:
TZ: UTC
- Configure Authelia in
config/configuration.yml:
server:
address: 'tcp://:9091'
authentication_backend:
file:
path: /config/users_database.yml
access_control:
default_policy: deny
rules:
- domain: '*.example.com'
policy: two_factor
session:
domain: example.com
secret: a-long-random-secret
- Configure your reverse proxy to forward authentication requests to Authelia.
Example
Nginx configuration for Authelia-protected services:
server {
server_name grafana.example.com;
location /authelia {
internal;
proxy_pass http://authelia:9091/api/verify;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
}
location / {
auth_request /authelia;
auth_request_set $user $upstream_http_remote_user;
proxy_set_header Remote-User $user;
proxy_pass http://grafana:3000;
}
}
Related on TokRepo
- Self-hosted tools -- Self-hosted infrastructure and applications
- AI tools for security -- Security tools for authentication and access control
Common pitfalls
- Not securing the Authelia configuration file. It contains secrets for sessions, OIDC clients, and SMTP credentials. Set restrictive file permissions (600) and never commit secrets to git.
- Forgetting to configure SMTP for password reset and 2FA enrollment emails. Without email, users cannot recover accounts or complete WebAuthn enrollment.
- Using file-based user storage for large teams. The file backend works for small deployments but switch to LDAP for teams with more than 20 users.
Frequently Asked Questions
Authelia integrates with Nginx, Traefik, Caddy, HAProxy, and Envoy. Each has documented integration guides. Traefik is the easiest to configure because it supports ForwardAuth middleware natively.
Yes. Authelia supports WebAuthn for hardware security keys (YubiKey, SoloKey) and platform authenticators (Touch ID, Windows Hello). Passkeys are supported as a passwordless authentication method.
Yes. Authelia is an OpenID Connect certified provider. Applications that support OIDC (Grafana, Gitea, Portainer) can use Authelia as their identity provider without the auth_request proxy pattern.
Yes. Authelia is open source under the Apache-2.0 license. There is no paid version or enterprise tier. The project is community-maintained with corporate sponsors.
Keycloak is a full-featured enterprise identity platform with user federation, social login, and admin UI. Authelia is lighter and focused on reverse proxy authentication. Choose Keycloak for complex enterprise needs; choose Authelia for homelab and small team simplicity.
Citations (3)
- Authelia GitHub— Authelia is an OpenID Connect certified SSO portal
- W3C WebAuthn— WebAuthn specification for hardware key authentication
- Authelia Integration Docs— Reverse proxy authentication patterns
Related on TokRepo
Discussion
Related Assets
Moodle — Open-Source Learning Management System
The most widely used open-source learning platform, providing course management, assessments, and collaboration tools for educators and organizations worldwide.
Sylius — Headless E-Commerce Framework on Symfony
An open-source headless e-commerce platform built on Symfony and API Platform, designed for developers who need a customizable and API-first commerce solution.
Akaunting — Free Self-Hosted Accounting Software
A free, open-source online accounting application built on Laravel for small businesses and freelancers to manage invoices, expenses, and financial reports.