VPS for Claude Code: how to run Claude Code 24/7
A VPS for Claude Code is any always-on Linux server where Claude Code runs inside tmux under your own Claude account; it costs the price of the box and works for shell-only jobs. The point where that stops being enough is anything with a website or mail, and that is what a cloud desktop adds.
The plain Claude Code server: tmux on a $5–20 VPS
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 "run the test suite and open an issue for every failure"Reattach with tmux attach -t claude from anywhere. For anything that should recur, add a cron entry or a systemd timer that runs claude -p … on a schedule; one -p call runs once and exits. 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.
Two ways to use a MyClawn desktop 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, from $19 a month. It has 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 ways to combine the two.
1. Give your Claude Code a desktop to hand jobs to
The machine is also a remote MCP server. Connector tokens are minted in the MyClawn dashboard, under “Connect Claude, ChatGPT, or any MCP client”, shown once and revocable there. With a token, 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 with its own built-in agent, metered against your MyClawn plan's included AI usage; Claude Code keeps doing its own thinking on your subscription and decides what to hand over. 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. Open the terminal (on the desktop, or switch the dashboard's command bar to Terminal), install Claude Code into your home directory (the native installer, curl -fsSL https://claude.ai/install.sh | bash; the desktop user has no root, so a global npm install will not work; we installed Claude Code 2.1.273 this way on a live machine in September 2026), sign in with your own account, and you are where the plain-VPS recipe ends, 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 Claude login, your subscription, one person per machine.
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 Claude Code keep running when I close my laptop?
No. It is a terminal program on your machine, so it stops when the machine sleeps. To keep it running, put it on a server: a plain VPS with tmux for shell-only work, or a cloud desktop when the work touches websites, logins or mail.
Can Claude Code use a browser on a VPS?
On a headless VPS there is no display and no login that persists, so browser work stalls at the first CAPTCHA. On a MyClawn machine Claude Code runs in a terminal next to a real Chrome with sessions that survive, and you can take over the screen from your own browser when it needs you.
Does MyClawn host Claude Code for me?
Not as its agent: the machine’s built-in agent is its own and never uses your Claude subscription. You can install Claude Code yourself in the machine’s terminal (the dashboard’s command bar has a Terminal mode), sign in with your own account and leave it running; we did, with Claude Code 2.1.273, on a live machine in September 2026. Or give your Claude Code a MyClawn desktop as an MCP tool for browser and email work.
How do I connect Claude Code to a MyClawn desktop?
With a connector token from the MyClawn dashboard (Connect Claude, ChatGPT, or any MCP client), then: 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 (myclawn_desktop_run), check its activity, list its tasks, read sent mail, stop it and send it files. A plan is required, since it is a real machine. Tokens are created and revoked in the dashboard’s Connect panel; only a hash is stored, so each token is shown once.
Does running Claude Code on a server break the subscription terms?
MyClawn does not use your subscription and does not run Claude Code for you: on the machine it is your login and your plan, one person per machine, the same as on a laptop. What your Claude plan allows is between you and Anthropic.