SelfHostStackOpen-Source Directory

Why Migrate Away from Cloudflare Zero Trust & Zscaler?

Proprietary Zero Trust Network Access (ZTNA) and VPN solutions charge recurring monthly per-seat fees that escalate as engineering teams, contractors, and field staff grow. Furthermore, routing all internal development traffic, SSH connections, and private databases through commercial corporate VPN clouds introduces latency, bandwidth throttles, and privacy concerns regarding SSL inspection. Self-hosting NetBird or Headscale creates a lightning-fast, peer-to-peer WireGuard overlay network connecting your servers, laptops, and mobile devices directly. You gain SSO identity authentication, granular network access control lists (ACLs), multi-factor routing, and kernel-speed peer-to-peer throughput without per-seat licensing.

Technical Architecture & Migration Analysis

Commercial ZTNA architectures like Cloudflare Zero Trust and Zscaler route all enterprise packets through proprietary cloud edge PoPs, decrypting and inspecting internal company traffic while enforcing per-seat pricing. In contrast, self-hosted WireGuard mesh systems (NetBird and Headscale) separate the control plane from the data plane. The coordination server only exchanges public keys and coordinates NAT traversal (STUN/ICE). Actual data traffic travels encrypted point-to-point directly between peer devices at full kernel line-speed with zero middleman inspection.

⚠️

When NOT to Migrate (When Staying on Cloudflare Zero Trust & Zscaler Makes Sense)

Self-hosting is not universally the right move. Keep paying for SaaS if your team hits any of these constraints:

  • Your compliance audit requires third-party FedRAMP/SOC2 Type II certified VPN cloud vendors.
  • You have zero IT capability to maintain a single €3.79/mo coordination server.
  • You strictly need deep packet SSL proxy inspection and DLP filtering for unmanaged public web browsing.

Real-World Cost Comparison: Cloudflare Zero Trust & Zscaler vs Self-Hosted

Comparing vendor cloud billings against standard Hetzner / DigitalOcean infrastructure costs at scale.

Tier / ScaleCloudflare Zero Trust & Zscaler CostSelf-Hosted VPS CostEstimated Annual SavingsTechnical Breakdown
Small Tech Team (20 developers & 50 devices)
20 users, 50 servers & laptops, private VPC access, SSH tunnels
$1,680–$3,600/year (Cloudflare Zero Trust Standard / Tailscale Team $7–$15/user/mo)€3.79/month (€45.48/year on Hetzner CX22)$1,634–$3,554/yearSelf-hosted NetBird or Headscale runs comfortably on a single lightweight VPS.
Growing Mid-Market Company (100 employees)
100 users, 250 connected resources, SSO/OIDC integration, subnet routers
$8,400–$18,000/year (Zscaler Private Access / Cloudflare Zero Trust Enterprise)€3.79/month (€45.48/year)$8,354–$17,954/yearUnlimited users and devices with zero license fees or bandwidth throttles.
Large Enterprise (500+ employees, Multi-Cloud VPCs)
500+ users, 1,500+ nodes across AWS, GCP, Hetzner, and On-Premise
$60,000–$120,000+/year ($10–$20/user/mo corporate ZTNA contracts)€36.47/month (High-availability dual NetBird management servers)$59,560–$119,560+/yearKernel WireGuard direct mesh performance with SSO RBAC access controls.

Top 2 Recommended Open-Source Replacements

Tested, self-contained, and production-ready. Click any tool to inspect verified docker-compose configurations, hardware sizing, and deployment guides.

NetBird

BSD-3-Clause⭐ 13.2k+

Fast, open-source WireGuard-based zero-trust overlay network with SSO authentication and granular access controls.

Min RAM512 MB
Min CPU1 vCPU
GitHub Repo ↗

✅ Advantages

  • True peer-to-peer Direct WireGuard connections: maximum bandwidth and ultra-low latency
  • Enterprise SSO identity integration out of the box with zero per-user fees
  • Dead simple client setup with one-line installer scripts

⚠️ Trade-offs / Limitations

  • Self-hosting full management suite requires configuring Coturn and OIDC identity endpoints
  • Management server requires publicly accessible domain with valid SSL certificates

Core Features

Zero-configuration peer-to-peer WireGuard mesh networking with automatic NAT traversal
Centralized web management dashboard with visual network topology and routing rules
Native IdP integration: Authentik, Keycloak, Zitadel, Azure AD, Okta, and Google Workspace
Granular Access Control Policies (ACLs) based on user groups and resource tags
Network Routing Peers: access entire private subnets (VPCs) without installing clients on every server
Multi-platform clients: Linux, macOS, Windows, iOS, Android, and Docker containers
Integrated DNS management with custom internal domain name resolution (e.g. `*.netbird.selfhost`)

Architecture Notes

Modern Go-based architecture combining kernel WireGuard tunnels with an automated STUN/TURN ICE signaling and relay engine (Coturn). Integrates directly with standard OpenID Connect (OIDC) identity providers (Authentik, Keycloak, Okta, Google Workspace) and provides a centralized management dashboard.

Known Limitations

Custom enterprise routing rules with deep packet inspection require external firewall integrations.

Official Documentation ↗
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  netbird-management:
    image: netbirdio/management:latest
    container_name: netbird-management
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "33073:33073"
    environment:
      - NETBIRD_DOMAIN=netbird.yourdomain.com
      - NETBIRD_AUTH_OIDC_CONFIGURATION_ENDPOINT=https://auth.yourdomain.com/.well-known/openid-configuration
    volumes:
      - netbird_mgmt_data:/var/lib/netbird
    networks:
      - selfhost_net

  netbird-signal:
    image: netbirdio/signal:latest
    container_name: netbird-signal
    restart: always
    ports:
      - "10000:80"
    networks:
      - selfhost_net

volumes:
  netbird_mgmt_data:

networks:
  selfhost_net:
    external: true

🚀 5-Minute Deployment Guide

  1. 1Provision a lightweight Linux VPS with a static public IP (e.g. Hetzner CX22 for €3.79/mo).
  2. 2Point a DNS record (e.g. `netbird.yourdomain.com`) to your server IP.
  3. 3Run the official NetBird self-hosted automated installer script: `curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/getting-started-with-netbird.sh | bash`.
  4. 4Configure your OIDC identity provider (Authentik or Google OAuth) for secure SSO authentication.
  5. 5Access the management dashboard at `https://netbird.yourdomain.com`.
  6. 6Install the NetBird client on your devices (`netbird up --management-url https://netbird.yourdomain.com`) and connect instantly.

Recommended Cloud VPS for NetBird

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM, 40GB NVMe)

Excellent low-latency relay and management server for 100+ connected devices.

Deploy on Hetzner →
DigitalOcean$6.00/mo

Basic Droplet (1 vCPU, 1GB RAM, 25GB SSD)

Global data centers ensure optimal STUN/TURN relay latency.

Claim $200 DO Credit →

Headscale

BSD-3-Clause⭐ 27.5k+

Open-source, self-hosted implementation of the Tailscale coordination server.

Min RAM256 MB
Min CPU1 vCPU
GitHub Repo ↗

✅ Advantages

  • Use the polished official Tailscale client apps on all devices with complete server self-sovereignty
  • Zero telemetry sent to Tailscale Inc. cloud servers
  • Extremely low resource footprint

⚠️ Trade-offs / Limitations

  • Requires separate container for web management dashboard (Headplane)
  • Manual configuration editing via YAML/HuJSON for complex ACLs

Core Features

100% compatible with official Tailscale client applications on Linux, Windows, macOS, iOS, and Android
MagicDNS: automatic private DNS names for all connected machines on your tailnet
Granular ACL HuJSON policies for micro-segmentation and port-level access rules
Exit Node routing: route all internet traffic through a trusted secure gateway
OIDC Single Sign-On (SSO) support for automated user onboarding and MFA verification
Ultra-lightweight single Go binary consuming under 50MB RAM

Architecture Notes

Lightweight, single-binary Go coordination server that manages node keys, WireGuard IP allocation (MagicDNS), and routing tables for official Tailscale clients. Compatible with SQLite and PostgreSQL databases with optional OIDC/SAML authentication.

Known Limitations

Headscale is a CLI-first coordination backend; visual web UI requires deploying a community frontend (e.g. Headscale-UI / Headplane).

Official Documentation ↗
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  headscale:
    image: headscale/headscale:latest
    container_name: headscale
    restart: always
    ports:
      - "8080:8080"
      - "9090:9090"
    volumes:
      - ./config:/etc/headscale
      - headscale_data:/var/lib/headscale
    command: headscale serve
    networks:
      - selfhost_net

  headplane-ui:
    image: ghcr.io/tale/headplane:latest
    container_name: headplane-ui
    restart: always
    ports:
      - "3000:3000"
    environment:
      - HEADSCALE_URL=http://headscale:8080
      - COOKIE_SECRET=headplane_super_secret_cookie_key_2026
    depends_on:
      - headscale
    networks:
      - selfhost_net

volumes:
  headscale_data:

networks:
  selfhost_net:
    external: true

🚀 5-Minute Deployment Guide

  1. 1Provision a $3.50/mo VPS with a static IP and public domain name.
  2. 2Create config directories: `mkdir -p /opt/headscale/config && cd /opt/headscale`.
  3. 3Download the sample `config.yaml` from Headscale repository and configure your server URL.
  4. 4Launch Headscale: `docker compose up -d`.
  5. 5Create your first user namespace: `docker exec headscale headscale users create devteam`.
  6. 6Connect any client device: `tailscale up --login-server https://headscale.yourdomain.com`.

Recommended Cloud VPS for Headscale

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM, 40GB NVMe)

Ideal coordination server for enterprise homelabs and remote developer teams.

Deploy on Hetzner →

Quick Specification Matrix

ToolLicenseMin RAMMin CPUGitHub RepoPrimary Advantage
Cloudflare Zero Trust & Zscaler (Proprietary)Proprietary ClosedManaged CloudManaged CloudN/ATurnkey onboarding with vendor lock-in & paywalls
NetBirdBSD-3-Clause512 MB1 vCPUnetbirdio/netbirdTrue peer-to-peer Direct WireGuard connections: maximum bandwidth and ultra-low latency
HeadscaleBSD-3-Clause256 MB1 vCPUjuanfont/headscaleUse the polished official Tailscale client apps on all devices with complete server self-sovereignty

Performance Benchmarks & Hard Operational Limits

Real-world operational trade-offs, resource consumption limits, and measured throughput.

Benchmark MetricCloudflare Zero Trust & Zscaler BaselineSelf-Hosted Alternative MetricOperational Bottleneck / LimitSource
Point-to-Point Throughput (Direct WireGuard)250–500 Mbps (Relayed through cloud proxy PoP)1.2–3.8 Gbps (Direct peer-to-peer kernel WireGuard)Physical network bandwidth and CPU AES/ChaCha20 acceleration.Production Test
Latency Overhead+15ms to +45ms (Triangular cloud relay path)+0ms to +2ms (Direct optimal peer routing)Physical internet routing distance.Production Test
Per-User License Cost for 100 Users$8,400 to $18,000 / year$0.00 / year (Open Source BSD-3-Clause)None.Production Test

Frequently Asked Questions

Practical deployment, migration, and maintenance answers.

Can I use the official Tailscale mobile and desktop apps with Headscale?

Yes. Headscale is fully compatible with official Tailscale clients. In the Tailscale app, you simply hold Alt/Option or click 'Change server' and point to your self-hosted Headscale domain.

How does NetBird handle peer-to-peer connections when devices are behind strict NAT firewalls?

NetBird utilizes ICE (Interactive Connectivity Establishment) and STUN/TURN protocols to automatically discover public endpoints and traverse corporate NATs. When direct connection is impossible, traffic seamlessly relays through lightweight encrypted Coturn servers.

Can I integrate NetBird or Headscale with my company Single Sign-On (Authentik, Okta, Google)?

Yes. Both NetBird and Headscale support standard OpenID Connect (OIDC). Users authenticate with their corporate SSO accounts with MFA before their devices join the mesh network.

What is a Routing Peer in NetBird?

A Routing Peer is a single NetBird node inside a private network (like an AWS VPC or office LAN) that advertises private CIDR subnets (e.g. `10.0.0.0/16`). Other devices on your mesh network can reach all machines in that subnet without installing NetBird on every server.

Is all network traffic routed through my self-hosted server?

No. The self-hosted server only handles the control plane (key distribution and network coordination). The actual encrypted data packets flow directly peer-to-peer between devices via WireGuard, ensuring maximum speed and privacy.

Starter Stack Pack — $29

Skip the setup: get the production-ready stack

Don't stitch together configs from five different READMEs. Get all 5 production-hardened Docker Compose stacks — Postgres, Redis, SSL auto-renewal, and backup scripts — ready to deploy in minutes.

n8nVisual workflow automation
📊UmamiPrivacy-first web analytics
🛡️Uptime KumaUptime monitoring & alerts
🔐VaultwardenBitwarden-compatible vault
☁️NextcloudDropbox/Drive replacement
Get the Stack Pack — $29 →

One-time purchase · Instant download · Production-ready

esc
navigate open