Skip to content

Docker Compose

services:
autentico:
image: ghcr.io/eugenioenko/autentico:latest
command: ["start", "--auto-setup"]
restart: unless-stopped
ports:
- "9999:9999"
volumes:
- autentico-data:/app/data
volumes:
autentico-data:

On first start, --auto-setup generates a .env with fresh secrets (RSA key, CSRF, token signing) and persists it on the volume alongside the database. On subsequent starts, the existing configuration is reused.

Terminal window
docker compose up -d

Open http://localhost:9999/onboard to create your admin account.

For production, set your public URL and bind to localhost only (let a reverse proxy handle TLS):

services:
autentico:
image: ghcr.io/eugenioenko/autentico:latest
command: ["start", "--auto-setup", "--url", "https://auth.example.com"]
restart: unless-stopped
ports:
- "127.0.0.1:9999:9999"
volumes:
- autentico-data:/app/data
volumes:
autentico-data:

If you prefer to manage secrets explicitly, generate a .env first and pass it to the container:

Terminal window
# Generate .env locally (requires the binary)
autentico init --url https://auth.example.com
services:
autentico:
image: ghcr.io/eugenioenko/autentico:latest
restart: unless-stopped
ports:
- "127.0.0.1:9999:9999"
volumes:
- autentico-data:/app/data
env_file:
- .env
volumes:
autentico-data:

Add .env to .gitignore to avoid committing secrets.

Add a Caddy service for automatic HTTPS via Let’s Encrypt:

services:
autentico:
image: ghcr.io/eugenioenko/autentico:latest
command: ["start", "--auto-setup", "--url", "https://auth.example.com"]
restart: unless-stopped
expose:
- "9999"
volumes:
- autentico-data:/app/data
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy-data:/data
depends_on:
- autentico
volumes:
autentico-data:
caddy-data:

Caddyfile:

auth.example.com {
reverse_proxy autentico:9999
}
Terminal window
docker compose pull
docker compose up -d

Migrations are applied automatically on startup. Back up your data volume before upgrading.

Set AUTENTICO_TRUSTED_PROXIES in Autentico’s environment to the proxy address or a dedicated proxy network as seen inside the Autentico container. Loopback CIDRs apply only when the proxy connects over the same network namespace.

For example, with a dedicated Docker network containing only Autentico and a proxy at 172.30.0.2:

environment:
AUTENTICO_TRUSTED_PROXIES: "172.30.0.2/32"

Use the address assigned in your Compose network configuration; this example address is not a Docker default. Keep untrusted containers off the trusted network and restrict direct access to Autentico’s internal port. For multiple proxies, include each trusted hop’s CIDR. See Reverse Proxy.

On upgrade, the empty default uses the connecting peer for rate limits, audit logs and session records. Configure proxy trust to restore per-user client IPs behind your proxy.