Blog/SSH + Tailscale Guide

Claude Code from your iPhone, over SSH + Tailscale

2026-07-17

This guide sets up the following: your dev machine (a home desktop, office workstation, or VPS) joins a private Tailscale network, and your iPhone connects to it over SSH from wherever you are. No port forwarding and no public IP needed. Claude Code runs on the machine inside tmux, and the phone acts as a terminal onto it.

Why not just expose SSH?

Opening port 22 to the internet invites scanners and brute force. A tailnet keeps SSH reachable only by your own devices, end-to-end encrypted via WireGuard.

Step 1: put the dev machine on Tailscale

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

# macOS: install the Tailscale app and sign in

Sign in with your account; the machine gets a stable 100.x.y.z address and (with MagicDNS) a name like devbox. Verify with tailscale status.

Step 2: generate an auth key for your iPhone

In the Tailscale admin console, create an auth key. This is how ServerCC joins your tailnet — inside the app, without installing the system-wide Tailscale VPN on iOS. A reusable key is convenient; ServerCC stores it in the iOS Keychain.

Step 3: add the server in ServerCC

1

Host: the Tailscale IP (100.x.y.z) or MagicDNS name (devbox)

2

Auth: password or SSH key (encrypted keys supported)

3

Toggle Connect via Tailscale and paste the auth key — details in the Tailscale docs

Connect once on Wi-Fi to confirm, then try it on cellular: same result. The app joins the tailnet as an ephemeral node and bridges SSH over it; other apps on your phone are unaffected.

Step 4: run Claude Code — and close the app

Open a workspace and tap Claude Code — it launches inside a persistent tmux session on the dev machine. You can lock the phone or lose signal; the run keeps going on the server. When you reopen ServerCC it re-attaches to the same session, and long runs can send a notification on completion.

Troubleshooting

  • Auth key invalid/expired — rotate it in the admin console and update the server entry
  • No route to host — the dev machine is offline or left the tailnet; check tailscale status there
  • "claude: command not found" in tmux — put PATH in .bashrc/.zshrc, not only in profile files

More on the mobile workflow: Claude Code on iPhone · tmux on iOS