Post

Finally Got Around To Installing Tailscale

Finally Got Around To Installing Tailscale

Finally Got Around To Installing Tailscale

Introduction

After years of juggling OpenVPN configurations, firewall rules, and SSH tunnel gymnastics, I finally installed Tailscale in my homelab. Like many DevOps engineers and sysadmins, I’d postponed evaluating this modern VPN solution - but within hours of deployment, I understood why the community raves about it. This isn’t just another networking tool; it’s a paradigm shift in secure connectivity for distributed systems.

In self-hosted environments where we manage everything from Kubernetes clusters to IoT devices, traditional VPNs create operational friction. They require static IPs, complex firewall rules, certificate management, and constant maintenance. Tailscale eliminates these pain points through WireGuard-based mesh networking with automatic NAT traversal, zero-config encryption, and seamless cross-platform connectivity.

This comprehensive guide will show experienced infrastructure professionals:

  • How Tailscale’s zero-trust architecture simplifies secure networking
  • Practical deployment strategies for mixed environments
  • Advanced ACL configuration surpassing traditional reverse proxies
  • Integration with existing infrastructure (Docker, Kubernetes, bare metal)
  • Security hardening tailored for production use

By the end, you’ll understand why one Reddit user exclaimed “tailscale is freaking awesome” while another questioned “whatever happened to reverse proxies?” - and why the answer matters for modern infrastructure.

Understanding Tailscale

What is Tailscale?

Tailscale is a zero-config VPN alternative built on WireGuard that creates secure mesh networks between devices using end-to-end encryption. Unlike traditional VPNs that route traffic through central servers, Tailscale establishes direct peer-to-peer connections whenever possible, falling back to relay servers only when necessary.

Key technical components:

  1. WireGuard Foundation: Leverages the Linux kernel’s WireGuard implementation for high-performance encryption
  2. DERP Protocol: Uses Distributed Encrypted Relay Protocol for NAT traversal
  3. Control Plane: Coordinates authentication and peer discovery via Tailscale-operated coordination servers (client connections remain P2P)
  4. MagicDNS: Provides automatic DNS resolution for Tailscale nodes

Historical Context

  • 2019: Founded by former Google and Microsoft engineers
  • 2020: Initial release based on WireGuard (RFC 8446)
  • 2022: Introduced Tailscale SSH and Funnel features
  • 2023: Added support for hardware keys and enterprise SSO integrations

Why DevOps Engineers Care

Compared to traditional solutions:

FeatureOpenVPNWireGuard ManualTailscale
Setup Time30+ minutes15+ minutes2 minutes
NAT TraversalManual configSTUN requiredAutomatic
Cross-Platform AuthCertificate hellKey managementOAuth/SSO/Magic
Access ControlsIP-basedIP-basedIdentity-based ACLs
Peer DiscoveryStatic configManual exchangeAutomatic
Encryption OverheadHigh (TLS)Low (WireGuard)Low (WireGuard)

Real-World Use Cases

  1. Secure Kubernetes Access: Replace kubectl port-forward with direct cluster access
  2. Hybrid Cloud Networking: Connect AWS VPCs to on-prem servers without VPC peering
  3. IoT Management: Securely access Raspberry Pis behind carrier-grade NAT
  4. Developer Environments: Share preview environments without public exposure
  5. Replace Jump Hosts: Direct SSH access without bastion hosts

Prerequisites

System Requirements

  • Supported OS:
    • Linux (kernel 5.6+ for WireGuard in-kernel support)
    • Windows 10/11
    • macOS 10.13+
    • iOS 14+, Android 8+
    • BSD (limited features)
  • Networking:
    • Outbound UDP port 41641 (DERP)
    • ICMP (for latency measurements)
  • Permissions:
    • Root/sudo access for installation
    • CAP_NET_ADMIN capability on Linux

Pre-Installation Checklist

  1. Verify kernel version:
    1
    
    uname -r  # Minimum 5.6 for best performance
    
  2. Check WireGuard module:
    1
    2
    
    sudo modprobe wireguard
    lsmod | grep wireguard
    
  3. Update package repositories:
    1
    2
    
    sudo apt update && sudo apt upgrade -y  # Debian/Ubuntu
    sudo dnf update -y  # RHEL/Fedora
    
  4. Prepare firewall (temporary disable for testing):
    1
    2
    
    sudo ufw disable  # Ubuntu
    sudo systemctl stop firewalld  # CentOS
    

Installation & Setup

Linux Installation (Debian/Ubuntu)

  1. Add Tailscale repository:
    1
    2
    
    curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.gpg | sudo apt-key add -
    curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.list | sudo tee /etc/apt/sources.list.d/tailscale.list
    
  2. Install package:
    1
    
    sudo apt update && sudo apt install tailscale
    
  3. Start and authenticate:
    1
    
    sudo tailscale up
    

    This prints an authentication URL - open it in any browser to add the device to your network.

Docker Deployment

For containerized workloads:

1
2
3
4
5
docker run -d --name=tailscale \
  --cap-add=NET_ADMIN \
  --cap-add=NET_RAW \
  --volume=/var/lib/tailscale:/var/lib/tailscale \
  tailscale/tailscale:latest

Authenticate the container:

1
docker exec -it $CONTAINER_ID tailscale up

Kubernetes Integration

Deploy Tailscale as a sidecar:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: main-app
        image: nginx:alpine
      - name: tailscale
        image: tailscale/tailscale:latest
        securityContext:
          capabilities:
            add: ["NET_ADMIN", "NET_RAW"]
        volumeMounts:
        - name: tailscale-state
          mountPath: /var/lib/tailscale
      volumes:
      - name: tailscale-state
        emptyDir: {}

Verification Steps

  1. Check node status:
    1
    
    tailscale status
    

    Example output:

    1
    2
    
    100.101.102.103   my-server      linux   -
    100.105.106.107   my-laptop      macOS   active
    
  2. Test connectivity:
    1
    
    tailscale ping my-laptop
    
  3. Verify encryption:
    1
    
    sudo wg show
    

    Should show active WireGuard peers with data transfer.

Configuration & Optimization

ACL Configuration

Create /etc/tailscale/acl.json for granular control:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "ACL": [
    {
      "Action": "accept",
      "Users": ["user@example.com"],
      "Ports": ["tag:database:5432"]
    },
    {
      "Action": "deny",
      "Users": ["*"],
      "Ports": ["*:*"]
    }
  ],
  "TagOwners": {
    "tag:database": ["user@example.com"]
  }
}

Key ACL features:

  • User/group-based rules instead of IP whitelists
  • Service tagging for logical grouping
  • Automatic HTTPS certificate provisioning
  • SSH policy enforcement

Security Hardening

  1. Enable MFA on your authentication provider (Google, GitHub, etc.)
  2. Use key expiry (default 180 days):
    1
    
    tailscale up --ssh --operator=user@example.com --key-expiry 86400
    
  3. Enable exit node isolation:
    1
    
    sudo tailscale up --advertise-exit-node --isolate
    
  4. Disable key rotation:
    1
    
    sudo tailscale up --reset --force-reauth
    

Performance Tuning

  1. Prefer direct connections:
    1
    
    tailscale ping --derp=false 100.105.106.107
    
  2. Force DERP region:
    1
    
    tailscale up --derp=us
    
  3. Monitor relays:
    1
    
    tailscale netcheck
    
  4. Adjust MTU for problematic networks:
    1
    
    tailscale up --mtu=1280
    

Usage & Operations

Common Commands

| Task | Command | |—————————|———————————-| | View network status | tailscale status | | SSH to node | tailscale ssh user@host | | Share node temporarily | tailscale share user@host | | Serve web content | tailscale serve / /var/www/html | | Debug packet loss | tailscale ping -c 100 host |

Backup Strategy

Critical components to back up:

  1. ACL policies
  2. Tailscale auth keys
  3. MagicDNS configuration
  4. Device approval lists

Export node list:

1
tailscale status --json > tailscale-nodes-$(date +%F).json

Monitoring

  1. Built-in metrics:
    1
    
    tailscale debug --metrics
    
  2. Prometheus integration: ```yaml
    • job_name: ‘tailscale’ static_configs:
      • targets: [‘localhost:9256’] ```
  3. Key metrics to track:
    • tailscale_peer_live (connection status)
    • tailscale_peer_rx_bytes (throughput)
    • tailscale_dns_queries (DNS resolution)

Troubleshooting

Common Issues

Problem: Nodes show as offline but are running
Fix:

1
2
sudo systemctl restart tailscaled
tailscale up --reset

Problem: High latency between peers
Debug:

1
2
tailscale netcheck
mtr -u -P 41641 100.101.102.103

Problem: ACL rules not applying
Verify:

1
2
tailscale debug prefs
tailscale debug validate /etc/tailscale/acl.json

Log Analysis

Enable verbose logging:

1
sudo tailscaled --verbose=1

Key log locations:

  • Linux: journalctl -u tailscaled
  • macOS: log stream --predicate 'process == "tailscaled"'
  • Windows: Event Viewer > Applications and Services Logs > Tailscale

Where to Get Help

  1. Official Tailscale Docs
  2. Community Forum
  3. WireGuard Technical Papers

Conclusion

After deploying Tailscale across my infrastructure - from Kubernetes clusters to IoT devices - I understand why DevOps teams are rapidly adopting it. It solves fundamental networking challenges:

  1. Eliminates VPN sprawl: One mesh replaces OpenVPN, IPSec, and SSH tunnels
  2. Simplifies security: WireGuard encryption + zero-trust ACLs > traditional firewalls
  3. Reduces operational overhead: Automatic NAT traversal and peer discovery

While reverse proxies still have their place for public-facing services, Tailscale excels at private service-to-service communication. For internal tools, database access, and administrative interfaces, it provides superior security without certificate management hell.

Next steps for advanced users:

For further learning:

In an era of distributed systems and remote work, Tailscale delivers what traditional VPNs promised but never achieved: secure, painless connectivity that “just works”. It’s not just a tool - it’s infrastructure simplification distilled into a single binary.

This post is licensed under CC BY 4.0 by the author.