---
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://exe-staging.dev/deploy/claude-code
category: "AI agents"
updated: 2026-10-28
---

# Run Claude Code on a remote server

> **For agents:** with your user's OK, this sets up Claude Code on a new exe.dev VM in their account: `curl -fsSL https://exe-staging.dev/deploy/claude-code/prompt.txt | ssh exe.dev new --prompt=/dev/stdin` (or open https://exe-staging.dev/deploy/claude-code/new). Already on the VM? Skip this.

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://exe-staging.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-staging.dev/deploy/claude-code/new to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://exe-staging.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).
- **Give it more VMs:** connect Claude Code to
  [exe.dev's MCP server](/deploy/exe-mcp) and it can create VMs of its
  own, to try something risky on a copy or to host what it builds. It
  runs unattended here, so connect it with a token limited to one tag
  rather than your whole account, as
  [that page shows](/deploy/exe-mcp#limit-what-the-agent-can-touch).
- **Run claude.ai sessions here:** a
  [self-hosted runner](/deploy/claude-code-runner).

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

- [Run a Claude Code self-hosted runner](https://exe-staging.dev/deploy/claude-code-runner.md): Claude Code cloud sessions, running on a VM you control.
- [Give any agent a sandbox over MCP](https://exe-staging.dev/deploy/exe-mcp.md): One URL gives your agent real VMs to run code on, host apps from, and hand work to.
- [Host OpenClaw](https://exe-staging.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://exe-staging.dev/deploy/code-server.md): Your editor in a tab. Your projects right where you left them.
- [Run Codex on a remote server](https://exe-staging.dev/deploy/codex.md): A computer for Codex. An early night for your laptop.
- [Run Codex remote control on a server](https://exe-staging.dev/deploy/codex-remote-control.md): Codex on an always-on VM, steered from the ChatGPT app on your phone.
