---
title: "Run Claude Code on a remote server"
description: "Claude Code is already installed on exe.dev. One setup command, a project folder, and a coding session that stays put when you close your laptop."
url: https://hub.exe.dev/deploy/claude-code
category: "AI agents"
updated: 2026-10-14
---

# Run Claude Code on a remote server

A computer for Claude. A breather for your laptop.

- **Software:** Claude Code (https://claude.com/product/claude-code)
- **Source:** https://github.com/anthropics/claude-code
- **License:** Proprietary (Anthropic Commercial Terms)
- **Time:** 2 minutes
- **Example VM name:** `my-claude-code` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://hub.exe.dev/deploy/claude-code/manifest.json

## What you get

- Claude Code connected to a model, with no API key to paste
- A project folder at `~/project` on persistent disk
- A `claude` tmux session that survives disconnects

Running on the VM:

- **Claude Code**: preinstalled; connected to exe.dev's LLM integration, data in `~/.claude`
- **Your project**, data in `~/project`
- **tmux**: keeps your terminal session running when you disconnect

How it is reached:

- ssh my-claude-code.exe.xyz (private): your terminal

## Deploy with Shelley

Open https://exe.dev/new?prompt=Set%20up%20Claude%20Code%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fhub.exe.dev%2Fdeploy%2Fclaude-code.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-claude-code.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-claude-code.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20Claude%20Code%20connected%20to%20a%20model%2C%20with%20no%20API%20key%20to%20paste%0A-%20A%20project%20folder%20at%20%60~%2Fproject%60%20on%20persistent%20disk%0A-%20A%20%60claude%60%20tmux%20session%20that%20survives%20disconnects%0A%0AUse%20the%20preinstalled%20Claude%20Code.%20Run%20the%20VM-side%20setup%20in%20%22Start%20coding%22%2C%0Ausing%20%60exeuntu%20claude%20configure%60%20on%20older%20images.%20Create%20tmux%20detached%0A%28%60tmux%20new%20-d%20-s%20claude%20-c%20~%2Fproject%60%29%20rather%20than%20attaching.%20Reuse%20the%0Asession%20if%20it%20already%20exists.%20Do%20not%20launch%20interactive%20Claude%3B%20leave%20its%0Afirst-run%20prompts%20to%20the%20owner.%20Do%20not%20overwrite%20existing%20Claude%20settings%0Aor%20switch%20an%20existing%20login%3B%20ask%20the%20owner%20if%20these%20prevent%20setup.%0AVerify%20from%20~%2Fproject%20with%20%60claude%20-p%20--model%20haiku%20%22Reply%20with%20exactly%3A%20OK%22%60%0Aand%20check%20%60tmux%20has-session%20-t%20claude%60.%20Skip%20the%20later%20optional%20instructions%0Aand%20FAQ.%20Finish%20with%20the%20SSH%20command%20from%20%22Take%20a%20break%22%2C%20using%20this%20VM%27s%0Aname%2C%20and%20tell%20the%20owner%20to%20run%20%60claude%60%20inside%20it.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open.%0A to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://hub.exe.dev/deploy/claude-code/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Or follow the steps below by hand.

Claude Code already ships with exeuntu, exe.dev's default VM image. No
installer adventure required. Give Claude a project and let your laptop
clock off.

This setup uses exe.dev's [LLM integration](/docs/integrations-llm): no API key
to paste, and model usage billed to your exe.dev account.

## Start coding

On your computer, create a VM and connect. Pick any free name; if you've
already clicked Deploy or have a VM, skip the first command and use its name:

```bash
ssh exe.dev new --name=my-claude-code
ssh my-claude-code.exe.xyz
```

On the VM, configure Claude, make a project folder, and open a tmux session:

```bash
exeuntu configure claude
mkdir -p ~/project
tmux new -A -s claude -c ~/project
```

Inside that session, start Claude:

```bash
claude
```

Follow the first-run prompts, then give it a small task. For example:

> Build a tiny website for a very opinionated cat.

That's the setup. Your files live in `~/project`.

## Take a break

Press **Ctrl-b**, then **d** to detach. Claude stays running on the VM when
you disconnect. On your computer, use this command to hop back in:

```bash
ssh -t my-claude-code.exe.xyz 'tmux new -A -s claude -c ~/project'
```

A VM restart ends the running session, but not your saved work. Reconnect
and run `claude --continue` from your project's folder on the VM to resume
its last conversation.

## Make yourself at home

- **Bring your code:** [connect a GitHub repo](/docs/integrations-github),
  clone it onto the VM, and run `claude` from its directory. Use that folder
  instead of `~/project` in the commands above.
- **Peek at your app:** ask Claude to serve it on `0.0.0.0:8000`, then open
  `https://my-claude-code.exe.xyz/`. It's private by default.
  [More about previews](/docs/proxy).

For Claude's own features, head to [Anthropic's quickstart](https://code.claude.com/docs/en/quickstart).

## Frequently asked questions

### Can I use my Claude subscription instead?

Yes. Skip `exeuntu configure claude` and run `claude auth login` on the VM. Open its sign-in link on your computer and paste the code back if prompted. If you already used the setup above, first remove its `apiKeyHelper` and `env.ANTHROPIC_BASE_URL` settings from `~/.claude/settings.json`.

### What if the setup command doesn't work?

Older VMs use `exeuntu claude configure`. If it says `existing user config`, it has left your settings alone. On the VM, run `claude auth status --text` to check your connection settings; the [LLM integration docs](/docs/integrations-llm#use-with-claude-code) cover custom settings and using your own API key.

### How do I update Claude Code?

On the VM, run `claude update`, then restart Claude with `claude --continue`. See [updating coding agents](/docs/upgrade-codex) if you need a hand.

### How do I back up my work?

Commit and push your code. For a copy of the whole VM, run `ssh exe.dev cp my-claude-code my-claude-code-backup` on your computer (choose a free backup name). To use that copy, connect with `ssh my-claude-code-backup.exe.xyz`; your files and Claude history are there. Reattach any [VM-specific integrations](/docs/integrations-attach).


## Related

- [Host OpenClaw](https://hub.exe.dev/deploy/openclaw.md): An AI sidekick with its own computer. Your laptop can take a nap.
- [VS Code in your browser, with code-server](https://hub.exe.dev/deploy/code-server.md): Your editor in a tab. Your projects right where you left them.
- [Self-host n8n](https://hub.exe.dev/deploy/n8n.md): Connect your apps. Let the boring bits run themselves.
- [Self-host Uptime Kuma](https://hub.exe.dev/deploy/uptime-kuma.md): A little lookout for your websites. Green bars encouraged.
