---
title: authentik Stack
description: Authentik server with Postgres, Redis, and worker services
published: true
date: 2026-05-04T02:35:05.228Z
tags: docker, swarm, authentik, netgrimoire
editor: markdown
dateCreated: 2026-05-04T02:35:05.228Z

---

# authentik

## Overview
The authentik Stack provides a centralized account management solution for NetGrimoire. It consists of an authentik server with Postgres and Redis databases, as well as an authentik worker service.

---

## Architecture
| Service | Image | Port | Role |
|---------|-----|-----|-------|
- **authentik**: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.2} | 9080:9000 | Internal |
- **Postgres**: docker.io/library/postgres:16-alpine | 5432:5432 | Database |
- **Redis**: docker.io/library/redis:alpine | 6379:6379 | Cache |

Exposed via:
- auth.netgrimoire.com
- https://auth.netgrimoire.com

Homepage group: Authentication
Homepage name: Authentik
Homepage icon: authentik.png
Homepage.href: https://auth.netgrimoire.com
Homepage.description: Account Manager

---

## Build & Configuration

### Prerequisites
* Docker 20.10+
* Caddy 2.4+

### Volume Setup
```bash
mkdir -p /DockerVol/Authentik/media/
mkdir -p /DockerVol/Authentik/custom-templates/
```

### Environment Variables
```bash
# generate: openssl rand -hex 32
AUTHENTIK_SECRET_KEY=g8JIvopgkcpIeRUKgfT5KwHFUwGNBFobwhHMHx08wPTJTtAlmqllAwmr6u4jk+ng8O1gbV/gwZnYylMn
```

### Deploy
```bash
cd services/swarm/stack/authentik
set -a && source .env && set +a
docker stack config --compose-file authentik-stack.yml > resolved.yml
docker stack deploy --compose-file resolved.yml authentik
rm resolved.yml
docker stack services authentik
```

### First Run
After the initial deployment, you may need to run:
```bash
docker exec -it authentik worker init
```
to initialize the authentik database.

---

## User Guide

### Accessing authentik
| Service | URL | Purpose |
|---------|-----|---------|
- **authentik**: https://auth.netgrimoire.com

### Primary Use Cases
To access the authentik interface, navigate to <https://auth.netgrimoire.com>.

### NetGrimoire Integrations
The authentik service connects to the Postgres database for storing user credentials and data. It also communicates with the Redis cache for faster lookups.

---

## Operations

### Monitoring
Kuma monitors:
- authentik: https://kuma.netgrimoire.com/authentik
```bash
docker stack services authentik
docker service logs -f authentik
```

### Backups
Critical backups are stored in /DockerVol/Authentik/backup/. The Postgres database is not backed up as it's managed by the container.

### Restore
To restore from backup, run:
```bash
cd services/swarm/stack/authentik
./deploy.sh --restore-from-backup
```

---

## Common Failures
| Symptom | Cause | Fix |
|---------|-------|-----|
- **Failed to connect to Postgres**: Insufficient Postgres credentials or connection issues. Check the Postgres credentials and ensure the container is connected to the correct database.
- **Redis not responding**: Check the Redis logs for errors or connections issues. Ensure the Redis container is running correctly.

---

## Changelog

| Date | Commit | Summary |
|------|--------|---------|
| 2026-05-03 | 772a2189 | Initial documentation and build configuration |
| 2026-05-03 | 1dfb13d2 | Updated authentik stack to use the latest image tag |
| 2026-05-03 | 4e88e512 | Fixed redis logs directory path |

Generated by Gremlin on 2026-05-04T02:35:05.228Z
Source: swarm/authentik.yaml
Review User Guide and Changelog sections