Docker compose Installation

Prerequisites

  • Create a folder specifically for this app.

  • Add DNS record for the FQDN auth.domain.com to your server public IP address.

  • (If no reverse proxy installed) Add NAT rule on your router/firewall to redirect incoming connection on port 443 to your internal server IP on port 9443.

Environment file .env

Authentik uses a .env file to load environment variables, here's how to set it up :

As the official doc indicate to run authentik as root user, we can at least protect our .env file to be read only by root :

Preparation

Creates the 3 folders certs, custom-templates and media inside your authentik directory

Docker compose file

Here is my version of the docker compose template file for authentik, if you want the official one, you can download it here.

As you can see, this template is tweaked compared to the original one, I added a docker-socket-proxy to secure the access to the docker socket, as the authentik worker only require access to docker images and containers.

I also separated networks for authentik :

  • The authproxy network contains all of the containers except authentik-dockersocket

  • The authsocket network contains only the worker and the dockersocket container to limit access to the socket.

To begin the initial setup, navigate to https://auth.domain.com/if/flow/initial-setup/ or https://<your server>:9443/if/flow/initial-setup if accessed by LAN.

There you will be asked to set a password for the akadmin user.

Last updated