Gallery project

๐Ÿ—๏ธ Headscale: self-host the control plane

Run your own coordinator. Same Tailscale clients, your server. Zero dependence on Tailscale Inc.

Gallery Security Advanced Weekend Prereqs: M5 (Ops & security)

Why this project

Tailscale's free tier is generous and the company's reliability is excellent. But for some users, depending on a third-party control plane is a non-starter โ€” research environments with data sovereignty rules, communities that want a fully open-source stack, or operators who've simply outgrown the free tier's 100-device limit. Headscale is an open-source reimplementation of Tailscale's coordination server. The standard Tailscale clients on your devices keep working unchanged; they just point at your server instead of login.tailscale.com.

Who this helps

What you get

CONTROL PLANE DEVICES DATA PLANE ๐Ÿ—๏ธ Headscale (your VPS)replaces login.tailscale.comhttps://headscale.example.com ๐Ÿ’ป standard Tailscale--login-server=https://headscale.example.com ๐Ÿ“ฑ same clientunmodifiedjust retargeted ๐Ÿ–ฅ๏ธ headless serverpreauthkey fromheadscale preauthkeys ๐Ÿ”’ WireGuard peer-to-peerunchanged from regular Tailscaleno Tailscale Inc. infrastructure in the path

Headscale replaces only the control plane โ€” coordination, auth, ACL distribution. The Tailscale clients on your devices are unmodified; they just point at your server. WireGuard peer-to-peer underneath stays exactly the same.

Prerequisites

Steps

Provision a server ~10 min

You need an always-on machine with a publicly resolvable hostname (Headscale needs to be reachable for clients to connect). Options:

  • $5/mo VPS (DigitalOcean, Hetzner, Linode) โ€” easiest
  • A home server with a domain pointed at a dynamic DNS provider
  • An existing self-hosting VM

Get a real DNS name and Let's Encrypt cert (e.g. headscale.example.com).

Install Headscale ~30 min

Follow the official install: headscale.net/setup/install. Available as Docker, .deb, .rpm, or source build.

Configure /etc/headscale/config.yaml:

server_url: https://headscale.example.com
listen_addr: 0.0.0.0:8080
private_key_path: /var/lib/headscale/private.key
db_type: sqlite3
db_path: /var/lib/headscale/db.sqlite
acl_policy_path: /etc/headscale/acl.hujson

Run as a systemd service. Reverse-proxy through Caddy for TLS.

Create a user and key ~5 min

headscale users create me
headscale --user me preauthkeys create --reusable --expiration 24h

Point a Tailscale client at Headscale ~3 min

sudo tailscale up \
  --login-server=https://headscale.example.com \
  --auth-key=<preauthkey from headscale>

The device registers against Headscale, joins the tailnet, gets an IP from the configured range, and starts working.

Write your ACLs ~30 min

Headscale supports a HuJSON ACL format very similar to Tailscale's โ€” same groups, tagOwners, acls structure. Save as /etc/headscale/acl.hujson, restart Headscale.

Optional: web admin UI ~30 min

Headscale's CLI is the canonical interface. Third-party web UIs exist:

Maturity varies. Read recent commits and issues before committing to one.

Verify

Common issues

Caveats

Where this leads