Run Claude Code from your phone. vlad automates the setup of a GCP VM with mosh, tmux, and Tailscale — giving you a persistent, mobile-friendly coding environment accessible from Android (Termux) or any SSH client.
Phone (Termux) ──mosh/Tailscale──▶ GCP VM ──▶ tmux ──▶ Claude Code
(Ubuntu)
Why this stack:
- GCP — choose a region near you for low latency (~30-50ms)
- Tailscale — encrypted mesh network, no exposed ports, zero-config SSH
- mosh — survives WiFi/mobile data transitions and phone sleep
- tmux — persistent sessions that survive any disconnection
- Claude Code — lightweight (Node.js + API calls), ~100MB RAM per instance
- GCP VM with Ubuntu 24.04, Node.js 22, Claude Code, and GitHub CLI
- Mobile-optimized tmux config (Ctrl+A prefix, mouse support, top status bar)
- Shell aliases (
c,cs,cn,cc,ccn) for quick Claude access - Push notifications via ntfy when Claude finishes a task
- Tailscale for secure, zero-config connectivity
- SSH hardening, UFW firewall, and fail2ban
- Optional Git multi-account SSH configuration
- GCP account with billing enabled (or $300 free credit)
gcloudCLI installed and authenticated (install guide)- Tailscale account (free tier)
- Anthropic account with Claude Pro or Max (for Claude Code)
git clone https://github.com/carloslibadoo/vlad.git && cd vlad
chmod +x setup-vm.sh setup-env.sh
./setup-vm.shYou'll be prompted for your GCP project, zone, and VM settings. Or set them via environment variables:
GCP_PROJECT=my-project GCP_ZONE=us-central1-a ./setup-vm.shgcloud compute ssh <vm-name> --zone=<zone> --project=<project>
~/vlad-setup/setup-env.shThe script walks you through installing Node.js, Claude Code, Tailscale, security hardening, and more.
The setup script will prompt you for these, or run them manually:
claude login # Opens OAuth URL — complete in browser
gh auth login # Opens OAuth URL — complete in browser- Tailscale — Install from Play Store, sign in with the same account used on the VM
- Termux — Install from F-Droid (NOT Play Store)
pkg update && pkg install mosh openssh - Keyboard — Install CodeBoard for Ctrl, Alt, Esc, and arrow keys
- ntfy — Install from Play Store, subscribe to your topic name
- Connect:
mosh user@<tailscale-ip>
After verifying Tailscale works from your phone:
# On the VM — remove temporary SSH and mosh rules
sudo ufw delete allow 22/tcp
sudo ufw delete allow 60000:61000/udp
# From your local machine — remove GCP firewall rule
gcloud compute firewall-rules delete allow-mosh --project=<project> --quiet| Environment Variable | Description | Default |
|---|---|---|
VM_NAME |
VM instance name | claude-code |
GCP_PROJECT |
GCP project ID | (prompted) |
GCP_ZONE |
Compute zone | us-central1-a |
MACHINE_TYPE |
VM machine type | e2-medium |
BOOT_DISK_SIZE |
Boot disk size | 30GB |
NODE_MAJOR |
Node.js major version | 22 |
NTFY_TOPIC |
ntfy.sh notification topic | (prompted) |
SKIP_TAILSCALE |
Skip Tailscale install | 0 |
SKIP_SECURITY |
Skip security hardening | 0 |
# From phone (Termux) — via Tailscale
mosh user@<tailscale-ip>
# From Mac — via gcloud
gcloud compute ssh <vm-name> --zone=<zone> --project=<project>
# From Mac — via Tailscale (if installed)
ssh user@<vm-name>
mosh user@<vm-name># Check status
gcloud compute instances describe <vm-name> \
--zone=<zone> --project=<project> --format="value(status)"
# Start
gcloud compute instances start <vm-name> \
--zone=<zone> --project=<project>
# Stop (saves cost — disk still billed at ~$1.20/month)
gcloud compute instances stop <vm-name> \
--zone=<zone> --project=<project>gcloud compute scp LOCAL_FILE <vm-name>:~/REMOTE_PATH \
--zone=<zone> --project=<project>| Action | Keys |
|---|---|
| Prefix | Ctrl+A |
| Split horizontal | Ctrl+A | |
| Split vertical | Ctrl+A - |
| Switch panes | Alt+arrows |
| New window | Ctrl+A c |
| Next window | Ctrl+A n |
| Detach | Ctrl+A d |
| Reload config | Ctrl+A r |
| Alias | Command |
|---|---|
c |
claude |
cs |
claude --resume |
cn |
claude --new |
cc <dir> |
cd <dir> && claude |
ccn <args> |
claude + push notification on finish |
| Resource | Monthly cost |
|---|---|
| e2-medium (2 vCPU, 4 GB) running 24/7 | ~$39 |
| 30 GB pd-standard disk | ~$1.20 |
| Egress (~5 GB) | ~$0.60 |
| Total (running 24/7) | ~$41/month |
| Total (VM stopped) | ~$1.20/month (disk only) |
With $300 GCP free credit: ~7 months of 24/7 usage.
Tip: Stop the VM when not in use. At a few hours per day, costs drop to ~$5-10/month.
"Connection refused" on mosh — Check that UDP ports 60000-61000 are open in both UFW (sudo ufw status) and GCP firewall rules. After locking down, mosh must go through Tailscale.
Tailscale not connecting — Some ISPs use CGNAT. Tailscale handles this via DERP relay servers (adds ~20-40ms). Verify with tailscale netcheck.
tmux session lost — Check if the VM was stopped: gcloud compute instances describe <vm-name> --zone=<zone> --project=<project> --format="value(status)".
Claude Code asks to re-login — Re-run claude login. OAuth tokens may expire. Alternatively, set export ANTHROPIC_API_KEY=... in ~/.bashrc to use API credits instead.
Wrong git identity on push — Check per-repo config: git config user.email. Verify SSH host: ssh -T git@github.com.
Termux can't resolve VM hostname — Specify the user: ssh user@<vm-name>. Tailscale SSH can't map Termux's u0_a* Android usernames.
Phone keyboard missing Ctrl/Esc — In Termux, Volume Down acts as Ctrl. Install CodeBoard or Hacker's Keyboard for dedicated modifier keys.
If you push to GitHub from multiple accounts, the setup script can install an SSH config template. Edit ~/.ssh/config on the VM:
# Primary account (default)
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
# Secondary account
Host github-secondary
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_secondary
IdentitiesOnly yes
Clone secondary-account repos using the host alias:
git clone git@github-secondary:org/repo.gitSet per-repo identity:
cd repo
git config user.email "you@example.com"
git config user.name "Your Name"See mobile-claude-code-setup.md for the full manual walkthrough with step-by-step explanations.
MIT