Skip to main content

01. Docker Installation

Official Installation Page: Authentik Docker Installation

Again as usual we will leverage Dockge to install Authentik on our Docker VM that we have created in our Proxmox Server. If you have not done this yet then please go to Docker VM Install

1. The first thing we do is set the values for our reverse proxy. By default, Authentik listens internally on port 9000 for HTTP and 9443 for HTTPS. However, if you want to change that you can do that in the environment variables file below.

2. Since, Authentik supports HTTPS we will then also use HTTPS for our Caddy reverse proxy entry

https://authentik.example.org ---> https://IP-Address-Docker-VM:9443

3. According to the documentation we can obtain the docker compose file with the following command

wget https://docs.goauthentik.io/compose.yml
Docker Compose File
services:
  postgresql:
    env_file:
      - .env
    environment:
      POSTGRES_DB: ${PG_DB:-authentik}
      POSTGRES_PASSWORD: ${PG_PASS:?database password required}
      POSTGRES_USER: ${PG_USER:-authentik}
    healthcheck:
      interval: 30s
      retries: 5
      start_period: 20s
      test:
        - CMD-SHELL
        - pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
      timeout: 5s
    image: docker.io/library/postgres:16-alpine
    restart: unless-stopped
    volumes:
      - ./database:/var/lib/postgresql/data
  server:
    command: server
    depends_on:
      postgresql:
        condition: service_healthy
    env_file:
      - .env
    environment:
      AUTHENTIK_POSTGRESQL__HOST: postgresql
      AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
      AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
      AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
      AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required}
    image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2026.5.2}
    ports:
      - ${COMPOSE_PORT_HTTP:-9000}:9000
      - ${COMPOSE_PORT_HTTPS:-9443}:9443
    restart: unless-stopped
    shm_size: 512mb
    volumes:
      - ./data:/data
      - ./custom-templates:/templates
  worker:
    command: worker
    depends_on:
      postgresql:
        condition: service_healthy
    env_file:
      - .env
    environment:
      AUTHENTIK_POSTGRESQL__HOST: postgresql
      AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
      AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
      AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
      AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required}
    image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2026.5.2}
    restart: unless-stopped
    shm_size: 512mb
    user: root
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data:/data
      - ./certs:/certs
      - ./custom-templates:/templates

 

2.4. We then grab this docker compose file and copy paste it into our Dockge container and change the following. Most of the docker compose file can stay in tact but if you are like me and want to keep all files for one project in one folder then you should remove the docker database volume and replace it with ./database. 

3.5. Next is creating an environment file that serves the values requested in the compose file

PG_DB=databasenameofyourinstance
PG_PASS=passwordofyourinstance
PG_USER=usernameforyourinstance
AUTHENTIK_SECRET_KEY=yoursecretkey
AUTHENTIK_IMAGE=ghcr.io/goauthentik/server
AUTHENTIK_TAG=2026.5.2 # This the Authentik version
COMPOSE_PORT_HTTP=9001 
COMPOSE_PORT_HTTPS=9444


6. If that is all set we can deploy our setup and go to the domain name you have set for your Authentik server.