Authelia Setup to Add Two Factor Login to Home Server Apps
You finally got Jellyfin, Paperless and a dashboard reachable from outside the house, and each one has its own login page, its own password rules and, in two cases, no second factor at all.

You finally got Jellyfin, Paperless and a dashboard reachable from outside the house, and each one has its own login page, its own password rules and, in two cases, no second factor at all. One of those login pages will eventually sit behind a bug, and the only thing between that bug and your scanned tax returns is a password you typed in a hurry three years ago.
Authelia fixes the part you can actually control. It sits next to your reverse proxy and asks every visitor to log in once, with a password and a second factor, before the proxy forwards a single request to the app behind it. This is how I set it up on my own box, what I got wrong the first time, and the parts that matter more than the config file.
What Authelia actually does in front of your apps
Think of it as a doorman, not a lock on each door. When a request arrives for photos.example.net, your reverse proxy pauses and asks Authelia one question: does this browser carry a valid session cookie for this user, at this level of trust? If yes, the request goes through untouched. If no, the browser gets redirected to auth.example.net, the user logs in, and then gets sent back.
The apps never see a password. Most of them never even know Authelia exists. That is the whole point: you stop trusting the login code of twelve hobby projects and start trusting one service whose only job is authentication.
It ships as a single Go binary or a container image of roughly 25 MB. On my N100 mini PC it idles at about 30 MB of RAM, which is less than the dashboard it protects. It supports TOTP codes from any authenticator app, WebAuthn security keys and passkeys, and push notifications through Duo if you already pay for that.
What it does not do: it does not patch the apps behind it, it does not protect anything you reach by IP address on port 8096 directly, and it does nothing for the native phone apps that talk to an API with their own tokens. Keep that last one in mind, because it decides half your configuration.
The setup, in the order that avoids lockouts
I run Authelia in Docker Compose behind Caddy. Traefik and Nginx Proxy Manager work too, and the logic is the same; only the forward auth snippet changes. If you have not picked a proxy yet, read choosing a reverse proxy for a home server first, because forward auth support should be one of your criteria.
- Create the subdomain and certificate first. Point auth.example.net at the proxy and confirm it loads a plain test page over HTTPS. Authelia refuses to set cookies on plain HTTP, and debugging both problems at once wastes an evening.
- Generate three secrets. You need a JWT secret, a session secret and a storage encryption key, each at least 64 random characters. I use openssl rand -hex 64 three times and store them as Docker secrets, not as plain lines in the YAML.
- Start with the file user backend. A users_database.yml with two or three accounts is fine for a household. Hash passwords with the authelia crypto hash generate argon2 command. LDAP is overkill below about ten users.
- Use SQLite for storage and the filesystem notifier. The notifier writes the registration link for a new second factor into a text file instead of sending email. It feels crude, but it removes SMTP as a failure point while you test.
- Write the access control rules before you wire any app. Set default_policy to deny. Then add rules per domain. Anything you forget is blocked rather than open.
- Protect one low stakes app. I started with Uptime Kuma. Add the forward_auth block in Caddy, reload, and open the app in a private window. You should land on the Authelia portal.
- Register your second factor, then a backup. Enrol a TOTP app and, if you own one, a hardware key. Write down where the recovery path is before you need it.
- Add the remaining apps one at a time, testing each in a private window and on mobile data, not on your home Wi-Fi.
That last step catches the mistake I made: my home network was in a bypass rule, so everything looked perfect from the sofa and was wide open in a way I had not intended from a cafe. The rule was correct. The subnet in it was wrong by one digit.
Policies worth setting on day one
Authelia has four policy levels: bypass, one_factor, two_factor and deny. My file uses all four:
- two_factor for anything holding documents, photos, passwords or admin panels.
- one_factor for a recipe app my partner uses on a shared kitchen tablet. A conscious trade, written down.
- bypass only for specific API paths, such as /api/ on Jellyfin, so the TV app keeps working. The rest of that domain stays on two_factor.
- deny as the default, and explicitly for any /admin path I never use remotely.
Set the session expiration to something you can live with. I use 4 hours of inactivity and a 1 hour remember me window off, because a session cookie on a borrowed laptop is exactly the risk this whole setup exists to remove.
Why "just add 2FA to each app" is weaker advice than it sounds
The common suggestion on forums is to skip a central login and turn on the built-in two factor option in every app that offers it. It sounds simpler, and for one or two apps it is. With more than that, I think it is the worse choice, for three reasons.
First, coverage. In my own stack of nine apps, four had built-in TOTP, two had it only through a plugin, and three had nothing. You end up with a patchwork where the weakest app sets the real security level of the whole server.
Second, the login code itself. An app's own two factor check runs inside that app. If the app has an authentication bypass bug, and several popular self hosted projects have had exactly that kind of bug in the past two years, the second factor goes down with it. Authelia stops the request before the vulnerable code ever runs.
Third, rate limiting and lockout. Authelia's regulation settings ban an account after a set number of failed attempts in a time window. I use 5 attempts within 2 minutes for a 10 minute ban. Most hobby apps have no brute force protection at all, which is why the checklist before exposing a home server online treats unprotected login pages as the first thing to fix.
Where the per-app approach wins: native clients. Bitwarden apps, Nextcloud sync and the Immich phone app cannot complete a browser redirect, so those need their own strong login plus a bypass rule limited to their API paths. Use both layers, and be honest with yourself about which paths are bypassed.
Keeping it running without locking yourself out
The failure people fear is real. If Authelia's container dies, every protected app returns an error, and if you lose your phone, you lose your second factor. Plan for both on a quiet Sunday rather than at 11 pm when you need a file.
For the container, set restart: unless-stopped and add a health check. Keep a local-only path into the proxy, such as a LAN address, where admin panels are reachable without Authelia. That is your maintenance door, and it should only answer on your home subnet.
For the second factor, register two methods per person. A YubiKey Security Key costs about 29 dollars and lives in a drawer. If someone still loses everything, an admin can reset their TOTP from the command line in under a minute, and the steps in recovering accounts after losing a 2FA phone apply to the rest of their accounts too.
Back up three files: configuration.yml, users_database.yml and the SQLite database. The database holds registered devices; without it, everyone re-enrols. My nightly backup job copies them along with the rest of the server config, and I tested a restore once, which took about six minutes including the moment I realised the encryption key also has to come along.
Finally, watch the logs for the first two weeks. Authelia logs every denied request with the domain and the rule that matched. Most of what you will see is your own devices hitting paths you forgot to allow. Occasionally it is a scanner from somewhere else, and seeing those get stopped at the door is the most reassuring log line on the whole server.
FAQ
Is Authelia free to use at home?
Yes. It is open source under the Apache 2.0 licence, with no paid tier. The only costs are the hardware it runs on and, optionally, a hardware security key.
Do I need Authelia if I only use a VPN?
Probably not. If every app is reachable only over WireGuard or Tailscale, the VPN is already your front door. Authelia earns its place once anything is published on a public subdomain.
Can Authelia work with Nginx Proxy Manager?
It can, through the advanced tab on each proxy host, but the snippets are longer and easier to break. Caddy and Traefik need fewer lines for the same result.
What is the difference between Authelia and Authentik?
Authentik is a heavier identity provider with a web admin panel and more protocols. Authelia is lighter and configured in files. For a household with under ten users, Authelia is usually the easier one to keep running.
More in Self Hosting
Self Hosting
Dynamic DNS Setup to Reach Your Home Server by Name
The server at home is fine. The router is fine. What broke is the sentence you memorised two months ago, the one with four...
Self Hosting
Minecraft Server on a Mini PC: RAM, Flags and Backups
The server my friends play on is a fanless Intel N100 mini PC that cost $155, sits on a shelf behind the router, and has been...
Self Hosting
Updating Self Hosted Containers Without Breaking Them
Nothing on the server is broken, which is exactly why the Nextcloud container on mine spent fourteen months running an image I...