LogoSu Jiang
  • Blog
  • Knowledge Base
  • About Me
Make AI Coding 24/7: Remote Server + VS Code SSH + tmux, Step by Step
2026/01/03

Make AI Coding 24/7: Remote Server + VS Code SSH + tmux, Step by Step

Move your projects to a remote Linux box, manage dozens of tmux sessions from one VS Code window, and take over from your phone so AI keeps working in the background.

Make AI Coding 24/7: Remote Server + VS Code SSH + tmux, Step by Step

If AI only works while you're sitting at your desk, the bottleneck isn't the model. It's the host machine. Put your projects on an always-on server and AI moves into the server room — on shift 24 hours a day.

This is a practical build, not theory: run projects on a server, keep sessions alive with tmux, manage everything from VS Code, and take over from your phone anytime.

You only need: a Linux server, VS Code + Remote-SSH, an SSH key, tmux, and a terminal-based AI tool (Codex/Claude Code works fine).

24/7 Remote AI Coding WorkbenchLocal VS Code and mobile Termius connect to a remote server over SSH, attach tmux sessions, and keep AI workers running.Local VS CodeRemote-SSHMobile TermiusInstant takeoverRemote Linux ServerStable SSH entrytmux Session PoolOne session per projectAI WorkersCodex / Claude Code

First, make SSH a stable entry point

If you can already log in, don't rush to launch AI. Stabilize your SSH connection first. The easiest path is key-based auth plus keep-alive, so VS Code and your phone share one clean entry.

Generate a key (skip if you already have one):

ssh-keygen -t ed25519 -C "your@email.com"

Copy your public key to the server:

ssh-copy-id user@YOUR_SERVER_IP

Then add a host alias to ~/.ssh/config so everything uses ai-server:

Host ai-server
  HostName YOUR_SERVER_IP
  User user
  IdentityFile ~/.ssh/id_ed25519
  ServerAliveInterval 60
  ServerAliveCountMax 3

Test with ssh ai-server. If it still asks for a password, your key is probably not in ~/.ssh/authorized_keys.

Install tmux and split projects into sessions

tmux is the "power layer" for persistence. You can drop your network, close your laptop, or sleep — the processes keep running.

Install tmux (apt for Ubuntu/Debian, yum for CentOS/Rocky):

sudo apt-get update && sudo apt-get install -y tmux
sudo yum install -y tmux

No root? Ask your admin to install it. tmux -V should print a version when it's ready.

Create one session per project:

cd ~/projects

tmux new -s project-a

The three shortcuts you use daily:

  • Ctrl+b then d: detach without stopping
  • tmux ls: list sessions
  • tmux attach -t project-a: return to a session

Use VS Code to control tmux remotely

Now VS Code becomes your remote control. Install Remote - SSH, connect to ai-server, open the project directory, then attach in the VS Code terminal:

tmux attach -t project-a

You'll land inside the tmux session. Close VS Code if you want — when you come back, attach again and everything is still there.

If VS Code hangs on connect, test with ssh ai-server in a system terminal. If SSH works, the issue is usually VS Code SSH config or permissions.

Keep AI running in each window

Now start the AI. In a tmux session, open multiple windows and run one AI task per window. The rule is simple: one task per window, don't mix everything in a single chat.

Drop a prompt.md in each project so you can copy and edit quickly:

You are my project assistant.
Goal: finish the task and output a result file.
Requirements:
1. Print what you're doing at each step
2. When done, generate result.json with done: true/false
Task:
- TODO: describe the task

If you're using Codex/Claude Code, start it in the window:

codex

If it stalls, check CPU and memory first. AI can run in parallel, but your server still has limits.

Take over from your phone (optional but highly recommended)

This is the fun part. Install Termius, add the same ai-server, then:

tmux ls
tmux attach -t project-a

You see the exact same session as in VS Code. Restart a window or tweak a task while you're on the go.

No Ctrl key on mobile? Termius has a function key panel — use it to send Ctrl+b.

The habit that keeps it running all day

Once the system is built, habit decides output. This is my rhythm:

  • Morning: run tmux ls, check which projects are alive
  • Noon: see if any task is stuck, restart a window if needed
  • Night: write key outputs to result.json or logs, harvest the results the next day

When that rhythm sticks, AI becomes a real background worker, not a chat box.

The pitfalls you will hit

  • Server disconnects: usually SSH keep-alive isn't configured, or your network is restrictive.
  • Too many windows: don't brute-force; start with 3-5 concurrent tasks.
  • Messy prompts: without a template you keep rewriting; prompt.md saves real energy.
All Posts

Author

avatar for Su Jiang
Su Jiang

Categories

  • AI探索
Make AI Coding 24/7: Remote Server + VS Code SSH + tmux, Step by StepFirst, make SSH a stable entry pointInstall tmux and split projects into sessionsUse VS Code to control tmux remotelyKeep AI running in each windowTake over from your phone (optional but highly recommended)The habit that keeps it running all dayThe pitfalls you will hit

More Posts

tmux Complete Guide for Beginners: Sessions, Windows, Panes, Copy, Restore
AI探索

tmux Complete Guide for Beginners: Sessions, Windows, Panes, Copy, Restore

From install to advanced usage: sessions/windows/panes, copy mode, sync input, config, and recovery. Covers macOS, Linux, and WSL with plenty of SVG diagrams.

avatar for Su Jiang
Su Jiang
2026/01/05
杨振宁:发现宇宙的不对称之美
AI探索

杨振宁:发现宇宙的不对称之美

杨振宁:发现宇宙的不对称之美

avatar for Su Jiang
Su Jiang
2025/10/19
复制的尽头
AI探索

复制的尽头

复制的尽头

avatar for Su Jiang
Su Jiang
2025/10/03

Need a Custom Solution?

Still stuck or want someone to handle the heavy lifting? Send me a quick message. I reply to every inquiry within 24 hours—and yes, simple advice is always free.

100% Privacy. No spam, just solutions.

Newsletter

Join the community

Subscribe to our newsletter for the latest news and updates

LogoSu Jiang

AI Developer · Writer · Investor | Exploring AI Applications

TwitterX (Twitter)Email

WeChat: iamsujiang

WeChat QR Code
Scan to add WeChat
Product
  • Features
  • Pricing
  • FAQ
Resources
  • Blog
  • Knowledge Base
Company
  • About Me
  • Contact
  • Waitlist
Legal
  • Cookie Policy
  • Privacy Policy
  • Terms of Service
© 2026 Su Jiang All Rights Reserved.