# Run Pane on a Cloud VM

Want agents that keep working while your laptop sleeps? Run Pane's host on a VM. The VM runs the agents, terminals and git [worktrees](/docs/panes-and-worktrees). Your laptop or phone just shows them.

> **Note:** Pane doesn't create or pay for cloud machines. You make the VM with any provider and run Pane on it as a [Remote Pane](/docs/remote-daemon) host.

These steps are for a headless VM. If your VM has a desktop and runs Pane, link it like [any other computer](/docs/your-computers) instead.

<RemoteArchitecture />

## Set it up

1. Create an Ubuntu 24.04 VM with any provider. Size it for the agents and builds you'll run. It only needs inbound SSH, for setup. Tailscale connects outward, and Pane's host listens only on the VM itself.
2. SSH in as a regular user with `sudo`, not as `root`.
3. Install what your agents need on the VM: `git`, Node.js 22.23.4+ (22.x), 24.22.1+ (24.x) or 26.12.1+ (26.x), and the agent CLIs you use, like Claude Code or Codex. Sign in to each one on the VM. The agents run there.
4. Install Tailscale and join your tailnet:

   ```bash
   curl -fsSL https://tailscale.com/install.sh | sh
   sudo tailscale up
   ```

5. Install Pane and get a connection code. `--format deb` installs the Debian package, so the VM doesn't need FUSE:

   ```bash
   npx --yes runpane@latest install daemon --label "Cloud VM" --format deb
   ```

6. Make sure the host keeps running after you log out. Setup usually handles this. If it says it couldn't, run:

   ```bash
   sudo loginctl enable-linger "$USER"
   systemctl --user status pane-remote-daemon.service
   ```

7. Copy the `pane-remote://...` code it prints. Treat it like a password.

## Connect

1. In desktop Pane, open **Settings → Remote Access → Tailscale → Paste a connection code**. Elsewhere, open the [Pane phone app](/docs/phone) or [runpane.com/app](https://runpane.com/app/).
2. Paste the code into the **Connection Code** field.
3. Click **Connect** on desktop, or **Import & Connect** in the browser.

The device you connect from needs Tailscale on the same tailnet. Your VM's projects show up in the sidebar once you're connected.

<a id="host-status"></a>

## Starting and stopping the VM

Use your provider's console or CLI. When the VM stops, its agents stop too. Your repos, worktrees and agent configs stay on the VM's disk as long as you keep the disk. See [What is session persistence?](/what-is-session-persistence) and the [Pane glossary](/glossary).

To take Pane off the VM and keep the VM, run this (add `sudo` to the `tailscale` line if it asks):

```bash
systemctl --user disable --now pane-remote-daemon.service
tailscale serve --tls-terminated-tcp=443 off
```

## Debug it

Something not working? Run this on the VM, then check [Troubleshooting](/docs/troubleshooting#remote-connections). The VM doesn't put `runpane` on your `PATH`, so use `npx`:

```bash
npx --yes runpane@latest doctor --pane-dir ~/.pane_remote --json
```

If doctor prints a repair command, run it. See [Check and repair the service](/docs/remote-daemon#check-and-repair-the-service).
