Episode 3
Server (optional)
Clicking loads the video from YouTube (youtube-nocookie.com). Nothing is sent to YouTube before that. Privacy policy
In this episode (≈ 90 min of hands-on work)
- Your own server, reachable only through your private Tailscale network.
- Claude Code in a sealed-off container with no open ports.
- A session that keeps running while you steer it by phone.
Your step
Paste this into Claude Code on your laptop before you order anything. Claude walks you through the checklist and stops wherever money or your accounts are involved.
Walk me through ~/ailoopwise-blueprint/course/examples/server-checklist.md, one item at a time and in its order. I am not a developer, so explain each item in one plain sentence. 1. For each item, show me the matching command or click path from ~/ailoopwise-blueprint/course/03-server-optional.md, then wait until I tell you the result before you go on. 2. STOP before anything that costs money or happens in one of my accounts (ordering the server, Hetzner, Hostinger, Tailscale, GitHub). Tell me what to do there myself and wait until I say it is done. 3. Do not let me switch on ufw before login over the Tailscale address (100.x.y.z) works, or I lock myself out. 4. Change nothing yourself, in this folder or outside it. You may run commands that only display something on this computer, after explaining them. I type everything else myself. 5. Never open or print the private key ~/.ssh/id_ed25519 (only the .pub file is shared), and never print passwords, tokens or login codes. 6. Never run git commit or git push unless I ask. At the end, list the items that are still open.
Files for this episode
Questions about this episode? Just email us: hello@ailoopwise.com
Step-by-step guide
What this episode is about
This episode is an extra. If it feels too technical, skip it. Episodes 4 to 6 don't need a server.
You rent a small virtual server (Hetzner or Hostinger) and run Claude Code there in a sealed-off Docker container. Tailscale makes the server invisible from outside. On your phone you open Termius, attach to a tmux session so nothing drops, and with /remote-control you can also drive the session from the Claude app. The laptop can stay shut.
The wall: a server also means updates, backups and access rights, forever, not once.
What you need
- A VPS with Ubuntu and at least 4 GB RAM (the Claude Code minimum): Hetzner Cloud https://www.hetzner.com/cloud or Hostinger VPS https://www.hostinger.com/vps-hosting
- Tailscale on laptop and phone: https://tailscale.com/download · on the server: https://tailscale.com/kb/1031/install-linux
- Termius on your phone: https://termius.com
- Docker Engine for Ubuntu: https://docs.docker.com/engine/install/ubuntu/
- tmux: https://github.com/tmux/tmux/wiki/Getting-Started
- The Claude app on your phone: https://claude.ai/download
- The checklist: examples/server-checklist.md
Step by step
- Create an SSH key on the laptop (Enter for the default path, then set a passphrase):
Only share that
ssh-keygen -t ed25519 -C "laptop" cat ~/.ssh/id_ed25519.pub.publine. The file without.pubstays on the laptop. - Order the server. Hetzner: in your project Servers → Add server, image Ubuntu, a type with at least 4 GB RAM, paste the
.publine under SSH key. At Hetzner this only works at creation (guide). Hostinger: add the key during setup or later under VPS → Manage → Settings → SSH keys (guide). No password login. - Log in:
ssh root@<public-IP> - Tailscale on the server: install from https://tailscale.com/kb/1031/install-linux (use the command there), then:
Open the URL shown and sign in with the same account as on laptop and phone. Note the
sudo tailscale up tailscale ip -4100.x.y.zaddress. - Log back in over Tailscale (
exit, thenssh root@100.x.y.z) and only then block everything else (steps from https://tailscale.com/kb/1077/secure-server-ubuntu):Test from the laptop:sudo ufw allow in on tailscale0 sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw enable sudo ufw status verbosessh root@<public-IP>times out,ssh root@100.x.y.zworks. - Docker: install from https://docs.docker.com/engine/install/ubuntu/, then tmux:
sudo apt install tmux - Start the container and add
jq(the blueprint hooks need it):Claude runs there as usersudo docker run -dit --name claude-box --restart unless-stopped \ --user node -w /home/node -v claude-home:/home/node node:22 bash sudo docker exec -u root claude-box apt-get update sudo docker exec -u root claude-box apt-get install -y jqnode, not root. The home directory lives in theclaude-homevolume, so login and projects survive a restart. No-p: no container port is reachable from outside. - Blueprint onto the server (first line on the laptop, the others on the server):
scp -r ~/ailoopwise-blueprint root@100.x.y.z:/root/ sudo docker cp /root/ailoopwise-blueprint claude-box:/home/node/ sudo docker exec -u root claude-box chown -R node:node /home/node/ailoopwise-blueprint - Open a tmux session and enter the container:
Install Claude Code inside the container with the Linux command from https://code.claude.com/docs/en/setup and check with
tmux new -As claude sudo docker exec -it claude-box bashclaude --version. - Sign in: start
claude. No browser opens on a server: pressc, open the copied URL on laptop or phone, sign in, and paste the code shown atPaste code here if prompted. - Set up the project as in episode 2, just in the terminal:
cd ~/ailoopwise-blueprint,claude, paste the prompt from episode 2. Thencd ~/<your-project>andclaude. Accept the trust dialog once. - Termius on the phone: Keychain → Generate Key (Ed25519), add a host with
100.x.y.z, userroot, that key. Then push the key to the server with Export to host (guide). Connect and run:tmux attach -t claude - Turn on Remote Control, in the running session in the phone terminal:
Confirm Enable Remote Control. In the Claude app, tap Code and find the session with a computer icon and a green dot.
/remote-control - Let go:
Ctrl+b, thenddetaches you; Claude keeps running. The docs: "To keep a session running on a remote machine after you disconnect from SSH, start it insidetmuxorscreen." (Remote Control)
Security, no exceptions: SSH keys, not passwords. After step 5, port 22 is closed to the public. Publish no container ports: ports published with -p bypass ufw (Docker docs). Never put API keys in the image or Dockerfile, never mount ~/.ssh or cloud credentials into the container (Claude Code docs). While Remote Control is connected, the session transcript is stored on Anthropic's servers; everything still executes on your server.
Example to copy
The full order to tick off: examples/server-checklist.md. The core:
- [ ] ufw: `allow in on tailscale0`, all other incoming blocked, enabled
- [ ] Container `claude-box` runs as user `node`, with no published ports (`-p`)
- [ ] No API key in the image, no `~/.ssh` or cloud credentials mounted
Before the next episode
Shut the laptop, connect with Termius, type tmux attach -t claude and check that your session is still running.
If something goes wrong
Killedduring install, exit code 137: the server ran out of memory. Pick a type with at least 4 GB RAM or add swap. Source: https://code.claude.com/docs/en/troubleshoot-install#install-killed-on-low-memory-linux-servers- Login code not accepted: the browser ran on another device. Copy the URL with
c, sign in, paste the code in the terminal. If pasting fails, useclaude auth login. Source: https://code.claude.com/docs/en/troubleshoot-install#oauth-login-fails-in-wsl2-ssh-or-containers - After a while you can't get in over Tailscale: Tailscale requires periodic re-authentication. For this server choose "Disable Key Expiry" under Machines in the admin console. Source: https://tailscale.com/kb/1028/key-expiry
- The session goes offline in the app as soon as you close Termius: Claude wasn't running inside tmux. Start
tmux new -As claudeand restart Claude inside it. Source: https://code.claude.com/docs/en/remote-control#limitations
Free by email
New guides by email, plus the complete Blueprint package
With every new video you get the full guide with the ready-to-paste AI brief. Once you confirm your address, the complete Blueprint package is the first thing we send you.
Free. Unsubscribe any time.