> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fly.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Hermes Agent on Fly.io

<img src="https://mintcdn.com/fly-io/v-XOGeVK6s4rQ-4y/images/Hermes_Agent.png?fit=max&auto=format&n=v-XOGeVK6s4rQ-4y&q=85&s=197b090d781e244b284d168be06ac878" alt="Illustration by Annie Ruygt of the Greek god Hermes mid-flight, depicted on a black-figure pottery bowl framed by olive branches" width="1800" height="687" data-path="images/Hermes_Agent.png" />

[Hermes](https://github.com/NousResearch/hermes-agent) is an AI agent from Nous Research with a built-in learning loop: it watches its own output, notices when it had to improvise to finish a task, and writes that experience back as a reusable skill it can call next time. The skill library grows with use, so Hermes works best when it runs continuously on a persistent host rather than a short-lived sandbox, which is exactly what a Fly Machine with an attached volume gives you.

This guide walks you through running Hermes on a Fly Machine, configuring it, and reaching its web dashboard from your laptop.

You'll need **[flyctl](/flyctl/install)** installed, a **Fly.io account** ([free trial](/about/free-trial) works), and an **LLM API key** (Anthropic, OpenAI, Google Gemini, or [OpenRouter](https://openrouter.ai/) for access to 200+ models).

You'll use Nous Research's **official prebuilt image** (`nousresearch/hermes-agent:latest`) so there's no Dockerfile to maintain and no remote builder to wait on. Fly pulls the image straight from Docker Hub.

## Create the app and volume

Hermes keeps all its state in `/opt/data` inside the container. That includes config, API keys, sessions, skills, and memories. You'll back that with a Fly volume so it persists across deploys and restarts.

Pick an app name (must be globally unique on Fly) and a [region](/reference/regions) close to you, then:

```bash theme={null}
fly apps create <your-hermes-app>
fly volumes create data -a <your-hermes-app> --region <region> --size 3
```

3 GB is comfortable headroom for sessions and the bundled skills directory.

## Write fly.toml

Create a directory for the deployment config and drop a `fly.toml` in it:

```toml theme={null}
app = "<your-hermes-app>"
primary_region = "<region>"
machine_config = "machine_config.json"

[build]
  image = "nousresearch/hermes-agent:latest"

[[mounts]]
  source = "data"
  destination = "/opt/data"

[[vm]]
  memory = "4gb"
  cpus = 2
```

Create a machine config file (called `machine_config.json` in our example):

```json theme={null}
{
  "containers": [
    {
      "name": "hermes",
      "image": "nousresearch/hermes-agent:latest",
      "cmd": ["gateway", "run"],
      "secrets": [
        { "env_var": "EXAMPLE_API_KEY" },
        { "env_var": "EXAMPLE_TOKEN" }
      ]
    }
  ]
}
```

A few notes:

* **No `[build.dockerfile]`.** Fly pulls the image directly. Deploys take seconds, not minutes.
* \*\*Hermes images published from `v2026.5.28` onward use `s6-overlay` as the in-container supervisor. s6-overlay's `/init` calls `s6-overlay-suexec` which checks `getpid() == 1` before doing anything else and aborts otherwise. So we use multi-container machines (via the machine\_config.json) to get our own namespace.
* **No `[[services]]` block.** The gateway talks *outbound* to chat platforms, so you don't need a public port. The dashboard exposes API keys and shouldn't be public; you'll reach it through a Fly proxy tunnel below.
* **4 GB / 2 CPU** is the recommended size when browser tools (Playwright/Chromium) are active. If you don't use browser tools you can drop to `shared-cpu-1x` and 1–2 GB.

## Deploy

```bash theme={null}
fly deploy -a <your-hermes-app> --ha=false
```

`--ha=false` keeps it to a single machine; Hermes is stateful and you don't want two gateway processes writing to the same volume.

When the deploy finishes, the machine boots, the entrypoint bootstraps `/opt/data` (creating `.env`, `config.yaml`, `SOUL.md`, `sessions/`, `skills/`, etc.), and `hermes gateway run` starts. It'll keep running but it has no API key yet, so it can't talk to a model.

Confirm it's alive:

```bash theme={null}
fly logs -a <your-hermes-app>
```

You should see the bundled skills sync, then the gateway starting up.

## Configure Hermes

SSH into the machine. The `hermes` binary lives at `/opt/hermes/.venv/bin/hermes` inside the image, but `fly ssh console` opens a login shell that resets PATH and won't find it there. Add a symlink into `/usr/local/bin` (which is always on PATH) so `hermes` works as a bare command:

```bash theme={null}
fly ssh console -a <your-hermes-app> -C \
  "ln -sf /opt/hermes/.venv/bin/hermes /usr/local/bin/hermes"
```

Then open a shell on the machine and run the setup wizard:

```bash theme={null}
fly ssh console -a <your-hermes-app>
hermes setup
```

The wizard walks you through model selection, tool configuration, and connecting your messaging platforms. When it's done, exit the SSH session.

Restart the machine so the gateway picks up the new config:

```bash theme={null}
fly machine restart <machine-id> -a <your-hermes-app>
```

Get `<machine-id>` from `fly machine list -a <your-hermes-app>`.

## Web dashboard

Hermes has a web dashboard on port 9119 for managing sessions, skills, and config. The dashboard reads your API keys, so the upstream guidance is to never expose it on a public port. Tunnel to it instead:

In one terminal, start the dashboard inside the machine:

```bash theme={null}
fly ssh console --pty -a <your-hermes-app> -C \
  "HERMES_DASHBOARD_WS_HOST=127.0.0.1 hermes dashboard --host [::] --no-open"
```

Since you're using a tunnel via this setup, your dashboard isn't publicly exposed. But [hermes requires you to setup dashboard auth](https://hermes-agent.nousresearch.com/docs/user-guide/features/web-dashboard) if you're binding to \[::].

Setup auth (or use a shim to proxy from localhost, if that's your style).

In a second terminal, open a Fly proxy from your laptop:

```bash theme={null}
fly proxy 9119:9119 -a <your-hermes-app>
```

Now visit `http://localhost:9119` in your browser. Traffic goes over your authenticated WireGuard tunnel; the dashboard isn't published to the public internet, though it is reachable from other Machines on your organization's [private network](/networking/private-networking)

When you're done, `Ctrl+C` both commands. The gateway keeps running on the machine.

## Upgrading

The image is stateless; your data lives on the volume. To pull the latest Hermes:

```bash theme={null}
fly deploy -a <your-hermes-app>
fly ssh console -a <your-hermes-app> -C \
  "ln -sf /opt/hermes/.venv/bin/hermes /usr/local/bin/hermes"
```

The deploy pulls `nousresearch/hermes-agent:latest` again. The second command re-creates the `/usr/local/bin/hermes` symlink; it lives on the container's filesystem, not the data volume, so each new container starts without it.

## VM sizing

If you're running heavy tool use or multiple concurrent sessions, scale up:

```bash theme={null}
fly scale memory 8192 -a <your-hermes-app>
fly scale vm shared-cpu-4x -a <your-hermes-app>
```

## Useful commands

| Command                                                        | Description                  |
| -------------------------------------------------------------- | ---------------------------- |
| `fly logs -a <your-hermes-app>`                                | Stream live logs             |
| `fly ssh console -a <your-hermes-app>`                         | SSH into the machine         |
| `fly ssh console -a <your-hermes-app> -C "hermes doctor"`      | Health check                 |
| `fly machine restart <id> -a <your-hermes-app>`                | Restart after config changes |
| `fly status -a <your-hermes-app>`                              | Check machine status         |
| `fly volumes list -a <your-hermes-app>`                        | List attached volumes        |
| `fly ssh console -a <your-hermes-app> -C "hermes skills list"` | List learned skills          |

## Troubleshooting

**Gateway won't start**

Check `hermes doctor` for missing API keys or other diagnostics:

```bash theme={null}
fly ssh console -a <your-hermes-app> -C "hermes doctor"
```

**Out of memory**

Increase RAM:

```bash theme={null}
fly scale memory 8192 -a <your-hermes-app>
```

**Need to start fresh**

Wipe the config files (skills, sessions, and memories survive):

```bash theme={null}
fly ssh console -a <your-hermes-app> -C \
  "sh -c 'rm -f /opt/data/config.yaml /opt/data/.env'"
fly machine restart <machine-id> -a <your-hermes-app>
fly ssh console -a <your-hermes-app>
hermes setup
```

To wipe everything including conversations, destroy and recreate the volume:

```bash theme={null}
fly machine stop <machine-id> -a <your-hermes-app>
fly volumes destroy <volume-id> -a <your-hermes-app>
fly volumes create data -a <your-hermes-app> --region <region> --size 3
fly machine start <machine-id> -a <your-hermes-app>
```

**Skills behaving unexpectedly**

List, view, and delete:

```bash theme={null}
fly ssh console -a <your-hermes-app>
hermes skills list
hermes skills view <skill-name>
hermes skills delete <skill-name>
```
