Running Claude Code CLI on an always-on Linux VM so Remote Control works from iPad anytime.
Links: iPad + Claude Setup, Working With Claude, The Cyborg Model
Remote Control requires a running claude process on a machine. The Windows PC sleeps, corporate firewalls may block websockets, and the ~10-minute network timeout kills the session. A persistent cloud VM solves all three.
iPad (Claude app / safari)
→ claude.ai/code (Remote Control UI)
→ Anthropic API (TLS relay)
→ Cloud VM (tmux → claude remote-control)
→ vault repo (git clone)
All traffic is outbound HTTPS from the VM. No inbound ports needed.
Yes. Confirmed working on Debian 12 headless (no display server) via SSH + tmux (GitHub issue #29479). The setup:
curl -fsSL https://claude.ai/install.sh | sh
Installs to ~/.local/bin/claude, auto-updates in background.
Remote Control requires OAuth login, not API keys. This is the single most important constraint.
| Auth Method | Remote Control? | How to Set Up on Headless |
|---|---|---|
/login (OAuth) |
Yes | Run claude, it prints a URL; open that URL in a browser on any device; complete login; token flows back to CLI |
ANTHROPIC_API_KEY |
No | export ANTHROPIC_API_KEY=sk-... — works for headless Claude but NOT Remote Control |
claude setup-token |
No | Generates a 1-year OAuth token, but scoped to inference only — explicitly “cannot establish Remote Control sessions” |
Workflow for headless auth:
claude — it prints a login URL (no browser opens)~/.claude/.credentials.json (mode 0600)/logout or token expiresRequires: Pro, Max, Team, or Enterprise plan.
# SSH into VM
ssh user@vm-ip
# Start or attach tmux
tmux new -s vault || tmux attach -t vault
# Navigate to vault
cd ~/vault
# Start Remote Control (server mode — best for this use case)
claude remote-control --name "Vault" --spawn session
# Press spacebar to show QR code
# Or copy the session URL
The --spawn session flag limits to one session (simpler). Omit it for multi-session.
Known limitation: claude remote-control currently requires a TTY. Cannot run as a systemd service or via nohup. tmux/screen is the workaround. A --headless flag is requested (GitHub issue #30447) but not yet implemented.
#!/bin/bash
# ~/start-vault-rc.sh
# Run inside tmux. Restarts Remote Control if it exits.
while true; do
cd ~/vault && git pull --ff-only
claude remote-control --name "Vault" --spawn session
echo "Session exited at $(date). Restarting in 10s..."
sleep 10
done
# Initial clone
git clone https://github.com/chrisaacson69/vault.git ~/vault
# Auth via SSH key (recommended) or GitHub CLI
ssh-keygen -t ed25519 -C "vault-vm"
# Add public key to GitHub → Settings → SSH Keys
# Or use gh CLI
gh auth login # device code flow — works headless
For two-way sync (VM edits + local edits), just use git normally. The VM and local PC are both working copies of the same repo. Push from whichever you edit on; pull on the other.
| Provider | Plan | Specs | Monthly Cost | Notes |
|---|---|---|---|---|
| Hetzner Cloud CX22 | Shared vCPU | 2 vCPU, 4 GB RAM, 40 GB SSD | ~$4.15 (€3.79) | Best value. EU + US regions. 20 TB traffic |
| Vultr | Cloud Compute | 1 vCPU, 1 GB RAM, 25 GB SSD | $2.50 | Cheapest entry point |
| AWS Lightsail | Nano | 1 vCPU, 512 MB RAM, 20 GB SSD | $3.50 | May be tight on RAM |
| Linode (Akamai) | Nanode | 1 vCPU, 1 GB RAM, 25 GB SSD | $5.00 | Solid reliability |
| DigitalOcean | Basic Droplet | 1 vCPU, 1 GB RAM, 25 GB SSD | $6.00 | Good docs, easy setup |
| Fly.io | Shared 256MB | shared vCPU, 256 MB RAM | ~$2/mo + $2 IPv4 | Too little RAM |
| GitHub Codespaces | 2-core | 2 vCPU, 8 GB RAM | $129.60 if always-on | Terrible for 24/7 |
Vultr at $2.50 works too but Hetzner gives 4x the RAM for $1.65 more.
Anthropic publishes an official image: ghcr.io/anthropics/claude-code:latest (487 MB, multi-arch).
docker run -it \
-v ~/vault:/workspace \
-e ANTHROPIC_API_KEY=sk-... \
ghcr.io/anthropics/claude-code:latest
However, for the Remote Control use case, Docker adds complexity without benefit:
claude installed directly is simplerssh root@<ip> → create non-root usercurl -fsSL https://claude.ai/install.sh | sh
apt install tmuxgh auth login # or set up SSH key
git clone git@github.com:chrisaacson69/vault.git ~/vault
cd ~/vault
claude
# Copy the URL it prints → open on iPad → complete OAuth
tmux new -s vault
cd ~/vault
claude remote-control --name "Vault"
# Ctrl-B D to detach
Total recurring cost: ~$4/month (Hetzner) + existing Claude Max subscription.
~/.claude/.credentials.json)/login tokens beyond “re-auth if you /logout”)--headless flag ship? (#30447 — open, 18 upvotes, marked stale)