Cómo instalar Authentik en Docker - SSO/IdP moderna autohospedada
Authentik en Docker: Identity Provider (IdP) moderna autohospedada con SSO (SAML, OAuth2, OIDC, LDAP, RADIUS), reemplazo Okta/Auth0/Entra/Ping, reverse proxy integrado, multi-tenant, blueprints, flows, autenticación flexible, auditing, 24.7k stars, MIT open source, Kubernetes ready, production-scale 🔐🆔
Authentik es un Identity Provider (IdP) open source moderno para SSO (Single Sign-On) autohospedado. Reemplazo profesional Okta, Auth0, Entra ID, Ping Identity. Soporta SAML, OAuth2/OIDC, LDAP, RADIUS. Reverse proxy integrado (proxy outpost). Multi-tenant architecture. Blueprints (automation). Flows (auth logic). Access policies. Auditing completo. Scalable Docker + Kubernetes. 24.7k GitHub stars. MIT open source. Enterprise edition disponible. Production-ready.
¿Qué es Authentik en Docker?
Authentik es un Identity Provider (IdP) open source moderno que proporciona SSO (Single Sign-On) profesional autohospedado compatible SAML, OAuth2/OIDC, LDAP, RADIUS, con arquitectura multi-tenant, flows visuales para lógica autenticación, access policies, blueprints (automations), reverse proxy integrado (outpost), auditing completo, escalable Docker/Kubernetes, todo bajo tu control sin vendor lock-in. El reemplazo Okta/Auth0/Entra que pedías para autohospedado.
Propuesta clave: Open-source IdP self-hosted. Replace Okta, Auth0, Entra ID, Ping Identity. SAML 2.0 protocol (enterprise). OAuth2/OIDC (modern). LDAP directory sync. RADIUS server. Multi-protocol single source-of-truth. Reverse proxy outpost (proxy any app via authentik). Multi-tenant (multiple organizations). Visual flow editor (drag-drop auth logic). Access policies (conditional auth, MFA, risk-based). Blueprints (automation, bulk config). User management (local + directory sync). Group management. Applications directory (pre-configured integrations). Social login (GitHub, Google, Apple, Discord, etc). MFA support (TOTP, backup codes, WebAuthn). Password policy. Session management. Audit logging (all events tracked). API REST + webhooks. Rate limiting. RBAC. Kubernetes-native. Docker Compose + Helm chart. PostgreSQL backend. Redis for caching/sessions. Enterprise edition (features avanzadas). 24.7k stars. Active development. 23.6k commits. MIT licensed (core) + commercial support available.
Características principales
Multi-protocolo SSO
SAML 2.0, OAuth2, OIDC, LDAP, RADIUS. Un IdP para todo.
Reverse proxy integrado
Outpost proxy. Protege cualquier app legacy. Sin cambios código.
Multi-tenant
Múltiples organizations en instalación. Branding customizable.
Visual flow editor
Drag-drop auth logic. Conditional, MFA, risk-based. No código.
Access policies
Conditional auth. Geo-blocking. Device trust. MFA enforcement.
Blueprints
Automation, bulk config, IaC. YAML-based deployment.
Directory sync
LDAP, Active Directory, Google Workspace sync. Users + groups.
Social login
GitHub, Google, Apple, Discord, OIDC providers custom.
MFA + WebAuthn
TOTP, backup codes, WebAuthn (FIDO2). Security modern.
Audit logging
Todos events tracked. User actions, auth, policy changes.
App library
500+ pre-configured app integrations. Instant SSO setup.
Kubernetes-native
Helm chart oficial. Scalable. Cloud-ready. Production.
Requisitos del sistema
- Docker & Docker Compose v2+
- 2 GB - 4 GB RAM mínimo (Python + Go app)
- 10 GB - 50+ GB espacio disco (según users, audit logs)
- Puerto TCP: 9000 (web UI), 9300 (LDAP outpost), 9400 (RADIUS outpost)
- PostgreSQL 14+ (bundled o externo)
- Redis (sessions, caching, optional pero recomendado)
- Python 3.11+ (bundled en imagen)
- Go 1.20+ (outpost proxy, bundled)
- Opcional: LDAP/AD servidor para directory sync
- Opcional: External PostgreSQL (para HA production)
Instalación con Docker Compose
Paso 1: docker-compose.yml
Paso 2: Generar SECRET_KEY
Paso 3: Iniciar Authentik
Acceder a Authentik
🔐 Authentik Admin UI: http://localhost:9000
🆔 Authentik Login: http://localhost:9000/auth/login/
Setup inicial (primer acceso)
- Abre
http://localhost:9000 - Setup wizard automático → crea admin user
- Ingresa email + password admin
- Dashboard admin aparece
- Configura LDAP sync (opcional), social logins, apps
- ¡Listo SSO!
http://192.168.1.100:9000Para obtener tu IP:
hostname -I
Primeros pasos
1. Admin login
- Abre
http://localhost:9000 - Click "Administration" → login con admin credentials
- Dashboard admin abre
2. Crear usuarios
- Admin → Users → Create user
- Ingresa username, email, password
- Asigna groups si necesario
- Save → usuario puede loguear
3. Setup app SAML/OAuth2
- Admin → Applications → Create application
- Nombre app, selecciona provider (SAML, OAuth2, OIDC)
- Configure redirect URIs (app callback URL)
- Client ID/Secret generado automático
- App lista para SSO
4. Setup reverse proxy outpost
- Admin → Infrastructure → Outposts → Create
- Type: Proxy outpost
- Configure forwarding (app interno, auth realm)
- Outpost auto-configura reverse proxy
- Acceso app protegido Authentik
5. Setup LDAP directory sync (opcional)
- Admin → Directory Sync → LDAP
- Configure LDAP server connection
- Map usuario + groups
- Enable sync → auto-sync usuarios
6. Setup social login (opcional)
- Admin → Sources → Create
- Type: GitHub, Google, etc
- Configure OAuth app credentials
- Users pueden loguear via social
7. Crear flow personalizado (avanzado)
- Admin → Flows & Stages → Create Flow
- Drag-drop stages (login form, MFA, policy check)
- Lógica autenticación customizable
- Asigna a applications/providers
Casos de uso
- Reemplazo Okta/Auth0: SSO enterprise self-hosted. Multi-protocolo. No vendor lock-in.
- Proteger apps legacy: Reverse proxy outpost. Agrega SSO sin cambios código.
- Homelabs multi-usuario: Gestión usuarios + SSO. Apps protegidas.
- LDAP/AD integration: Sync usuarios Active Directory. Access control integrado.
- Multi-tenant SaaS: Blueprints. Organizations separadas. Branding custom.
- Zero-trust security: Access policies condicionales. Risk-based auth. MFA.
Protocolos soportados
SAML 2.0
Enterprise standard. IdP-initiated, SP-initiated. Assertions encriptadas. Ideal legacy apps, Salesforce, Microsoft apps.
OAuth2 + OIDC
Modern standard. Authorization Code, Implicit, Client Credentials. ID token (OIDC). Bearer token. Web apps, SPA, mobile.
LDAP
Directory protocol. LDAP server functionality. Autenticación contra Authentik. No solo sync.
RADIUS
Network auth. VPN, wireless networks. RADIUS server Authentik.
Social/OIDC providers
GitHub, Google, Apple, Discord, generic OIDC. Social login integrado.
Gestión y mantenimiento
Ver estado
Ver logs
Detener Authentik
Actualizar versión
Backup database
Restore database
Monitorear consumo
Stack técnico
- Backend: Python 3.11 (Django + DRF)
- Frontend: TypeScript + Lit Web Components
- Outpost proxy: Go (high performance)
- Database: PostgreSQL 14+
- Cache/Sessions: Redis
- Protocols: SAML 2.0, OAuth2, OIDC, LDAP, RADIUS
- API: REST + GraphQL (enterprise)
- Deployment: Docker Compose, Kubernetes (Helm), AWS CloudFormation
- Licencia: MIT (core) + Enterprise edition
Comparativa con alternativas
vs Okta (cloud)
Authentik gana: Self-hosted, open source, mucho más barato, full control. Okta gana: Managed service, UI pulida, features premium, support 24/7.
vs Keycloak
Authentik gana: Mejor UX, reverse proxy integrado (outpost), flows visuales más intuitivos. Keycloak gana: Más maduro, comunidad más grande, más configuración.
vs Supabase Auth
Authentik gana: Multi-protocolo, LDAP/AD, más features enterprise. Supabase gana: Más simple para pequeños proyectos.
Comentarios
Publicar un comentario