> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-dx-3122-agent-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-Host Hermes Agent in a Cloud Sandbox

> Install the Hermes agent by Nous Research in a keep-alive Upstash Box over SSH, and restart it automatically with an init script.

This guide walks you through setting up [Hermes](https://github.com/NousResearch/hermes-agent) inside an Upstash Box.

***

## 1. Create a Box

Create a keep-alive box with the **Medium** size. See the [quickstart](/box/overall/quickstart) if you haven't created one before.

<Note>
  Hermes is resource-intensive, so we recommend starting with a Medium box to ensure a smooth installation.
</Note>

<img src="https://mintcdn.com/upstash-dx-3122-agent-docs/Wzeb9fITpQUvW5tn/img/hermes-setup/box-create.png?fit=max&auto=format&n=Wzeb9fITpQUvW5tn&q=85&s=bf8892892a393cc0800f9b34794a8eeb" alt="Create a Box for Hermes" width="1940" height="1188" data-path="img/hermes-setup/box-create.png" />

***

## 2. Connect via SSH

Once the box is running, connect to it via SSH from your terminal. Use your [Box API key](/box/overall/quickstart#1-get-your-api-key) as the password when prompted.

The `box-id` is the name of your box (e.g. `right-flamingo-14486`).

```bash theme={null}
ssh <box-id>@us-east-1.box.upstash.com
```

<img src="https://mintcdn.com/upstash-dx-3122-agent-docs/Wzeb9fITpQUvW5tn/img/hermes-setup/ssh-connection.png?fit=max&auto=format&n=Wzeb9fITpQUvW5tn&q=85&s=b219e59c8fdc2a2a25cae9449605438a" alt="SSH connection to the Hermes Box" width="1940" height="1082" data-path="img/hermes-setup/ssh-connection.png" />

***

## 3. Install Hermes

Run the following command to download and install Hermes inside the box.

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
```

Follow the CLI prompts to complete the setup.

Congratulations! You have successfully set up Hermes on your Upstash Box.

***

## 4. Set Init Script for Auto-Restart

To ensure Hermes restarts automatically if the box crashes, set the startup command as an init script from the Upstash Console.

<img src="https://mintcdn.com/upstash-dx-3122-agent-docs/Wzeb9fITpQUvW5tn/img/hermes-setup/init-script.png?fit=max&auto=format&n=Wzeb9fITpQUvW5tn&q=85&s=07e768d1d7b4882b7c7474a7598cf5d7" alt="Hermes init script in the Upstash Console" width="1940" height="1080" data-path="img/hermes-setup/init-script.png" />

The init script to use:

```bash theme={null}
hermes gateway run > gateway.log 2>&1 &
```

This command runs automatically whenever the box starts, so your gateway is always available without manual intervention.


## Related topics

- [Self-Host an Always-On OpenClaw Agent in the Cloud](/box/guides/openclaw-setup.md)
- [Self-Hosted Sandboxes for Claude Managed Agents](/box/guides/claude-managed-agents.md)
- [Self-Hosted Sandboxes for the OpenAI Agents API](/box/guides/openai-agents-api.md)
- [Run TanStack AI Coding Agents in a Cloud Sandbox](/box/guides/tanstack-setup.md)
- [Host T3 Code in a Remote Sandbox](/box/guides/t3-code-setup.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.