VPS for Claude Code: how to run Claude Code 24/7
Claude Code is a terminal program, so it stops when your terminal does. Here is the plain-VPS way to keep it running, the point where that stops being enough, and what a cloud desktop adds.
The plain-VPS recipe
Rent a small Linux box, install Node and Claude Code, sign in with your Claude subscription, and run it inside tmux so it survives your SSH session ending. That is the whole trick, and for a lot of work it is enough:
ssh you@your-vps
npm install -g @anthropic-ai/claude-code
claude # sign in with your Claude account once
tmux new -s claude
claude -p "check the deploy every hour and open an issue if it is down"Reattach with tmux attach -t claude from anywhere. Add a cron entry or a systemd timer for anything that should recur. Your subscription pays for the model, the box costs five to twenty dollars a month, and nothing about this needs MyClawn.
Where it stops being enough
- Anything with a website. Claude Code can drive a browser through tools, but on a headless box there is no display, no logged-in session that persists, and no way for you to solve the CAPTCHA it just hit at three in the morning.
- Anything that needs to send mail. A VPS has no mailbox unless you build one, and mail from a fresh IP mostly lands in spam.
- Knowing what it did. You get a transcript. You do not get the screen, and you cannot step in mid-task from your phone.
What a cloud desktop adds, and the two ways to use it with Claude Code
A MyClawn machine is a dedicated Linux desktop with Chrome, files, a terminal and its own email address, streamed to your browser live and yours to take over at any moment. It comes with its own chat-driven agent; it does not host Claude Code as that agent, and it does not use your Claude subscription. There are two honest ways to combine the two.
1. Give your Claude Code a desktop to hand jobs to
The machine is also a remote MCP server. Mint a connector token in the MyClawn dashboard and add it to Claude Code:
claude mcp add --transport http myclawn https://www.myclawn.com/mcp/desktop \
--header "Authorization: Bearer mcc_..."Claude Code then has tools to hand the desktop a task in plain words, check what it is doing, read what it sent, stop it, and drop a file on it. The desktop does the browser work behind logins and the sending from its own address; Claude Code keeps doing the thinking on your subscription. You still see the screen and can take over. The tool list is in the MCP docs. This needs a plan on the MyClawn side, since it is a real machine.
2. Run Claude Code on the machine yourself
It is a Linux desktop with a terminal and Node. Take over the screen, open the terminal, install Claude Code and sign in with your own account, exactly as on any VPS, with the difference that now there is a display, a browser with persistent sessions, and a stream you can check from your phone. MyClawn's own chat does not drive that Claude Code; it is yours, in a terminal, on a machine that happens to have a screen. Your subscription terms are between you and Anthropic; one machine, one person, your login.
Which to pick
Shell-only work, and you are happy with tmux: the plain VPS, and keep your money. Work that touches websites, logins or mail, or work you want to watch: a machine with a desktop, and use Claude Code either as the caller through MCP or in the machine's own terminal. The general case is covered in what an AI VPS needs.
Questions people ask
Can I run Claude Code on a VPS?
Yes. Install Node and Claude Code on any Linux VPS, sign in with your Claude account once, and run it inside tmux so it survives your SSH session. That works for shell-only work and costs the price of the box.
Does MyClawn host Claude Code for me?
No. The MyClawn machine has its own agent and does not use your Claude subscription. You can give your Claude Code a MyClawn desktop as an MCP tool for browser and email work, or install Claude Code yourself in the machine’s terminal, where it has a display and persistent browser sessions.
How do I connect Claude Code to a MyClawn desktop?
Mint a connector token in the MyClawn dashboard, then run `claude mcp add --transport http myclawn https://www.myclawn.com/mcp/desktop --header "Authorization: Bearer <token>"`. Claude Code gets tools to hand the desktop a job, check its activity, read sent mail, stop it and send it files. A plan is required, since it is a real machine.