Tailscale transformed remote access by turning complex WireGuard point-to-point tunnels into an effortless peer-to-peer mesh. Yet for privacy-conscious engineers, homelab operators, and compliance-bound organizations, routing coordination telemetry through a centralized third-party SaaS platform remains an unacceptable architectural compromise. Tailscale’s SaaS tier also imposes device ceilings and per-user pricing for advanced access control lists (ACLs).
Enter Headscale: an open-source, self-hosted implementation of the Tailscale control server written in Go. By decoupling the coordination plane from Tailscale Inc.’s cloud infrastructure, Headscale allows you to run your own zero-trust overlay network while utilizing the polished, battery-efficient official Tailscale client applications across Linux, macOS, Windows, iOS, and Android. Understanding the operational tradeoffs between SaaS Tailscale and self-hosted Headscale in 2026 is critical before migrating your infrastructure.
What Is the Difference Between Headscale and Tailscale?
In both architectures, actual network traffic travels end-to-end between peer devices encrypted with modern WireGuard primitives (ChaCha20-Poly1305). Neither Tailscale’s SaaS servers nor your self-hosted Headscale server ever inspects, decrypts, or relays your payload data during ordinary peer-to-peer communication.
The distinction lies entirely in the coordination control plane:
- Device Authentication & Key Exchange: When a client joins the tailnet, the control server authenticates the device, generates cryptographic node keys, and distributes peer public keys and assigned IP addresses across all active nodes.
- Access Control Enforcement: The control server compiles security rules (ACLs) and pushes filtering tables down to each node’s local packet filter.
- NAT Traversal Facilitation: The control server coordinates STUN (Session Traversal Utilities for NAT) discovery to help nodes map external UDP endpoints and negotiate direct peer-to-peer tunnels.
By hosting Headscale on your own Linux VPS or bare-metal server, you retain 100% control over node registration logs, internal DNS records (MagicDNS), user directories, and network routing policies.
| Feature / Architecture | Tailscale (Commercial SaaS) | Headscale (Self-Hosted Linux/Docker) |
|---|---|---|
| Control Plane Ownership | Hosted by Tailscale Inc. (AWS/Multi-Cloud) | Self-hosted bare-metal, VPS, or Docker container |
| Device & User Limits | 100 devices / 3 users on Free Tier (Paid beyond) | Unlimited nodes, users, and subnets (Zero license fees) |
| Official Client Compatibility | Native out-of-the-box | 100% compatible via --login-server flag |
| DERP Relay Infrastructure | Global high-bandwidth CDN relays managed by Tailscale | Must self-host DERP nodes or rely on public Tailscale relays |
| Identity Provider (IdP) SSO | Google, Microsoft, GitHub, Okta (Enterprise tier) | Native OIDC (Authentik, Keycloak, Authelia, Kanidm) |
| Web Administration UI | Official polished web dashboard | CLI native; optional Headscale-UI / Headplane web interface |
| Tailscale Funnel / Public Ingress | Built-in SaaS feature | Not supported natively (Use Cloudflare Tunnels or Rathole) |
How Does Headscale Route WireGuard Traffic Without Tailscale Servers?
When two machines on a tailnet attempt to communicate, they query Headscale over HTTPS to fetch each other’s current public IP endpoints. If both nodes sit behind standard home NAT routers (Full Cone or Restricted Cone NAT), they successfully perform UDP hole punching, establishing a zero-latency direct WireGuard connection.
However, when one or both nodes are behind Symmetric NAT (common on 5G mobile networks, university Wi-Fi, and corporate environments), UDP port mapping becomes unpredictable. In this scenario, direct hole punching fails. Tailscale solves this through DERP relays—specialized HTTPS packet forwarders that relay end-to-end encrypted WireGuard packets.
While Headscale clients can be configured to use Tailscale’s public DERP servers, doing so reintroduces a third-party dependency. In 2026, high-availability self-hosted architectures configure an embedded or standalone private DERP server on an inexpensive external VPS. This guarantees sub-50ms relay latency and eliminates reliance on commercial infrastructure.
Deploying Headscale on Docker with Custom DERP Relays & Authentik SSO in 2026
Deploying Headscale via Docker Compose provides isolated runtime sandboxing and effortless automated updates. Below is the production-tested stack configuration for Headscale integrated with Authentik OIDC authentication and TLS termination.
# /opt/headscale/docker-compose.yml
services:
headscale:
image: juanfont/headscale:v0.25.0
container_name: headscale
restart: unless-stopped
volumes:
- ./config:/etc/headscale
- ./data:/var/lib/headscale
ports:
- "8080:8080"
- "9087:9087"
- "3478:3478/udp" # STUN port
environment:
- TZ=UTC
command: headscale serve
headscale-ui:
image: ghcr.io/tale/headplane:latest
container_name: headplane
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./config/config.yaml:/etc/headscale/config.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- COOKIE_SECRET=generate_a_random_32_char_secret_here
- HEADSCALE_URL=http://headscale:8080
Key configuration directives inside /opt/headscale/config/config.yaml must be customized before starting the daemon:
server_url: https://headscale.example.com
listen_addr: 0.0.0.0:8080
metrics_listen_addr: 0.0.0.0:9087
ip_prefixes:
- fd7a:115c:a1e0::/48
- 100.64.0.0/10
derp:
server:
enabled: true
region_id: 999
region_code: "custom-homelab"
region_name: "Self-Hosted Private DERP"
stun_listen_addr: "0.0.0.0:3478"
urls:
- https://controlplane.tailscale.com/derpmap/default
auto_update_enabled: true
update_frequency: 24h
oidc:
only_start_if_oidc_is_available: true
issuer: "https://authentik.example.com/application/o/headscale/"
client_id: "headscale-client-id"
client_secret: "headscale-client-secret-token"
scope: ["openid", "profile", "email"]
extra_params:
domain_hint: example.com
allowed_domains:
- example.com
Connecting Official Tailscale Clients to a Self-Hosted Headscale Instance
tailscale up --login-server https://headscale.example.com. On iOS and Android mobile clients, tap the settings menu three times to reveal the hidden “Alternate Server” input field and paste your domain URL.For headless Linux servers and homelab Proxmox nodes, authentication can be completely automated using pre-authenticated keys generated via the Headscale CLI:
# On the Headscale host: Generate a reusable 90-day pre-auth key for homelab nodes
docker exec headscale headscale preauthkeys create -u homelab -e 2160h --reusable
# On the client node (Ubuntu / Proxmox VE / Arch):
tailscale up --login-server https://headscale.example.com --authkey 98f4c129e81b37fa098234 --advertise-routes=192.168.1.0/24 --accept-routes --reset
Once registered, verify that the node is active and inspecting routes:
# Inspect node registration status
docker exec headscale headscale nodes list
# Enable advertised subnet routes for the node
docker exec headscale headscale routes enable -r 1
Where to Expand Your Network Architecture Next
Building a sovereign, zero-trust remote access architecture requires interconnecting your control plane with hardened transport layers and micro-segmented hypervisors:
- Compare remote edge exposure strategies in our comprehensive guide to Cloudflare Tunnels vs. Tailscale Subnet Routers in 2026.
- Isolate virtual networks across your Proxmox cluster with Proxmox SDN: EVPN-VXLAN & VNet Micro-Segmentation Architecture.
- Accelerate clustered flash storage across your private overlay network using Proxmox VE NVMe-over-TCP (NVMe-oF) High-Throughput Storage Targets.
People Also Ask
Can I use the official Tailscale mobile apps with Headscale?
Yes. The official Tailscale iOS and Android applications fully support self-hosted Headscale servers. In the mobile app, tap the three-dot menu on the login screen, select “Accounts”, tap the menu icon multiple times to unlock the hidden server configuration modal, and enter your Headscale server URL.
Does Headscale support Tailscale Funnel or Tailscale SSH?
Headscale supports Tailscale SSH natively, allowing you to manage SSH session authentication via central ACL rules. However, Tailscale Funnel (which exposes internal ports to the public internet via Tailscale’s edge proxies) requires Tailscale’s proprietary cloud routing infrastructure and is not available in Headscale. Use self-hosted Cloudflare Tunnels, Rathole, or a reverse proxy with Let’s Encrypt for public ingress.
How many devices can Headscale handle on a single virtual server?
Because Headscale handles only control plane signaling and cryptographic exchange (not data routing), a modest $5/month Linux VPS with 1 vCPU and 1GB of RAM can comfortably manage several thousand active WireGuard nodes with negligible CPU utilization.
For engineers evaluating self-hosted coordination servers without vendor cloud lock-in, read our benchmark of Cloudflare Tunnel vs. Tailscale: Remote Access Guide.

