Authentik — SSO and Forward Auth in Docker

Authentik single sign-on in front of Docker apps with Traefik

Follow this guide at your own risk, and back up your data first. Full disclaimer

Updated 30 October 2026 Tested with: Authentik 2026.8.5

Authentik puts one login page in front of all your apps. Instead of a separate username and password for Radarr, Sonarr, qBittorrent and the rest, you log in once, with a password and a 6-digit code from your phone, and that one login opens every app.

This guide sets up Authentik with Docker Compose and connects it to Traefik, so any app you choose asks for the Authentik login first. It takes about 30 minutes.

On this page (12 sections)

See what Authentik does

Press Open Radarr and watch where you’re sent. Then press Open Sonarr. Try switching the Authentik middleware off too. Under the demo is the generator you’ll use in Step 1.


Open the generator full screen

What you need

  • A computer or NAS running Docker. New to Docker? My Docker install guide covers Windows, Mac and Linux.
  • Traefik already running, with your apps reachable at addresses like radarr.yourdomain.com. My Cloudflare Tunnel + Traefik guide sets that up.
  • An authenticator app on your phone, such as Google Authenticator, Microsoft Authenticator or 2FAS.
Why bother? If your apps can be reached from the internet, each one’s own login is all that stands between a stranger and your server. Authentik adds one strong login, with a code from your phone, in front of all of them. And because the apps are only reachable through Traefik, nobody can go round it.

Step 1: Make your files

In the generator, choose how your Traefik runs. If you followed my Cloudflare Tunnel guide, that’s Host networking. Type your domain, tick the apps you want behind the login, and you’re done: the .env tab already has two long random passwords in it. Then on your server:

  1. Make a folder and go into it:
    mkdir -p ~/authentik && cd ~/authentik
  2. Save the generator’s compose.yaml and .env there. Use the Download buttons, or nano and paste.
  3. Run the commands from the Commands tab. They make the data folders, give them to user 1000 (the user Authentik runs as), and start it.

The first start takes about a minute. Wait until docker compose ps shows all three containers as healthy.

Step 2: Add the Traefik routes

Open the dynamic.yml tab. It has three parts:

  • The authentik middleware. This is the check: before Traefik opens an app, it asks Authentik whether you’re logged in.
  • A route for Authentik itself, at authentik.yourdomain.com. It doesn’t use the middleware, or the login page would need a login.
  • A route for each app you ticked, with middlewares: [authentik].

Add these to Traefik’s dynamic.yml. If the file already has routers: or services:, put the new lines under the ones that are there, not in a second copy. Traefik picks up the change as soon as you save, with no restart.

Already have routes for these apps? Don’t add them twice. Just add middlewares: [authentik] to your existing ones.

Your apps won’t open until Steps 3 to 5 are done. That’s expected.

Step 3: Make your admin account

Open https://authentik.yourdomain.com/if/flow/initial-setup/. Type your email and a strong password. This creates the admin user, akadmin.

Authentik Docker Compose initial setup screen for creating the akadmin account

Step 4: Make one proxy provider

A provider tells Authentik how to protect things. You only need one, because it covers every address on your domain.

  1. Go to Applications → Providers and click Create.
  2. Choose Proxy Provider.
  3. Name: home-server
  4. Authorization flow: default-provider-authorization-implicit-consent
  5. Choose Forward auth (domain level).
  6. Authentication URL: https://authentik.yourdomain.com
  7. Cookie domain: yourdomain.com
  8. Click Finish.
Authentik Create Proxy Provider with Forward auth (domain level) selected

Step 5: Make an application

  1. Go to Applications → Applications and click Create.
  2. Name: Home server. Slug: home-server.
  3. Provider: the home-server provider from Step 4. Click Create.
  4. Go to Applications → Outposts and edit the authentik Embedded Outpost. It’s already there, built into Authentik.
  5. Move Home server into Selected Applications and click Update.
Authentik New Application dialog with name, slug and provider

Step 6: Turn on the phone code

Authentik’s login already has a two-factor step, but it lets people skip it. Make it compulsory:

  1. Go to Flows and Stages → Stages.
  2. Edit default-authentication-mfa-validation.
  3. Device classes: tick TOTP Authenticators.
  4. Not configured action: choose Force the user to configure an authenticator.
  5. Configuration stages: choose default-authenticator-totp-setup. Click Update.

The next time you log in, Authentik shows a QR code. Scan it with your authenticator app and type the 6-digit code. After that, every login asks for the code.

Authentik two-factor setup screen with a QR code to scan

Step 7: Test it

Open a private browser window and go to https://radarr.yourdomain.com. You should land on the Authentik login page. Log in with your password and phone code, and Radarr opens. Now go to https://sonarr.yourdomain.com: it opens straight away, with no login. It’s working. 🎉

Authentik Docker Compose login page shown when opening a protected app

Protecting another app later

Add a router for it in dynamic.yml with middlewares: [authentik], plus its service. Nothing changes in Authentik, because the provider from Step 4 covers every address on your domain.

Optional: log in with Plex

You can add a Log in with Plex button for people you share your Plex server with. Go to Directory → Federation and Social login, click Create and choose Plex Source. Leave Allow friends to authenticate off unless you want your Plex friends to get in. Then add the source to the default-authentication-identification stage, under Sources. Plex users still need the phone code from Step 6.

If something’s wrong

  • The login page keeps going round in a loop. The cookie domain is wrong. It must be your bare domain (yourdomain.com) in both the compose file and the provider, with no dot or https:// in front.
  • Traefik shows “Bad Gateway” for every app. Traefik can’t reach Authentik. Check docker compose ps shows it healthy. If your Traefik isn’t on host networking, pick On a Docker network in the generator instead.
  • You get a 404 “not found” from Authentik. The application isn’t in the embedded outpost. Do the last two parts of Step 5 again.
  • It never asks for the phone code. Check Not configured action in Step 6. It’s set to Skip by default.
  • The containers keep restarting. Run docker compose logs server. “Permission denied” means the folders aren’t owned by user 1000: run the chown line from the Commands tab again.
  • Locked out of akadmin. This prints a one-time login link:
    docker exec authentik-server ak create_recovery_key 1 akadmin

Updating Authentik

Authentik’s version is set in the .env file (AUTHENTIK_TAG). To update, change it to the new version, then:

cd ~/authentik
docker compose pull && docker compose up -d

Read the release notes first, and go up one version at a time (for example 2026.5 to 2026.8), not several at once.

Frequently asked questions

What does Authentik do?

It puts one login page in front of all your apps. You log in once, with a password and a 6-digit code from your phone, and that login opens every app behind it.

Why does the Authentik login page keep looping?

The cookie domain is wrong. It must be your bare domain (yourdomain.com) in both the compose file and the provider, with no dot or https:// in front.

Why doesn't Authentik ask for the phone code?

Check Not configured action in the authenticator validation stage. It's set to Skip by default.

What if I'm locked out of akadmin?

Run the recovery command in this guide's troubleshooting section. It prints a one-time login link.

Thank you

Authentik is made by Authentik Security and its community. It’s open source and free for home use. A GitHub star helps them keep going.

Related guides: Cloudflare Tunnel + Traefik · Radarr · Sonarr · Prowlarr

If this guide helped you, consider buying me a coffee. It helps keep guides like this one coming.

☕Buy me a coffee

Get new guides by email

About one email a month: new step-by-step guides and card releases. No spam, unsubscribe any time.

I'll send a confirmation email first. See the privacy policy.

Leave a Reply