How to Self-Host Authentik Identity Provider on Contabo VPS: Free Okta Alternative
Contabo High-Performance Cloud VPS
Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.
Tired of managing separate user accounts across dozens of self-hosted apps? Learn how to deploy Authentik SSO on a Contabo VPS with Docker and OAuth2/OIDC.
- Unified Single Sign-On (SSO) with Multi-Factor Authentication (MFA) across all team applications
- Native support for OAuth2, OpenID Connect (OIDC), SAML 2.0, and LDAP proxy authentication
- Contabo Cloud VPS 2 ($11.50/mo for 16GB RAM) handles enterprise user directories and token exchanges effortlessly
The Sprawl of Fractured User Credentials
As organizations and technical teams expand their self-hosted infrastructure—deploying Portainer, Nextcloud, Grafana, GitLab, Vaultwarden, and Proxmox—managing individual user logins becomes chaotic. Revoking an ex-employee's access across 15 separate platforms is error-prone, leaving critical security vulnerabilities open.
Commercial Identity and Access Management (IAM) solutions like Okta or Auth0 charge steep per-user monthly fees ($3 to $15/user/month) that become cost-prohibitive for growing teams. Authentik is a modern, open-source Identity Provider that gives you complete control over authentication flows, passwordless WebAuthn/Passkeys, and centralized SSO. Deploying Authentik on a Contabo Cloud VPS 2 ($11.50/mo for 16GB RAM) delivers an enterprise-grade IAM system for pennies.
Step 1: Docker Foundation on Contabo VPS
Connect to your Contabo VPS via SSH and install Docker Engine:
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
apt install -y curl ufw git pwgen
curl -fsSL https://get.docker.com | sh
systemctl enable --now docker
Step 2: Generate Cryptographic Secret Keys
Create a dedicated folder for Authentik and generate strong cryptographic secrets:
mkdir -p /opt/authentik && cd /opt/authentik
wget -O docker-compose.yml https://goauthentik.io/docker-compose.yml
Generate secure random passwords for PostgreSQL and the Authentik encryption secret:
echo "PG_PASS=$(pwgen -s 40 1)" >> .env
echo "AUTHENTIK_SECRET_KEY=$(pwgen -s 50 1)" >> .env
echo "AUTHENTIK_ERROR_REPORTING__ENABLED=false" >> .env
echo "AUTHENTIK_PORT_HTTP=9000" >> .env
echo "AUTHENTIK_PORT_HTTPS=9443" >> .env
Step 3: Launching the Authentik Stack
Start the container cluster (Authentik server, background worker, PostgreSQL 16, and Redis):
docker compose up -d
docker compose ps
Step 4: Nginx Reverse Proxy with Let's Encrypt SSL
Browser security and modern OAuth2 specifications mandate trusted HTTPS connections. Configure Nginx to reverse proxy traffic from auth.yourdomain.com to internal port 9000:
sudo apt install -y nginx certbot python3-certbot-nginx
cat << 'EOF' > /etc/nginx/sites-available/authentik.conf
server {
server_name auth.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:9000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
EOF
ln -s /etc/nginx/sites-available/authentik.conf /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
certbot --nginx -d auth.yourdomain.com --non-interactive --agree-tos -m admin@yourdomain.com
Step 5: Initial Onboarding & Administrator Setup
Navigate to https://auth.yourdomain.com/if/flow/initial-setup/ in your browser. This unique onboarding URL lets you set the master administrator password for the akadmin superuser account.
Step 6: Connecting an Application via OpenID Connect (OIDC)
Connecting third-party apps like Portainer or Nextcloud takes just 3 steps in Authentik:
- Create a Provider: Under Applications > Providers, click Create and select OAuth2/OpenID Provider. Specify your client redirect URI (e.g.,
https://portainer.yourdomain.com/oauth). - Create an Application: Under Applications > Applications, assign your new Provider to a user-facing Application card with an icon and access policies.
- Configure Client App: Copy the generated Client ID, Client Secret, and Authentik metadata endpoint URL (
https://auth.yourdomain.com/application/o/portainer/.well-known/openid-configuration) into your client application.
Now, whenever your team accesses Portainer, they click "Login with Authentik", authenticate with a single secure passkey, and access all services without typing individual passwords.
Recommended Reading & Related Guides
Frequently Asked Questions (FAQ)
How much RAM does Authentik require on a Contabo VPS?
Authentik's server, worker, PostgreSQL, and Redis containers typically consume 700 MB to 1.2 GB of RAM, running smoothly on a Contabo Cloud VPS 1 or Hostinger KVM 2.
Summary
Self-hosting Authentik on a Contabo Cloud VPS centralizes user security, enforces hardware MFA/WebAuthn across all self-hosted apps, and eliminates expensive identity SaaS fees forever.
Video Walkthrough & Official References
Linux Server Security Tutorial: SSH, UFW Firewall & Fail2ban • DevOps Made Simple
Editorial Verdict: Pros & Cons
What We Love (Pros)
- Unified Single Sign-On (SSO) with Multi-Factor Authentication (MFA) across all team applications
- Native support for OAuth2, OpenID Connect (OIDC), SAML 2.0, and LDAP proxy authentication
- Contabo Cloud VPS 2 ($11.50/mo for 16GB RAM) handles enterprise user directories and token exchanges effortlessly
Drawbacks (Cons)
- Authentik runs multiple microservices (worker, server, Redis, PostgreSQL), requiring at least 4GB of RAM
Deploy Your Contabo Cloud Server
Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.
Written by Alex Vance
Cloud Infrastructure Architect
Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.
Recommended Next Reads
How to Deploy Docker & Docker Compose on Contabo VPS (Production Ready)
A complete guide to installing Docker Engine 26 and Docker Compose on Contabo Ubuntu 24.04 VPS. Includes Docker daemon tuning, UFW firewall integration, and a Traefik reverse proxy demo.
How to Deploy Appwrite on Contabo VPS with Docker: Complete Self-Hosted Backend-as-a-Service
Build scalable mobile and web apps without vendor lock-in. Learn how to deploy self-hosted Appwrite BaaS on a Contabo Cloud VPS with Docker, SSL, and automated backups.
How to Self-Host Paperless-ngx on Contabo Storage VPS: Private OCR Digital Document Archive
Transform filing cabinets into a searchable digital archive. Learn how to deploy Paperless-ngx with automated OCR, Tesseract, and Docker on a Contabo Storage VPS.