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.
In my current configuration, I use authentik as my IDP but also my Reverse-proxy. This isn't ideal as there isn't much configuration settings but for the start it's not that bad. This is why I have two network proxyadmin and proxymedia, respectively containing all server administration apps and media apps which will be accessed by everyone.
If you want to do like me, you have to create those networks with "sudo docker network create proxyadmin" and "sudo docker network create proxymedia"
If you already use a reverse proxy, delete networks proxyadmin and proxymedia, as well as their references in the authentik-server container inside docker-compose.yml
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