Tailscale on Raspberry Pi

Tailscale is a modern mesh VPN service built on the WireGuard protocol that securely connects devices into a private network (called a tailnet) without complex configuration. Unlike traditional VPNs that route all traffic through a central server, Tailscale establishes encrypted peer‑to‑peer connections directly between devices, reducing latency and bottlenecks.

🔍 What Tailscale Does

🚀 Docker Installation Steps

  1. Update your system
    sudo apt update && sudo apt upgrade -y
  2. Install Docker
    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh get-docker.sh
  3. Install Docker Compose
    sudo apt install docker-compose-plugin
  4. Add your user to the Docker group
    sudo usermod -aG docker $USER
  5. Enable Docker at boot
    sudo systemctl enable docker
  6. Reboot
    sudo reboot
  7. Test Docker
    docker run hello-world

📁 Setup Tailscale

Go to Tailscale's website and create an account. Then setup your docker directories.

	mkdir ~/docker
	mkdir ~/docker/tailscale

🧾 Docker Compose File

In ~/docker/tailscale create docker-compose.yml

	services:
	  tailscale:
	    image: tailscale/tailscale:latest
	    container_name: tailscale
	    network_mode: host
	    privileged: true
	    volumes:
	      - ./tailscale:/var/lib/tailscale
	    environment:
	      - TS_STATE_DIR=/var/lib/tailscale
	    command: tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock &
		     tailscale up --accept-dns=true --accept-routes=true
	    restart: unless-stopped 

▶️ Start Tailscale

From within ~/docker/tailscale run:

docker compose up -d

Now run docker exec -it tailscale tailscale up That will give you a link to browse to to register the Pi with Tailscale.

📜 View Logs

docker logs tailscale

Check the status

docker exec -it tailscale tailscale status

You should see your Pi listed.

🌐 Access Web Interface

Go to Tailscale's website. You should see your Pi listed.

If you find my content useful, please consider supporting this page:

☕ Buy Me a Coffee