Running an AI Coding Agent Like Claude Code on a VPS
A look at what changes when you put an AI tool that reads, writes and runs code from the terminal on a VPS. It covers how to think about memory and how to limit what the agent is allowed to execute.

Ren

Procura
Advantages of putting it on a VPS
- Work keeps going even after you close your terminal (you can keep it running with tmux or screen)
- You can connect over SSH from your phone and keep giving instructions while you're out
- A team can share the same environment, so everyone gets the same results
- You don't use your own laptop's CPU or battery

Ren

Procura
How to think about memory
What decides how much memory you need is the project itself, not the AI tool. The build system, the amount of dependencies and the number of tests you run at once all change the requirement. When memory runs short, the result is the same as in normal development: processes get killed partway through a build or a test run. Start by checking that your current project builds without problems on the plan you are considering.
- If you only handle lightweight scripts, a smaller plan is often enough
- Setups that use Next.js or Docker tend to have heavy builds, so plan for a plan with room to spare in memory
- If you run several tests or builds at the same time, add that much on top when estimating
How to limit what the agent can execute

Wilson

Procura
- Don't run it as root. Have it work as a dedicated regular user
- Always look over the diff yourself before running a proposed change
- Make a backup or a commit before you start, so you can roll back if something breaks
- Be extra careful when you let it read code imported from outside
Protecting the SSH connection itself
Before you think about the AI tool's safety, the SSH connection underneath has to be protected. If password authentication is still on, even a carefully designed permission setup for the AI tool means little. Switching to key authentication and limiting the source of connections with a firewall are basic steps to finish before installing any AI-related tools.

Procura

Ren
This article is translated from the Japanese original. If the two differ, the Japanese version is the one we keep up to date.