---
title: "Run the Pi coding agent on a remote server"
description: "Pi, the minimal, extensible coding agent, is already installed on exe.dev. Pick a model, open a project, and let Pi work while your laptop sleeps."
url: https://exe.dev/deploy/pi
category: "AI agents"
updated: 2026-10-30
---

# Run the Pi coding agent on a remote server

An agent that doesn't ask first, on a computer that can take it.

- **Software:** Pi (https://pi.dev/)
- **Source:** https://github.com/earendil-works/pi
- **License:** MIT
- **Time:** 2 minutes
- **Example VM name:** `my-pi` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://exe.dev/deploy/pi/manifest.json

## What you get

- Pi answering through exe.dev's LLM integration, with no API key or sign-in
- A Git repository at `~/project` on persistent disk
- A `pi` tmux session that survives disconnects

Running on the VM:

- **Pi**: preinstalled; models from exe.dev's LLM integration, data in `~/.pi/agent`
- **Your project**: a Git repository, data in `~/project`
- **tmux**: keeps your terminal session running when you disconnect

How it is reached:

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

## Deploy with Shelley

Open https://exe.dev/new?prompt=Set%20up%20Pi%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe.dev%2Fdeploy%2Fpi.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-pi.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-pi.%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-%20Pi%20answering%20through%20exe.dev%27s%20LLM%20integration%2C%20with%20no%20API%20key%20or%20sign-in%0A-%20A%20Git%20repository%20at%20%60~%2Fproject%60%20on%20persistent%20disk%0A-%20A%20%60pi%60%20tmux%20session%20that%20survives%20disconnects%0A%0AUse%20the%20preinstalled%20Pi%3B%20do%20not%20install%20another%20copy.%20If%20%60pi%20--version%60%0Ais%20older%20than%201.4.0%2C%20run%20%60exeuntu%20update%20pi%60%20%28without%20sudo%29.%20Run%20the%0AVM-side%20setup%20in%20%22Start%20coding%22.%20Create%20tmux%20detached%0A%28%60tmux%20new%20-d%20-s%20pi%20-c%20~%2Fproject%60%29%20rather%20than%20attaching.%20Reuse%20the%0Asession%20if%20it%20already%20exists%2C%20and%20don%27t%20add%20the%20tmux%20setting%20twice.%20Do%0Anot%20launch%20interactive%20Pi%3B%20leave%20its%20first-run%20question%20to%20the%20owner.%20Do%0Anot%20change%20%60~%2F.pi%2Fagent%2Fauth.json%60%2C%20%60settings.json%60%20or%20the%20%60exe-dev%60%0Aextension.%20Verify%20from%20~%2Fproject%20with%0A%60pi%20-p%20--model%20gpt-6-luna%40llm%20%22Reply%20with%20exactly%3A%20OK%22%20%3C%2Fdev%2Fnull%60%20and%0Acheck%20%60tmux%20has-session%20-t%20pi%60.%20Skip%20the%20later%20optional%20instructions%20and%0AFAQ.%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%60pi%60%20inside%20it%20and%20choose%20%22Use%20exe.dev%0ALLM%20integration%22%20when%20Pi%20asks.%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://exe.dev/deploy/pi/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Or follow the steps below by hand.

[Pi](https://pi.dev/) is a small, open-source coding agent from Earendil
that you shape to fit your work with extensions, skills and prompt
templates. exeuntu, exe.dev's default VM image, ships it ready to go: Pi
finds the models of exe.dev's [LLM integration](/docs/integrations-llm) on
its own, so there's no API key to paste, and model usage is billed to your
exe.dev account.

Pi doesn't stop to ask before it runs a command or edits a file. That's
why it belongs on a computer of its own, where it can build, run and break
things that aren't on your laptop.

> [!NOTE]
> Building an agent of your own that runs for days and survives a crash?
> That's [Pi Durable](/deploy/pi-durable), a library from the same team.
> This page is about the Pi coding agent.

## 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-pi
ssh my-pi.exe.xyz
```

On the VM, make a project folder and open a tmux session. The project is a
Git repository, so you can review and undo whatever Pi changes. The tmux
setting lets Pi tell **Shift+Enter** (a new line) from **Enter** (send),
if your terminal reports the difference:

```bash
git init ~/project
echo 'set -g extended-keys on' >> ~/.tmux.conf
tmux new -A -s pi -c ~/project
```

Inside that session, start Pi:

```bash
pi
```

The first time, Pi asks **Use exe.dev LLM integrations?** Choose **Use
exe.dev LLM integration**. Pi picks a model and shows it at the bottom
right. Then give it a small task. For example:

> Build a tiny website for a lighthouse keeper who reviews fog.

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

## Take a break

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

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

A VM restart ends the running session, but not your saved work. Pi saves
every conversation as it goes: reconnect and run `pi --continue` from your
project's folder on the VM to pick up the last one, or `pi --resume` to
choose another.

## Know what it can reach

Pi doesn't have permission prompts to loosen. From the first task, it
reads, writes and runs whatever the `exedev` user can, which on this VM
includes `sudo`. Pi's own [security guide](https://pi.dev/docs/latest/security)
suggests running it inside a virtual machine, and that's what this is:
your laptop, its files and its keys are out of reach.

What Pi can reach is the VM itself, the internet, and the
[integrations](/docs/integrations) attached to the VM. Keep secrets you
wouldn't hand to Pi off this VM, and attach only the integrations it needs.

> [!TIP]
> Before a big unattended job, take a copy of the VM with
> `ssh exe.dev cp my-pi my-pi-backup` on your computer. If the job goes
> sideways, carry on from the copy.

## Make yourself at home

- **Pick a model:** type `/model` in Pi, or start it with
  `pi --model claude-sonnet-5-5@llm`. exe.dev's models end in `@llm`;
  `pi --list-models @llm` lists them, and exe.dev keeps a
  [list of available models and prices](/llm-gateway-models).
- **Make it yours:** Pi can explain its own features and read its own
  docs, so ask it for what you're missing: *"write a Pi extension that
  asks me before any `git push`"*. Extensions are TypeScript files in
  `~/.pi/agent/extensions/`; type `/reload` to load a new one. Put
  instructions for a project in an `AGENTS.md` in its folder. Pi's
  [extension docs](https://pi.dev/docs/latest/extensions) have more.
- **Bring your code:** [connect a GitHub repo](/docs/integrations-github),
  clone it onto the VM, and run `pi` from its directory. Use that folder
  instead of `~/project` in the commands above.
- **Peek at your app:** ask Pi to serve it on `0.0.0.0:8000`, then open
  `https://my-pi.exe.xyz/`. It's private by default.
  [More about previews](/docs/proxy).
- **Give it more VMs:** connect Pi 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. Pi
  never asks before a tool call, so use a token limited to one tag rather
  than your whole account, as
  [that page shows](/deploy/exe-mcp#limit-what-the-agent-can-touch).
  With the token in `EXE_TOKEN` where you start Pi, run
  `pi mcp add exe --url https://exe.dev/mcp --bearer-token-env-var EXE_TOKEN`
  and check that `pi mcp list` says `exe: connected`. Then ask Pi to
  *"make a new VM and host this there"*.
- **Script it:** `pi -p "Summarize the TODOs in this repo"` runs one task
  without the interactive screen and prints the answer. `--mode json`
  streams every step as JSON lines instead.

This page was last checked with Pi 1.4.0. For Pi's own features, head to
[the Pi docs](https://pi.dev/docs/latest).

## Frequently asked questions

### How is this different from Pi Durable?

This page is Pi, the coding agent you talk to in a terminal: you give it tasks and watch it work. [Pi Durable](/deploy/pi-durable) is a library from the same team for building your own agent apps that run for days and pick up where they left off after a crash. If you want a coding partner, you're in the right place.

### Can I use my own subscription or API key?

Yes. Type `/login` in Pi, choose a provider, and follow its prompts. On a VM the sign-in page can't call Pi back, so paste the final redirect URL or code into Pi when it asks. Then pick that provider's model with `/model`. exe.dev's models stay on the list beside it; see Pi's [provider docs](https://pi.dev/docs/latest/providers).

### How do I update Pi?

On the VM, run `exeuntu update pi`, without `sudo`, then reopen your last chat with `pi --continue`. `pi update` can't update the copy exe.dev installs, but `pi update --extensions` still updates Pi packages. To pin a release, add `--version`: `exeuntu update pi --version 1.4.0`. See [updating coding agents](/docs/upgrade-codex).

### Pi doesn't show exe.dev's models. What now?

exe.dev's models end in `@llm`; `pi --list-models @llm` lists them. If you answered "I'll configure pi myself" the first time, Pi remembered: delete `~/.pi/agent/exe-dev-llm-integration.json` and start Pi again to be asked again. If the list is still empty, check that an [LLM integration](/docs/integrations-llm) is attached to the VM. The `exe-dev` extension in `~/.pi/agent/extensions` does the connecting, so leave it in place.

### 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-pi my-pi-backup` on your computer (choose a free backup name). To use that copy, connect with `ssh my-pi-backup.exe.xyz`; your files and Pi sessions, which live in `~/.pi/agent/sessions`, are there. Reattach any [VM-specific integrations](/docs/integrations-attach).


## Related

- [Host a Pi Durable agent](https://exe.dev/deploy/pi-durable.md): An agent that picks up where it left off, even after kill -9.
- [Give any agent a sandbox over MCP](https://exe.dev/deploy/exe-mcp.md): One URL gives your agent real VMs to run code on, host apps from, and hand work to.
- [Run Claude Code on a remote server](https://exe.dev/deploy/claude-code.md): A computer for Claude. A breather for your laptop.
- [Run Codex on a remote server](https://exe.dev/deploy/codex.md): A computer for Codex. An early night for your laptop.
- [Run OpenCode on a remote server](https://exe.dev/deploy/opencode.md): Every model, one VM, and an agent that works while your laptop sleeps.
- [Host OpenClaw](https://exe.dev/deploy/openclaw.md): An AI sidekick with its own computer. Your laptop can take a nap.
