Dissecting Authelia's architecture: the Go server, configuration.yml, Redis session storage, user database, storage backend, and notifier, then following the end-to-end authentication flow from a browser request to the session cookie, plus key terms like access control and policy.

After episode 1, where we understood why Authelia is needed — one entrance for many applications — in this episode we dissect how Authelia works behind the scenes. This is the most important episode to understand before touching any configuration: without the architecture, all the configuration.yml syntax is just memorization that's easy to misuse.
We'll map out the architecture components, understand the core concepts (portal, access control, 1FA vs 2FA, session), then follow the journey of a single HTTP request from the browser all the way back carrying a session cookie. Just as a pilot must understand how the wings work before flying, engineers who understand Authelia's architecture will debug problems in the following episodes much faster.
Authelia never runs alone. It's a single point of coordination among five other components. Let's break them down one by one.
The heart is the Authelia binary written in Go. It serves two purposes: the verification endpoint (which the reverse proxy calls to evaluate every request) and the login portal (the interface where users sign in). By default it listens on port 9091. The server is "stateless" as far as sessions go — all sessions are stored in Redis, so it will be easy to scale horizontally later in the high availability episode.
All of Authelia's behavior is determined by a single file: configuration.yml. From here Authelia knows where users are stored, where sessions are stored, how to send notifications, and what access rules apply. We'll dissect this file thoroughly in episode 4.
Login state (sessions) is stored centrally — usually in Redis. Why not inside Authelia itself? Because with Redis, sessions can be shared across multiple Authelia instances, and sessions can be revoked centrally. For development, Authelia also supports in-memory sessions, but Redis is the production recommendation. Episode 7 covers sessions in full.
The source of truth for user accounts. Authelia doesn't force a particular format — it supports a YAML file (users_database.yml) for small scale, as well as LDAP and Active Directory for organizations. This is called the authentication backend, and episode 5 will cover all three in depth.
Different from the user database, the storage backend stores data that Authelia itself generates: TOTP secrets, WebAuthn credentials, identity verification tokens, and OIDC consent records. The options: local SQLite (default, simplest), PostgreSQL, or MySQL/MariaDB. Episode 8 covers this.
Authelia needs to send emails — for example verification codes for password resets or device registration confirmations. Two options: SMTP for production, and filesystem (writing "emails" to a local file) for the lab. Episode 12 covers SMTP configuration.
Some terms will keep appearing throughout this entire series. Understand them now so you don't get lost later:
auth.example.com). This is the only entrance for all protected applications.grafana.example.com. All requests to this domain must pass Authelia verification.bypass, one_factor, two_factor, or deny policies.This is the "everything comes together" moment. Follow the journey of a single request:
https://grafana.example.com in the browser.https://auth.example.com.https://grafana.example.com — now carrying the session cookie.Remote-User, Remote-Groups).Browser Proxy (NGINX) Authelia Redis
| 1. GET / (no cookie) | | |
|--------------------------->| 2. verify? | |
| |--------------------->| 3. check session |
| | |------------------>|
| | | 4. none |
| |<---------------------|<------------------|
| 5. redirect to portal | | |
|<---------------------------| | |
| 6. POST username+pass | | |
|--------------------------------------------------->| 7. validate user|
| | | 8. create session|
| | |------------------>|
| 9. set cookie + redirect | | |
|<---------------------------| | |
| 10. GET / (with cookie) | | |
|--------------------------->| 11. verify? | |
| |--------------------->| 12. session valid |
| | |------------------>|
| |<---------------------|<------------------|
| 13. GET / + Remote-User | | |
|<---------------------------| 14. Grafana response | |Important
Notice that the application (Grafana) never sees the user's password and never talks directly to Authelia. All authentication decisions happen between the proxy and Authelia; the application only receives identity headers. This is the forward authentication pattern: the application stays naive, security is centralized.
Authelia is built on the principle of defense in depth — multiple layers of defense, not a single fence:
deny), only opened through explicit rules.In episode 2 you've mapped Authelia's architecture: the Go server as coordinator, configuration.yml as the brain, Redis for sessions, the authentication backend (file/LDAP/AD) for user accounts, the storage backend (SQLite/PostgreSQL/MySQL) for MFA data, and the notifier for emails. You've also followed the complete journey of a single request: from browser, to proxy, to Authelia verification, to portal, back with a session cookie, until the application receives identity headers.
Key takeaways:
deny.In the next episode, episode 3, we'll start taking action: installing Authelia with Docker Compose — assembling the Authelia + Redis + database stack, creating a minimal configuration file, managing secrets via a .env file, and verifying your first Authelia portal. See you in episode 3!