Networking & Security icon

Access Your Homelab From Anywhere With Tailscale, No Port Forwarding

Port forwarding means opening a hole in your router and trusting whatever sits behind it to be fully patched. Tailscale lets you skip that. It builds a private network between your own devices, a mesh VPN built on WireGuard, so your phone can reach your Pi as if both were on the same LAN, from anywhere, with no open ports.

What you get

  • Every device gets a stable private address (100.x.y.z) and a name, so you can stop memorising IPs
  • Connections are encrypted and usually go directly between your devices
  • It works behind CGNAT too, falling back to Tailscale’s relays when no direct path exists
  • There is a free plan for personal use (check Tailscale’s site for the current limits)

Install it on your server

On a Raspberry Pi or any Linux box, the official script does the job:

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

The second command prints a login URL. Open it, sign in, and the machine joins your private network, which Tailscale calls a tailnet. Then install the app on your phone and laptop, sign in with the same account and check that everything can see everything:

tailscale status
tailscale ip -4

The last command shows the server’s Tailscale address. Open it from your phone on mobile data. Any service on that machine, like the Pi-hole dashboard at http://100.x.y.z/admin, is now reachable from anywhere and still invisible to the internet.

Reach your whole home network

You don’t need Tailscale on every device. One machine can act as a subnet router and expose your whole LAN. Turn on IP forwarding first:

echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf

Then advertise your subnet, using your own range:

sudo tailscale up --advertise-routes=192.168.1.0/24

It won’t work yet. Open the Tailscale admin console, find the machine and approve the route in its settings. After that your phone can reach the printer, the NAS or anything else on that subnet.

Ad blocking on the go

If you run Pi-hole, you can take it with you. In the admin console, open the DNS settings, add your Pi-hole’s Tailscale IP as a custom nameserver and turn on the option to override local DNS. Your phone then resolves through Pi-hole even on mobile data. Check that Pi-hole answers queries coming in on the Tailscale interface, because by default it may listen only to your local network.

SSH from anywhere

Every machine gets a name, so SSH from any network is a one-liner:

ssh pi@my-pi

Keep key-based login on. A VPN doesn’t make passwords a good idea. If you haven’t set that up yet, start here.

When it does not behave

  • The server disappears after a few months: device keys expire by default. For a server that should stay on, open the machine’s menu in the admin console and disable key expiry.
  • Subnet routes do nothing: you haven’t approved the route in the admin console, or IP forwarding is off on the router machine.
  • Everything feels slow: tailscale status shows whether a connection is direct or relayed. Relayed connections work but are slower.
  • You can’t open a service: check that it listens on more than 127.0.0.1. A container bound only to localhost never answers on the Tailscale address.

Related reading

Similar Posts