Skip to content
STACK IT FAST

Authentik

Curated OSSClassicIdentity Provider & Access Management6-20 people

Audited from github.com/goauthentik/authentik

authentik is an open-source identity provider for self-hosted single sign-on, supporting SAML, OAuth2/OIDC, LDAP, and RADIUS, built as a Django core with Go outpost proxies for legacy protocols and a Lit-based web UI.

Language
Python
Database
PostgreSQL
Hosting
Docker
Running for
5 years
Team
6-20 people

Why this architecture

Replacing Redis with three purpose-built PostgreSQL-backed packages for channels, cache, and task queueing shrinks the required external dependencies to just PostgreSQL, while protocol proxying is pushed into separate Go outposts instead of the main Django process.

Tech stack by layer

9 technologies · audited Sep 17, 2026
Frontend & UI
  • LitWeb-components framework behind the admin and user-facing UI (path aliases for #elements, #components, #flow, #admin).
  • ViteBundles the Lit-based web frontend.
  • StorybookComponent development and visual documentation for the web UI.
  • DocusaurusPowers the goauthentik.io documentation site, built as its own package.
Backend & APIs
  • PythonPrimary backend language for the Django application (authentik/).
  • DjangoWeb framework for the core application, admin, and API (django==5.2.17).
  • Django REST FrameworkREST API layer, with drf-spectacular generating the OpenAPI schema.
  • Django ChannelsASGI/WebSocket layer for realtime features (channels==4.3.2).
  • Rust (Axum)packages/ak-axum is a Rust workspace member built on the axum web framework for performance-sensitive services.
  • GoOutpost binaries (cmd/ldap, cmd/rac, cmd/radius) proxy LDAP, remote desktop (via Guacamole), and RADIUS protocols to authentik.
Data & Persistence
  • PostgreSQLPrimary datastore; django-postgres-extra and django-tenants (multi-tenancy) are direct dependencies.
  • django-channels-postgresIn-house Postgres-backed Channels layer, replacing Redis as the channel layer backend.
  • django-postgres-cacheIn-house Postgres-backed Django cache backend, replacing Redis as the cache.
  • django-dramatiq-postgresPostgres-backed Dramatiq task queue broker/result backend for background jobs.
Infrastructure & Deploy
  • DockerMulti-stage container build; lifecycle/container/Dockerfile compiles the web UI with pnpm before the Python image.
  • KubernetesOfficially supported deployment target via a separate Helm chart repository; the Python client is a direct dependency for the Kubernetes outpost controller.
  • pnpmPackage manager for the root, web/, and website/ JavaScript workspaces.
Tooling, Testing & Ops
  • GitHub ActionsSplit CI per surface: ci-main.yml (core), ci-outpost.yml (Go outposts), ci-web.yml (frontend), ci-docs.yml, plus CodeQL and Semgrep scanning.
  • SentryError tracking SDK included in the backend dependency set.
  • OpenTelemetryDistributed tracing/metrics instrumentation across ASGI, Django, psycopg, requests, and threading.

Authentik architecture diagram

Open SVG
Authentik architecture diagramWeb UI → authentik core (REST · WebSocket); Apps & services → authentik core (SSO); Legacy clients → Go outposts (protocols); Go outposts → authentik core (API); authentik core → PostgreSQL (Django ORM); authentik core → Worker (enqueue); Worker → PostgreSQL (Postgres broker)CLIENTSSERVICESWORKERS & JOBSDATA & STORAGEWeb UILit · ViteApps & servicesSAML · OAuth2 · OIDCLegacy clientsLDAP · RADIUS · RDPauthentik coreDjango · DRF · ChannelsGo outpostsldap · radius · racWorkerDramatiqPostgreSQLdata · cache · channels · queueAPIREST · WebSocketSSOprotocolsenqueuePostgres brokerDjango ORM
How the main components of Authentik connect, drawn from the audited repository.
Diagram as text
  • Web UI (Lit · Vite) → authentik core (Django · DRF · Channels): REST · WebSocket
  • Apps & services (SAML · OAuth2 · OIDC) → authentik core (Django · DRF · Channels): SSO
  • Legacy clients (LDAP · RADIUS · RDP) → Go outposts (ldap · radius · rac): protocols
  • Go outposts (ldap · radius · rac) → authentik core (Django · DRF · Channels): API
  • authentik core (Django · DRF · Channels) → PostgreSQL (data · cache · channels · queue): Django ORM
  • authentik core (Django · DRF · Channels) → Worker (Dramatiq): enqueue
  • Worker (Dramatiq) → PostgreSQL (data · cache · channels · queue): Postgres broker

Key architectural decisions

5 decisions
  1. 01

    Postgres replaces Redis for channels, cache, and the task queue

    pyproject.toml requires django-channels-postgres, django-postgres-cache, and django-dramatiq-postgres, each implemented as its own package under packages/. No redis dependency appears anywhere in the audited manifests, meaning a standard authentik deployment needs only PostgreSQL as external state, not PostgreSQL plus Redis.

  2. 02

    Legacy-protocol connectors run as separate Go "outpost" binaries, not the Django process

    cmd/ldap, cmd/rac, and cmd/radius (backed by go.mod dependencies beryju.io/ldap, wwt/guac for Guacamole-based remote access, and layeh.com/radius) are standalone Go outposts that proxy LDAP, RDP/VNC/SSH, and RADIUS to authentik over its API, so protocols the Python/ASGI stack does not natively speak still route through authentik without embedding them in the main app.

  3. 03

    A Rust/Axum workspace exists alongside the Python core

    Cargo.toml declares a workspace with packages/ak-axum, packages/ak-common, and packages/client-rust as members, pinned to axum 0.8.9 with HTTP/2 and websocket features. This is a separate, pinned-dependency Rust service layer distinct from both the Django backend and the Go outposts.

  4. 04

    Multi-tenancy is a first-class dependency, not an add-on

    pyproject.toml requires django-tenants==3.13.0 directly, which authentik uses to support its enterprise multi-tenant deployment mode on top of the same PostgreSQL schema-based isolation the library provides.

  5. 05

    Web UI, docs site, and backend are independently versioned projects in one repo

    web/package.json (Lit + Vite), website/package.json (Docusaurus, via packages/docusaurus-config), and the root pyproject.toml/Django app each have their own lockfiles and CI jobs (ci-web.yml, ci-docs.yml, ci-main.yml), letting frontend, documentation, and backend release independently within the monorepo.

How Authentik is built

How authentik is structured

The repository is a Python-first monorepo: the root pyproject.toml (uv-managed, Python 3.14) defines the Django application under authentik/ (submodules for admin, api, blueprints, core, crypto, events, flows, outposts, policies, providers, rbac, sources, stages, tenants, and more), with lifecycle/ holding the container entrypoint, migration, and worker scripts. Two other language ecosystems live alongside it: web/ is a Lit + Vite TypeScript project for the UI, and website/ is the Docusaurus documentation site; both have their own pnpm-workspace.yaml. A Go module (goauthentik.io) under cmd/ and internal/ builds the LDAP, RADIUS, and remote-access-control ("rac") outposts, and a Rust Cargo.toml workspace groups packages/ak-axum, packages/ak-common, and packages/client-rust. blueprints/ holds the YAML-based configuration-as-code system authentik uses to define flows, stages, and default setup.

Frontend

The web UI in web/ is built with Lit web components — the import aliases in web/package.json (#elements/*, #components/*, #admin/*, #user/*, #flow/*) and web/lit-localize.json for localization both point to a Lit-based architecture rather than React or Vue. Vite (web/vite.config.js) bundles it, and Storybook (web/.storybook) documents components in isolation. Translation strings are managed through lit-localize and the project's Transifex integration referenced in the README.

Backend & APIs

The Django application (authentik/) exposes its API through Django REST Framework, with drf-spectacular generating the OpenAPI schema consumed by packages/client-ts and packages/client-rust. django-channels-postgres gives the Channels-based realtime layer a PostgreSQL backend instead of the usual Redis channel layer. Protocols authentik does not implement natively in Django are handled by separate Go outposts: cmd/ldap fronts LDAP using beryju.io/ldap, cmd/radius implements RADIUS via layeh.com/radius and beryju.io/radius-eap, and cmd/rac provides browser-based remote desktop/SSH access by embedding wwt/guac, an Apache Guacamole client. A Rust Axum service (packages/ak-axum) sits in the workspace as a third backend runtime, built against a pinned axum = "= 0.8.9" with HTTP/2 and websocket features enabled.

Data & persistence

PostgreSQL is the only datastore required for a standard deployment. pyproject.toml requires django-postgres-extra and django-tenants (multi-tenant schema isolation) directly against Postgres, and three purpose-built packages replace the roles Redis usually plays in a Django stack: packages/django-channels-postgres for the Channels layer, packages/django-postgres-cache for the Django cache framework, and packages/django-dramatiq-postgres as the broker and result backend for Dramatiq background tasks. No redis package appears anywhere in the audited manifests.

Build, test & deploy

CI is split by surface in .github/workflows: ci-main.yml runs the Python/Django test suite, ci-outpost.yml builds and tests the Go outposts, ci-web.yml covers the Lit frontend, and ci-docs.yml/ci-docs-source.yml build the documentation site. qa-codeql.yml and qa-semgrep.yml run static security analysis, and qa-dependency-review.yml reviews dependency changes on PRs. Releases go through release-branch-off.yml, release-next-branch.yml, release-tag.yml, and release-publish.yml, and _reusable-container-build*.yml centralizes the multi-arch container build logic used across those release workflows.

Self-hosting notes

lifecycle/container/Dockerfile is a multi-stage build: a pnpm-based node-builder stage compiles the web UI with Node 26 before the Python application image is assembled, keeping the frontend build toolchain out of the final runtime image. The README documents four supported install paths: Docker Compose for small or test setups, a Kubernetes Helm chart (maintained in a separate goauthentik/helm repository) for larger deployments, AWS CloudFormation templates for AWS, and a DigitalOcean Marketplace one-click app. Because the realtime, cache, and queue layers are all PostgreSQL-backed, a self-hosted instance needs only a PostgreSQL database as external state — no separate Redis instance to provision or back up.

What to copy (and what not to)

Replacing Redis with dedicated PostgreSQL-backed packages for channels, cache, and task queueing is worth studying for any self-hosted product where minimizing the number of required external services matters more than squeezing out Redis's raw throughput — it trades some performance headroom for a simpler deployment story. Splitting protocol-specific proxies (LDAP, RADIUS, remote access) into separate Go outpost binaries keeps the Django core free of those protocols' idiosyncrasies, but only pays off if, like authentik, you need to support several legacy protocols that don't map cleanly onto HTTP/ASGI. Running three separate language ecosystems (Python/Django, Go outposts, Rust/Axum) in one repository is a real maintenance cost; it is worth copying only if each runtime is solving a problem the others genuinely can't, not as a default architecture.

Sources & repo audit

Audited
Sep 17, 2026
Commit
836aad0
License
NOASSERTION

Independent analysis of repository at github.com/goauthentik/authentik. Spotted an inaccuracy? Use the claim form to request a correction.

Show this stack on your README or website
Tech stack of Authentik
[![Tech stack of Authentik on STACK IT FAST](https://stackitfast.com/badge/authentik.svg)](https://stackitfast.com/project/authentik)

Paste it into your README. It shows your current stack and links to this page.

Use this stack

Scaffold it with your agent

Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Authentik's architecture.

  1. 1Copy the promptThe full markdown spec, with every layer and decision.
  2. 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
  3. 3Paste and scaffoldUse it as the first instruction; review before you ship.
use-this-stack.md · 60 lines · 8.3 KB
# MISSION: Scaffold "Authentik" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Authentik**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Authentik
- **What It Does**: authentik is an open-source identity provider for self-hosted single sign-on, supporting SAML, OAuth2/OIDC, LDAP, and RADIUS, built as a Django core with Go outpost proxies for legacy protocols and a Lit-based web UI.
- **Domain & Category**: Identity Provider & Access Management
- **Production Scale**: 6-20 people
- **Development Mode**: CLASSIC
- **Architectural Rationale**: Replacing Redis with three purpose-built PostgreSQL-backed packages for channels, cache, and task queueing shrinks the required external dependencies to just PostgreSQL, while protocol proxying is pushed into separate Go outposts instead of the main Django process.
- **Live Website Reference**: https://goauthentik.io
- **Source Repository**: https://github.com/goauthentik/authentik
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Python, Django, TypeScript, Lit, Vite, Rust, Axum, Go, PostgreSQL
- **Primary Language(s)**: Python, TypeScript, Rust
- **License of the reference repo**: NOASSERTION
- **Frontend**: Lit — Web-components framework behind the admin and user-facing UI (path aliases for #elements, #components, #flow, #admin).; Vite — Bundles the Lit-based web frontend.; Storybook — Component development and visual documentation for the web UI.; Docusaurus — Powers the goauthentik.io documentation site, built as its own package.
- **Backend & APIs**: Python — Primary backend language for the Django application (authentik/).; Django — Web framework for the core application, admin, and API (django==5.2.17).; Django REST Framework — REST API layer, with drf-spectacular generating the OpenAPI schema.; Django Channels — ASGI/WebSocket layer for realtime features (channels==4.3.2).; Rust (Axum) — packages/ak-axum is a Rust workspace member built on the axum web framework for performance-sensitive services.; Go — Outpost binaries (cmd/ldap, cmd/rac, cmd/radius) proxy LDAP, remote desktop (via Guacamole), and RADIUS protocols to authentik.
- **Data & persistence**: PostgreSQL — Primary datastore; django-postgres-extra and django-tenants (multi-tenancy) are direct dependencies.; django-channels-postgres — In-house Postgres-backed Channels layer, replacing Redis as the channel layer backend.; django-postgres-cache — In-house Postgres-backed Django cache backend, replacing Redis as the cache.; django-dramatiq-postgres — Postgres-backed Dramatiq task queue broker/result backend for background jobs.
- **Infrastructure & deploy**: Docker — Multi-stage container build; lifecycle/container/Dockerfile compiles the web UI with pnpm before the Python image.; Kubernetes — Officially supported deployment target via a separate Helm chart repository; the Python client is a direct dependency for the Kubernetes outpost controller.; pnpm — Package manager for the root, web/, and website/ JavaScript workspaces.
- **Tooling, testing & ops**: GitHub Actions — Split CI per surface: ci-main.yml (core), ci-outpost.yml (Go outposts), ci-web.yml (frontend), ci-docs.yml, plus CodeQL and Semgrep scanning.; Sentry — Error tracking SDK included in the backend dependency set.; OpenTelemetry — Distributed tracing/metrics instrumentation across ASGI, Django, psycopg, requests, and threading.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/goauthentik/authentik @ 836aad0)
1. **Postgres replaces Redis for channels, cache, and the task queue**: pyproject.toml requires django-channels-postgres, django-postgres-cache, and django-dramatiq-postgres, each implemented as its own package under packages/. No redis dependency appears anywhere in the audited manifests, meaning a standard authentik deployment needs only PostgreSQL as external state, not PostgreSQL plus Redis.
2. **Legacy-protocol connectors run as separate Go "outpost" binaries, not the Django process**: cmd/ldap, cmd/rac, and cmd/radius (backed by go.mod dependencies beryju.io/ldap, wwt/guac for Guacamole-based remote access, and layeh.com/radius) are standalone Go outposts that proxy LDAP, RDP/VNC/SSH, and RADIUS to authentik over its API, so protocols the Python/ASGI stack does not natively speak still route through authentik without embedding them in the main app.
3. **A Rust/Axum workspace exists alongside the Python core**: Cargo.toml declares a workspace with packages/ak-axum, packages/ak-common, and packages/client-rust as members, pinned to axum 0.8.9 with HTTP/2 and websocket features. This is a separate, pinned-dependency Rust service layer distinct from both the Django backend and the Go outposts.
4. **Multi-tenancy is a first-class dependency, not an add-on**: pyproject.toml requires django-tenants==3.13.0 directly, which authentik uses to support its enterprise multi-tenant deployment mode on top of the same PostgreSQL schema-based isolation the library provides.
5. **Web UI, docs site, and backend are independently versioned projects in one repo**: web/package.json (Lit + Vite), website/package.json (Docusaurus, via packages/docusaurus-config), and the root pyproject.toml/Django app each have their own lockfiles and CI jobs (ci-web.yml, ci-docs.yml, ci-main.yml), letting frontend, documentation, and backend release independently within the monorepo.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
   - Structure as a Turborepo monorepo with strict package boundaries:
     - `apps/web`: Application UI, routing, layouts, and server endpoints.
     - `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
     - `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
     - `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
   - Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
   - Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
   - Utilize Vite 6 with TanStack Router for fully type-safe routing. Manage server state and caching via TanStack Query v5 with optimistic UI updates.
4. **Design System & Aesthetics**:
   - Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
   - Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
   - Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
   - Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (PostgreSQL, django-channels-postgres, django-postgres-cache, django-dramatiq-postgres): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.
Scaffolded something with this prompt?
Would you pick this stack for a identity provider & access management project?

Frequently asked about Authentik

What is authentik built with?

authentik is a Django (Python) application backed by PostgreSQL, with a Lit and Vite-based TypeScript web UI, standalone Go binaries ("outposts") for LDAP/RADIUS/remote-access proxying, and a Rust workspace (Axum) for additional services, all built and released together from one monorepo.

Does authentik need Redis?

No. Unlike many Django deployments, authentik replaces Redis with three in-house PostgreSQL-backed packages: django-channels-postgres for its realtime/Channels layer, django-postgres-cache for caching, and django-dramatiq-postgres for its background task queue, so the only required external datastore is PostgreSQL.

Can I self-host authentik?

Yes. The README documents Docker Compose for small or test setups, a Helm chart for Kubernetes at larger scale, and AWS CloudFormation templates (ci-aws-cfn.yml) for AWS deployments, alongside a DigitalOcean Marketplace one-click app.

Does authentik support LDAP, SAML, and RADIUS, not just OIDC?

Yes. Beyond its Django-based OAuth2/OpenID Connect provider, authentik ships separate Go outpost binaries (cmd/ldap, cmd/rac, cmd/radius) that proxy LDAP, remote desktop protocols via Apache Guacamole, and RADIUS authentication back to the core application.

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

use-this-stack.md