Skip to content

Self-host Casdoor

updated Sep 2026prices checked · Jul 2026Install verified on Ubuntu 26.04 · Sep 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →

An identity and access management server with a web admin console that exposes one user directory over OAuth 2.0, OIDC, SAML, CAS, LDAP and SCIM, with Casbin-based authorization policies. It runs as a single Go binary backed by MySQL, PostgreSQL or SQLite.

Auth0 / yr$420
Self-hosted / yr~$283
You keep$137/yr
Pocket the difference — spin it up on a cheap VPS in minutes.Start free on Kamatera → (opens in new tab)

Key facts

LicenseApache-2.0
StackGo, React
Min RAM512 MB
Official imageyes
Measured idle RAM480 MB
Difficulty

What you need

  • Any VPS with at least 512 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • Under an hour if you've used Docker before
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

Paid link — we earn a commission if you shop through it.

Install

Run these commands on your server:

# Casdoor + MySQL — standard image, configured through env vars
echo "DB_PASS=$(openssl rand -hex 16)" > .env
cat > docker-compose.yml <<'EOF'
services:
  casdoor:
    image: casbin/casdoor:4.11.0
    restart: unless-stopped
    ports: ["8000:8000"]
    environment: { driverName: mysql, dataSourceName: "root:${DB_PASS}@tcp(db:3306)/", dbName: casdoor }
    depends_on: { db: { condition: service_healthy } }
  db:
    image: mysql:8.4
    restart: unless-stopped
    environment: { MYSQL_ROOT_PASSWORD: "${DB_PASS}", MYSQL_DATABASE: casdoor }
    volumes: ["casdoor-db:/var/lib/mysql"]
    healthcheck: { test: ["CMD", "mysqladmin", "ping", "-h", "localhost"], interval: 5s, retries: 30 }
volumes: { casdoor-db: {} }
EOF
docker compose up -d  #  →  http://SERVER_IP:8000  (built-in / admin / 123 — change it)

An alternative to

More in SSO & Identity

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.