> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash.com/docs/common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/box/guides/hermes-plugin-setup&helpful=true` (or `false`) records whether this page helped. An optional `comment` (URL-encoded, at most 500 characters) says what was missing or wrong. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Run Hermes Agent's Terminal in Upstash Box

> Use the Upstash Box plugin for Hermes Agent to run its terminal, code execution and file tools in a box, while Hermes itself stays on your machine.

[Hermes](https://github.com/NousResearch/hermes-agent) runs shell commands, code and file edits on
your machine by default. The `upstash-box` plugin moves that work into a box: Hermes, your model
calls and your sessions stay local, and the `terminal`, `execute_code` and file tools run in the box.

Each chat gets its own box. When you close Hermes the box is paused, and it resumes with your files
and installed tools the next time.

<Note>
To run all of Hermes in a box instead, including the agent, see [Hermes Setup](/box/guides/hermes-setup).
</Note>

---

## 1. Install the plugin

Needs Hermes Agent 0.22.3 or newer. Have an
[Upstash Box API key](/box/overall/quickstart#1-get-your-api-key) ready.

```bash
hermes plugins install upstash-box
hermes plugins enable upstash-box
```

The install asks for your API key and saves it as `UPSTASH_BOX_API_KEY` in `~/.hermes/.env`.

---

## 2. Switch the terminal backend

```bash
hermes config set terminal.backend upstash_box
```

Or pick **Upstash Box** in `hermes setup terminal`. Check it with `hermes doctor`.

Restart Hermes so it picks up the new backend. In Hermes Desktop, quit the app and open it again.

---

## 3. Try it

Start Hermes, or open a new chat in Hermes Desktop, and ask:

```
Run uname -a and whoami.
```

The answer comes from the box, with the user `boxuser`. The first command of a chat takes about
10–15 seconds while the box starts and your Hermes skills are uploaded. Later commands start right
away.

Commands start in `/home/boxuser`.

---

## Configure

All settings are optional and go under `terminal:` in `~/.hermes/config.yaml`:

```yaml
terminal:
  backend: upstash_box
  container_persistent: true    # false: a new box per session, deleted when it ends
  upstash_box_size: small       # small | medium | large
  upstash_box_runtime: python   # node (default), python, golang, ruby, rust, ...
  upstash_box_name_prefix: hermes
```

The default `node` image has Python but no `pip`. For Python work, set `upstash_box_runtime: python`.
It applies to boxes created after the change.

---

## Clean up boxes

Paused boxes count toward your plan's box limit, and every Hermes Desktop chat gets its own box. The
plugin labels its boxes `hermes`:

```bash
box list --label hermes
box delete <box-id> --yes
```

To not keep boxes at all, set `container_persistent: false`. Each session then gets a new box,
deleted when the session ends.

---

## What runs where

- Every command, and every file the file tools read or write, goes to the box.
- Your Hermes skills and cache are uploaded to `~/.hermes` in the box. Changes made there are copied
  back when the session ends.
- If you [connected GitHub](https://console.upstash.com) under **Box > Settings > GitHub**, the box
  has your GitHub credentials, so the agent can clone and push.
- Your API key stays on your machine and is never sent into the box.
- Hermes skips its dangerous-command approval for commands in the box, as for its other cloud
  backends.

---

## Next steps

<CardGroup cols={2}>
  <Card title="Hermes Setup" icon="server" href="/box/guides/hermes-setup">
    Host all of Hermes in a keep-alive box.
  </Card>
  <Card title="Plugin source" icon="github" href="https://github.com/upstash/box/tree/main/packages/hermes-box">
    The plugin code and full reference.
  </Card>
  <Card title="Plugin catalog" icon="puzzle-piece" href="https://nousresearch.github.io/hermes-agent/docs/plugins/upstash-box/">
    The plugin's page in the Hermes catalog.
  </Card>
  <Card title="Hermes" icon="globe" href="https://hermes-agent.nousresearch.com/docs">
    Hermes documentation.
  </Card>
</CardGroup>
