---
title: authentik Stack
description: Authentik service stack in NetGrimoire
published: true
date: 2026-04-30T18:02:56.626Z
tags: docker, swarm, authentik, netgrimoire
editor: markdown
dateCreated: 2026-04-30T18:02:56.626Z
---

# authentik

## Overview
The authentik stack is a critical component in NetGrimoire, providing an Account Manager service to manage user identities and access rights.

---

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

Exposed via: auth.netgrimoire.com

Homepage group: Management

---

## Build & Configuration

### Prerequisites
No specific prerequisites for this stack.

### Volume Setup
```bash
mkdir -p /DockerVol/Authentik
chown -R authentik:authentik /DockerVol/Authentik
```

### 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
Run `./deploy.sh` to complete the initial setup.

---

## User Guide

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

### Primary Use Cases
Use authentik for user identity management, access control, and auditing.

### NetGrimoire Integrations
Authentik integrates with other NetGrimoire services via environment variables and labels. For example, it uses the `AUTHENTIK_POSTGRESQL__HOST` variable to connect to the PostgreSQL database.

---

## Operations

### Monitoring
[kuma monitors from kuma.* labels]
```bash
docker stack services authentik
docker service logs -f authentik
```

### Backups
Critical: backup critical data in `/DockerVol/Authentik/media` and `/DockerVol/Authentik/custom-templates`.

Reconstructable: backup `/DockerVol/Authentik/certs` if necessary.

---

## Common Failures
| Symptom | Cause | Fix |
|---------|-------|-----|
| Service not available | Network issue | Check Caddy logs for errors. |
| Database corruption | Data loss | Run `docker exec -it authentik pg_resetdb` to reset the database. |
| Redis down | Configuration issue | Check `docker service logs redis` for errors and adjust configuration as needed. |

---

## Changelog

| Date | Commit | Summary |
|------|--------|---------|
| 2026-04-30 | 6de54336 | Initial documentation |
| 2026-04-30 | daa4c2c1 | Update service dependencies |
| 2026-04-30 | 14c51981 | Improve Caddy configuration |
| 2026-04-30 | fb06997a | Fix Redis connection issue |
| 2026-04-30 | 1e8b7cd8 | Enhance monitoring and logging |

---

## Notes
- Generated by Gremlin on 2026-04-30T18:02:56.626Z
- Source: swarm/authentik.yaml
- Review User Guide and Changelog sections