Lost MFA data means users must re-register every device. This episode arranges the Authelia backup strategy: what must be backed up, scheduling and encryption, step-by-step restore procedures, secret rotation, disaster scenarios, and testing backups so you don't fool yourself.

Episode 26 taught you how to observe Authelia: logs, metrics, and alerting tell you when there's a problem. But observability doesn't save data. If the Authelia database is damaged without a backup, every user must re-register all their MFA devices — TOTP, WebAuthn, everything — all at once. That's not just a tedious night; it's a loss of trust.
Episode 27 arranges a backup and disaster recovery strategy: what must be saved, how to schedule and secure it, how to restore during a disaster, up to secret rotation. Backup is insurance — boring when everything is fine, priceless when everything falls apart.
Authelia stores important data in several places. The complete list:
| Data | Location | Consequence if lost |
|---|---|---|
| Configuration file | configuration.yml | The entire configuration must be rebuilt from scratch |
| User database | users_database.yml | All users and password hashes are lost |
| Storage database | PostgreSQL / MySQL / SQLite | TOTP, WebAuthn, OIDC tokens are lost — MFA must re-register |
| Sessions | Redis | Users log in again (lightest impact) |
| Secrets | Session secret, JWT, storage encryption key | Sessions unreadable, MFA data undecryptable |
| TLS certificates | Let's Encrypt / internal CA | HTTPS breaks |
Note the impact hierarchy. Losing Redis sessions only forces a re-login. Losing the storage database is a medium disaster: users can still log in with a password, but all second factors are gone. Losing the secrets means the encrypted MFA data in the database becomes unreadable — even existing backups are useless if they don't include the keys.
Apply the 3-2-1 rule: three copies of the data, on two different media, one at a separate location. For the Authelia components:
pg_dump in custom format, run as a scheduled task (cron or a K8s CronJob), then send a copy to object storage:pg_dump -U authelia -h postgres-primary -d authelia -Fc \
-f /backup/authelia-$(date +%F).dumpredis-cli -a '<redis-password>' SAVE
cp /var/lib/redis/dump.rdb /backup/redis-dump.rdbconfiguration.yml and users_database.yml just need to be copied, but because they contain secrets, encrypt them first. If the configuration already lives in Git with secrets separated into Vault, these files just get re-rendered from the source of truth.Warning
Secrets must be included in the backup — encryption at rest is the key, not an obstacle. Store a copy of the secrets encrypted with GPG or in Vault alongside the backup. The most painful scenario is having a great database backup but no storage encryption key to unlock it.
A good restore goes bottom-up in sequence. The order for a full disaster:
pg_restore -U authelia -h postgres-primary -d authelia \
--clean --if-exists /backup/authelia-2026-08-03.dumpauthelia validate-config --config /config/configuration.yml and authelia storage schema-info to make sure the config is valid and the database schema matches, then test one login.An untested restore is just wishful thinking. You don't want to test this procedure for the first time in the middle of a real incident.
Rotating Authelia secrets requires understanding their side effects. The session secret is used to encrypt session data — changing it invalidates all active sessions. That's not a bug, it's a feature: when a leak is suspected, replacing the session secret is the instant way to cut all sessions.
The storage encryption key protects MFA data in the database. Authelia provides a special command to change it without losing data:
authelia storage encryption change-key --new-key '<new-key>'Secret rotation should be a scheduled agenda, not a reaction — for example every 90 days for the session secret and JWT secret, and test the storage key rotation in a staging environment before production.
Plan for disasters before they happen by setting two numbers:
Three common scenarios and how to handle them:
| Scenario | Impact | Response |
|---|---|---|
| Authelia instance dies | All gates closed | Replace the instance from the same image; sessions in Redis recover along with it |
| Database corrupted | MFA lost, password login still works | Restore the latest dump; users re-register devices since the RPO |
| One region lost | All infrastructure gone | Restore from off-site backup to a second region; needs complete documentation |
Important note: in the HA architecture from episodes 24 and 25, the Authelia instance isn't "restored" — it's replaced. What's truly restored is the data: database, files, and secrets.
A backup that's never tested is a guess. Schedule regular restore drills: at least once a month, restore the dump to a separate environment, run Authelia there, and test a real login + MFA. Many teams find corrupted dumps, missing keys, or wrong procedures exactly at the first drill.
Automate as much as possible. In Kubernetes, a CronJob that runs pg_dump, encrypts the result, and uploads it to object storage removes human error from the equation. Document everything — scripts, order, and contacts — because during an incident, memory is the first thing to go.
Episode 27 gives you Authelia's digital insurance: understanding what must be backed up along with the impact of losing it, applying the 3-2-1 strategy with pg_dump, Redis snapshots, and secret encryption, running a sequential restore with validation at the end, rotating secrets including authelia storage encryption change-key, and setting RTO/RPO and testing backups with regular restore drills.
Key points:
The infrastructure is secure and recoverable. Now how do you make it fast? In episode 28 we dissect Performance Tuning: benchmarks, Redis and database tuning, reverse proxy optimization, up to capacity planning. See you in episode 28!