In 2026 the usual way an AI coding setup fails is not a weak model. The laptop sleeps, the home directory mixes private files with the repo, and an API key lands in shell history. A Linux VPS can split the always-on execution environment from the editor in your hands. This tutorial starts at the provider signup and ends when VS Code or Cursor is editing files on that machine. Acceptance is not “SSH works.” Acceptance is a tmux session that is still there after the laptop disconnects, plus a snapshot taken before the agent edits anything large.
Why the AI coding environment leaves the laptop
The old setup installs a CLI on the laptop and lets the agent write straight into your home directory. The new setup puts the working tree, dependency caches, and long-running session on a VPS that does nothing but development. The laptop only displays and sends keystrokes. The conflict is not “is the cloud expensive.” The conflict is the execution boundary. Closing the lid kills local processes. A system update interrupts a long task. The same disk still holds browser sessions and private repositories. A VPS takes those out of the agent’s default writable set.
A VPS does not solve the other class of work. A Linux VPS has no macOS, so it cannot sign iOS builds and it has no Xcode. It is also not a training cluster. A coding agent that calls a hosted model spends RAM, disk, and a stable session. It does not spend a datacenter GPU. If the goal is local inference rather than editing a remote repo, start with the AI PC buying guide instead of buying a graphics machine in order to write application code.
Region decides how the setup feels before the plan name does. Remote SSH latency sits between you and the VPS. Model API latency sits between the VPS and the model host. If you sit in East Asia and the machine is in US East, keystrokes lag first, even when the model itself is fast. Pick a region near your chair, then talk about core count.
Treat the VPS as a development appliance with a known owner, not as a spare computer you also use for mail and chat. The moment personal logins and the agent share a home directory, you have recreated the laptop problem on someone else’s hardware. One machine, one job, one user named dev. That constraint is what makes later acceptance possible.
Split the AI coding environment into five layers
Buy by layer, not by the adjective in the advertisement. A jump host, a coding VPS, a build box, a macOS node, and a GPU cloud answer different questions. Comparing them as one kind of “cloud server” is how people run Node on 2 GB, or try to compile iOS on Linux.
| Layer | What it owns | Symptom when it is too small | What does not belong |
|---|---|---|---|
| Jump host | SSH only | The installer is killed mid-download | Agent, database, containers |
| Coding VPS | git, language runtimes, one CLI agent, tmux | Parallel tests and containers start fighting for RAM | Xcode, model training |
| Build box | More cores, more RAM, containers | Interactive editing gets sluggish | Everyday browser logins |
| macOS node | Signing, simulator, Apple toolchain | The tool is simply absent on Linux | Treating it as a general Linux host |
| GPU cloud | Training and large inference | The GPU idles between bugfixes | Ordinary repo edits |
The practical floor of the coding layer is 4 vCPU, 8 GB of RAM, and about 80 GB of disk. One or two gigabytes is a jump host. The disk has to hold node_modules, language caches, and a few checkouts. When the root filesystem passes roughly eighty percent, clear caches before you grow the disk. Do not wait for an installer to fail with a vague error that looks like a network problem.
CPU count matters less than people expect for an agent that spends most of its time waiting on a hosted model. The resident set is the editor server, a language server, Node or Python, and the agent process. That set is why 8 GB is a floor rather than a luxury. If you also want Docker and a browser-level end-to-end suite on the same box, step up. Do not discover the limit in the middle of a refactor.
The remote entry is the watershed, not the model
Model skill is not the watershed. The watershed is which machine holds the execution boundary. One person can have both Cursor and Claude Code. If one of them edits a laptop copy and the other edits the checkout on the VPS, the diff you see is not the diff the agent thinks it wrote.
| Tool | Entry | Execution | Context | Who it fits |
|---|---|---|---|---|
| VS Code Remote SSH | Local editor attached to the VPS | Terminal, debug, and extensions run remotely | The remote repository | People who want to keep a familiar editor |
| Cursor Remote SSH | The same SSH path | Completion and the agent edit remote files | The remote workspace | People who want the editor and the agent on one checkout |
| Claude Code or Codex CLI | tmux on the VPS | Can edit files and run tests | The directory you opened on purpose | Long tasks that should survive a closed lid |
| Remote Mac | Remote macOS | Xcode, signing, iOS Simulator | An Apple project | Toolchains that require macOS |
This article does not rank models. The difference in entry, execution, and context is covered in the Pi, Claude Code, and Codex comparison. Here you only need to pick one CLI, put it inside tmux, and point the editor at the same checkout on the same machine.
First connection over Remote SSH will ask you to trust a host key. Compare that fingerprint with the one shown in the provider console before you accept it. After that, the editor should open the remote folder, not a synced copy that drifts. If a status bar still says the window is local, you are about to edit the wrong disk.
Choose the machine by the job, not by the plan name
| If you are | Choose | Do not choose |
|---|---|---|
| Chatting with a model and not editing a repo | The local client | Any VPS |
| Writing web or backend code and want tests to keep running after the lid closes | A coding VPS from 8 GB, plus tmux | A 1 GB jump host |
| Running containers and end-to-end tests at the same time | A build box with another step of RAM | Sharing 8 GB with interactive editing |
| Building iOS or running Xcode | A rented remote Mac | A Linux VPS |
| Training weights | A GPU cloud | This coding VPS |
| A team that needs long-running automation, not one person editing remotely | Automation on a cloud Mac | Stuffing the pipeline into a personal VPS |
The difference between a personal coding VPS and a personal laptop is the session and the disk boundary, not “more intelligence.” A team pipeline also needs permissions, logs, and a record of who can log in. That is a different machine. Do not casually re-enable password login on the dev user from this guide just because a second person needs access.
A stack that is enough
Use Ubuntu 24.04 LTS. The user is dev. sudo still asks for a password, and the agent does not run as root. SSH is ed25519 only. Password login does get turned off, but only after a key login has already succeeded and the provider’s web console is still open. The runtimes are git, Python 3, Node 22 LTS, and tmux. The API key lives in ~/.config/ai-dev/provider.env, the directory is mode 700, the file is mode 600, and the path is in the repository ignore list.
On the editor side, use Remote SSH in VS Code or Cursor. The Host block lives in ~/.ssh/config on your own computer, not on the VPS. Long tasks go into a tmux session with a fixed name, such as agent. Before you let the agent make a wide edit, take a snapshot in the provider console.
Install Node from the distribution or from NodeSource’s current instructions for Node 22 LTS. Accept the install with node -v, not with “the script printed no error.” The same rule applies to Python and git. A version string is an observation. A silent installer is not.
Five mistakes that void the environment
- Running the coding stack on jump-host RAM. Node dies halfway through install. It looks like a network fault. It is memory.
- Disabling password login before the key works. The order is: a new key session succeeds, the old console window stays open, then you change sshd.
- Putting the API key on the command line. It enters shell history, and the agent can read that history. The key enters the session only from the mode-600 file.
- Giving dev passwordless sudo. The agent can run commands. Passwordless sudo means one mistaken command can rewrite sshd or the firewall. Keep the sudo password.
- Cloning an iOS project onto Linux and searching for xcodebuild. The tool will not appear. Those projects start on a remote Mac.
A sixth, quieter mistake is letting the agent see the whole home directory. Open the disposable repo as the workspace. Caches and the key file can sit next to it, but they are not part of the prompt context and they are not part of the git tree. If the agent’s first action is to “clean up” dotfiles, you pointed it at too much disk.
Seven steps from signup to remote development
Each step has an observation. Do not start the next step until you have seen that observation.
- Sign up. Turn on two-factor authentication, pick a region near you, and write down the public IP. Keep the billing mailbox and recovery codes in your own password manager, not on the machine you are about to hand to an agent.
- Keys. On your own computer, generate an ed25519 key and paste only the
.pubfile into the provider. The private key stays on the laptop. - User. Create dev and add it to sudo. After a key login as dev succeeds, disable root login and password login. Keep an already-open console window until that change is proven.
- Runtimes. Install git, a compiler toolchain, Python, tmux, and Node 22 LTS. Accept them with version commands, not with a quiet installer.
- Repository. As dev, clone a disposable test repo and run its existing tests. Confirm that the agent will later receive that directory, not the entire home directory.
- Agent. Install one CLI from the vendor’s current documentation. The key is read from the mode-600 env file. Start it inside tmux. The first session should explain the repo layout, not refactor it.
- Remote editing. Add a Host to your local SSH config, connect with VS Code or Cursor, change one file, and commit it on a test branch. Disconnect the laptop, then run
tmux attach -t agentfrom the console. If the session is still there, take a snapshot. That observation is the finished environment.
ssh-keygen -t ed25519 -C "ai-dev-vps" -f ~/.ssh/id_ed25519_ai_vps # Upload id_ed25519_ai_vps.pub only
sudo adduser dev sudo usermod -aG sudo dev sudo apt update sudo apt install -y git tmux build-essential python3 python3-venv python3-pip # Install Node 22 LTS from the distro or current NodeSource instructions node -v python3 --version git --version
Host ai-vps HostName YOUR_VPS_IP User dev IdentityFile ~/.ssh/id_ed25519_ai_vps IdentitiesOnly yes
mkdir -p ~/.config/ai-dev chmod 700 ~/.config/ai-dev install -m 600 /dev/null ~/.config/ai-dev/provider.env # One line inside provider.env, for example ANTHROPIC_API_KEY=replace-me tmux new -s agent
PermitRootLogin no, PasswordAuthentication no, and PubkeyAuthentication yes into /etc/ssh/sshd_config.d/99-ai-dev.conf. Leave the provider console open so you do not lock the only door.
A firewall that allows SSH and refuses the rest is part of the same step, not a separate project. If the provider already filters traffic in its panel, do not stack a second rule that locks you out. Change one control, test the key login, then change the next. The console is the rollback for this part of the setup, the same way the snapshot is the rollback for the agent.
Questions that decide the plan
Is a 1 GB or 2 GB VPS enough for AI coding?
No. That size only keeps SSH alive. Once Node, a language server, and a coding agent are resident together, 8 GB is the floor for daily work. Docker and parallel tests need another step up.
Does a coding agent need a GPU VPS?
Not when it calls a hosted model. Leave GPUs for training and large local inference. Day-to-day repo work buys RAM, disk, and a region close to you.
Can I build iOS apps on a Linux VPS?
No. Signing, the simulator, and xcodebuild belong to macOS. Use a remote Mac. Do not spend an afternoon searching Linux for a tool that will never be there.
Is it safe to put API keys on the VPS?
Only if you control the machine, the permissions are tight, and the repo cannot commit the file. Mode 600 for the file, 700 for the directory. Do not write the key into shell history, and do not hand it to an agent running as root.
Does a successful SSH login mean the environment is done?
No. Acceptance is a tmux session that survives the laptop disconnecting, a test repo the agent can edit, and a snapshot taken before that edit.
Where this leaves the decision
Decide the execution boundary, then sign up. A coding VPS fits Linux repositories that should keep running after the lid closes. Xcode and signing go to a macOS node. Training goes to a GPU. Remote development is in place when all seven steps have an observation, not when the SSH banner appears. An open door only means the door is open.
Further reading
- If the goal is local models, start with the AI PC buying guide →
- How Pi, Claude Code, and Codex differ in execution →
- Put long-running automation on a cloud Mac, not a personal VPS →
When the toolchain needs macOS, use a remote Mac
A Linux VPS can run git, tests, and a CLI agent. It cannot sign iOS builds or host Xcode. When the project needs Apple’s toolchain, rent a dedicated Mac instead of forcing the repo onto Linux.