This project uses Caddy as a reverse proxy with OIDC authentication and Headscale as a self-hosted coordination server. Caddy and Headscale are both run using Docker Compose.
Before you begin, make sure you have the following tools installed:
- Docker
- Docker Compose
- Cloudflare API Token
- This configuration is uing Cloudflare TLS Challenge and assumes DNS is managed at Cloudflare
- Ensure DNS A/AAAA record is setup and pointing at your server's public IP address
- Caddy (Optional: only needed to generate hash password for basic auth)
Start by cloning this repository to your local machine:
git clone https://github.com/Black-Relay/caddy-headscale.git
cd caddy-headscaleCreate a password for headscale-ui
caddy hash-password --plaintext "your-password"Copy the .env.example file in the root of the project and populate
cp .env.example .envdocker network create caddy_networkUpdate the following paramaters within the headscale/container-config/config.yaml:
FQDN of your Headscale Server
- server_url: https://DOMAIN_NAME
If using OIDC (below is a Microsoft EntraID example)
- issuer: "https://login.microsoftonline.com//v2.0"
- client_secret: "SECRET"
- client_id: "CLIENT_ID"
docker compose up -d