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.
sudo apt update && sudo apt upgrade -ycurl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
sudo apt install docker-compose-pluginsudo usermod -aG docker $USERsudo systemctl enable dockersudo rebootdocker run hello-worldGo to Tailscale's website and create an account. Then setup your docker directories.
mkdir ~/docker mkdir ~/docker/tailscale
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
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.
docker logs tailscale
docker exec -it tailscale tailscale status
You should see your Pi listed.
Go to Tailscale's website. You should see your Pi listed.
If you find my content useful, please consider supporting this page: