Hermes Agent setup guide
Hermes Agent Docker Compose setup
To run Hermes Agent in Docker, use the Linux Compose file to mount ~/.hermes at /opt/data and run the setup wizard once. Start the gateway with the same mount so it can read your settings. On a VPS, open the dashboard through an SSH tunnel. On Windows, follow the Docker Desktop steps.
Last updated · Published
By CWYN · Published
Hermes writes configuration, API keys, sessions, skills and memories under /opt/data. The mount keeps those files in your host folder. You can replace the nousresearch/hermes-agent image and keep that data. In this setup, Hermes itself runs in the container. With Docker as a terminal backend, Hermes runs on the host and sends shell commands into a sandbox container. Hermes Docker guide (as of ).
For the full documentation, use the Hermes Agent docs by task to find the official manual and matching CWYN walkthrough.
1. Run Hermes Agent with Docker Compose on Linux or a VPS
Hermes Agent docs: where each answer lives
- Installation lists the desktop packages and the terminal installer for your operating system.
- Docker setup covers image tags, the first-run wizard and the host folder that holds your sessions.
- Configuration explains which settings go in
config.yamland which secrets go in.env. - Docker terminal backend describes where shell commands run and which host directories the sandbox can see.
- Security and permissions covers command approvals and who can message the gateway. For a file you cannot edit, start with the volume ownership check.
Nous Research documentation (as of ).
Run Hermes Agent on a Hetzner VPS
- Size the server. For the Hermes container, Nous recommends 2 CPU cores, 2–4 GB of RAM and at least 2 GB for the data volume. The minimum is 1 core, 1 GB of RAM and 500 MB of data space. Allow at least 2 GB of RAM if you use browser tools. For Chromium, add
shm_size: 1gto the gateway service. - Set the firewall before attaching it. In your Hetzner Cloud project, choose Firewalls → Create Firewall. Allow inbound TCP from your own IP to the server's SSH port (usually 22), then apply the firewall to the VPS. For this setup, leave the dashboard (9119) and API (8642) closed to the internet. Open the dashboard from your computer through the SSH tunnel.
- Keep one data folder. Connect over SSH as the Linux user who will run Compose. The wizard and gateway must both mount that user's
~/.hermesat/opt/data. Withrestart: unless-stopped, Docker brings the gateway back after a reboot unless you stopped it yourself. To upgrade, pull and recreate the container with that same mount.
Hermes resource and storage requirements, Compose service settings and Hetzner firewall rules (as of ).
Save the Linux Compose file
On a VPS, connect over SSH first. Browser consoles, including Hetzner's, can change punctuation in pasted mount paths and keys. Save the file below as compose.yaml in an empty project directory. It uses the published 0.23.4 image for both services. Nous lists v0.23.4 as the current stable release. The Docker image tag drops the leading v. Nous release notes and Docker image tags (as of ).
services:
gateway:
image: nousresearch/hermes-agent:0.23.4
container_name: hermes
restart: unless-stopped
network_mode: host
volumes:
- ~/.hermes:/opt/data
environment:
HERMES_UID: ${HERMES_UID:-10000}
HERMES_GID: ${HERMES_GID:-10000}
command: ["gateway", "run"]
dashboard:
image: nousresearch/hermes-agent:0.23.4
container_name: hermes-dashboard
profiles: ["dashboard"]
restart: unless-stopped
network_mode: host
depends_on:
- gateway
volumes:
- ~/.hermes:/opt/data
environment:
HERMES_UID: ${HERMES_UID:-10000}
HERMES_GID: ${HERMES_GID:-10000}
command: ["dashboard", "--host", "127.0.0.1", "--no-open"]
The mount, host networking and startup commands follow Nous's repository file. The dashboard has its own Compose profile so the gateway can run alone. Official Linux Compose file and Starting optional services (as of ).
Run setup once, then start the gateway
From the directory containing compose.yaml, run these commands as the user who owns ~/.hermes. The wizard saves your keys in ~/.hermes/.env. Finish it before starting the gateway. Both containers use the same image, data directory and host user ID. Hermes first-run setup and One-time Compose commands (as of ).
mkdir -p ~/.hermes
HERMES_UID=$(id -u) HERMES_GID=$(id -g) docker compose run --rm gateway setup
HERMES_UID=$(id -u) HERMES_GID=$(id -g) docker compose up -d
Setup commands (as of ). Checked against docs, not run.
Update a pinned installation
The image owns the application code, so hermes update cannot upgrade it in place. Change both image tags in compose.yaml to the new release. From that directory, pull the image and recreate the gateway. Your settings stay in the mounted folder. If you run the dashboard too, add --profile dashboard after docker compose in both commands. Hermes image upgrades, Compose pull and Compose up (as of ).
docker compose pull
HERMES_UID=$(id -u) HERMES_GID=$(id -g) docker compose up -d
Docker Compose example for a self-hosted Hermes API
If an app on your Linux server needs an OpenAI-compatible endpoint, use this single-service compose.yaml in place of the gateway and dashboard file above. With host networking, Hermes listens directly on 127.0.0.1:8642. Compose needs no ports entry.
services:
gateway:
image: nousresearch/hermes-agent:0.23.4
container_name: hermes
restart: unless-stopped
network_mode: host
volumes:
- ~/.hermes:/opt/data
environment:
HERMES_UID: ${HERMES_UID:-10000}
HERMES_GID: ${HERMES_GID:-10000}
API_SERVER_ENABLED: "true"
API_SERVER_HOST: 127.0.0.1
API_SERVER_PORT: "8642"
API_SERVER_KEY: ${API_SERVER_KEY}
command: ["gateway", "run"]
Generate a key with openssl rand -hex 32. Save it as API_SERVER_KEY in a private .env beside compose.yaml. Run the first-run commands from that directory. On the server, curl http://127.0.0.1:8642/health should return {"status":"ok"}. Give the client the same key and the base URL http://127.0.0.1:8642/v1.
Gateway service and ownership settings, Published image and API setup, Pinned release and API address and health check (as of ).
Standalone Docker on macOS or Linux
If you prefer a single container, use these commands in place of the Compose setup above. The wizard writes to the same host folder.
mkdir -p ~/.hermes
docker run -it --rm \
-v ~/.hermes:/opt/data \
nousresearch/hermes-agent setup
Once the wizard finishes, start the persistent gateway. Port 8642 serves the OpenAI-compatible API and its health endpoint. For local API access, enable the API and set its host and key as described in the port 8642 checks. The mapping below accepts connections only from the Docker host. If you only use chat platforms such as Telegram or Discord, omit the -p line.
docker run -d \
--name hermes \
--restart unless-stopped \
-v ~/.hermes:/opt/data \
-p 127.0.0.1:8642:8642 \
nousresearch/hermes-agent gateway run
The latest and stable tags point to the image that passed the stable release gate. Choose main for a development build, a version tag for a stable release, or a digest to pin an exact image. Docker commands and image tags (as of ).
For a native install on an Apple Silicon Mac, follow the macOS Terminal installation guide.
2. Hermes Docker on Windows
Start Docker Desktop and create the .hermes folder under %USERPROFILE%. In Command Prompt, run the one-time wizard using the Windows host path for the mount. Setup wizard and Windows volume settings (as of ).
docker run -it --rm -v "%USERPROFILE%\.hermes:/opt/data" nousresearch/hermes-agent setup
Save the official Windows file as docker-compose.windows.yml. It uses explicit port mappings because the Docker Desktop setup it targets does not support the Linux file's network_mode: host. It mounts ${USERPROFILE}/.hermes:/opt/data. Set an authentication provider in the dashboard service's environment before starting it. Run this command in the folder containing the file. Official Windows Compose file (as of ).
docker compose -f docker-compose.windows.yml up -d
Open http://127.0.0.1:9119 on the PC. The file publishes only 127.0.0.1:9119:9119 for the dashboard. Its gateway has no mapping for 8642. Windows port mappings (as of ).
If the dashboard or an external tool needs the gateway API, set API_SERVER_ENABLED=true, API_SERVER_HOST=0.0.0.0 and a private API_SERVER_KEY on the gateway. Add "127.0.0.1:8642:8642" to its ports list for access from the PC. Omitting the host address, as in -p 8642:8642, publishes the port on all host interfaces by default. Reapply the Compose command after editing. Gateway API port and API host and key settings (as of ).
3. Connect to the dashboard, webapp or a local model
Open the Linux dashboard from another computer
Start the optional dashboard on the VPS. The service shares the Linux host network and listens on 127.0.0.1:9119. Linux dashboard settings and Compose profiles (as of ).
HERMES_UID=$(id -u) HERMES_GID=$(id -g) docker compose --profile dashboard up -d
On your own computer, replace user@vps with your SSH login and host. Leave the tunnel running and open http://127.0.0.1:9119 in your local browser. SSH forwards that local port to the dashboard on the VPS. Nous dashboard tunnel (as of ).
ssh -L 127.0.0.1:9119:127.0.0.1:9119 -N user@vps
Dashboard sign-in with published ports
On a bridge network, publishing 9119:9119 makes the dashboard reachable on every host interface by default, including a VPS public interface. Use 127.0.0.1:9119:9119 to limit the host side to loopback. The Linux host-network example above needs no port mapping. Docker port publishing (as of ).
To serve the dashboard from the standalone gateway container, add -e HERMES_DASHBOARD=1 and -p 127.0.0.1:9119:9119 before the image name in the gateway run command. Keep the container defaults HERMES_DASHBOARD_HOST=0.0.0.0 and HERMES_DASHBOARD_PORT=9119 so a published port can reach it. For a reverse proxy or sidecar that connects on container loopback, you can bind the dashboard to 127.0.0.1.
Since the June 2026 hardening, a dashboard bound to a non-loopback address requires an authentication provider. Without one it refuses to start. This applies to the Windows dashboard's 0.0.0.0 bind even though Docker publishes it only on PC loopback. The Windows file still passes --insecure. Hermes ignores that deprecated flag and HERMES_DASHBOARD_INSECURE. Dashboard authentication and Windows dashboard command (as of ).
- Basic auth on a trusted network or VPN. Set
HERMES_DASHBOARD_BASIC_AUTH_USERNAMEandHERMES_DASHBOARD_BASIC_AUTH_PASSWORD. SetHERMES_DASHBOARD_BASIC_AUTH_SECRETto keep sessions valid across restarts. Keep this option off the public internet. - Nous Portal OAuth. Set
HERMES_DASHBOARD_OAUTH_CLIENT_ID. - Self-hosted OIDC. Set
HERMES_DASHBOARD_OIDC_ISSUERandHERMES_DASHBOARD_OIDC_CLIENT_ID.
For the browser version of Hermes Desktop on a bridge network, enable webapp.enabled in the mounted config.yaml, keep the webapp's host: 0.0.0.0 in the container and publish 127.0.0.1:9120:9120 for access from the host. The same authentication providers apply. Dashboard providers and webapp settings (as of ).
Ollama or vLLM on the same Docker network
Start with the port-mapped Compose example in the Docker guide and put Hermes and the inference service on the same network. In the host's ~/.hermes/config.yaml, use the inference container's name as the hostname. On this network localhost and 127.0.0.1 point back to Hermes.
Edit the model provider settings in your existing configuration. For a vLLM service named vllm, use the fields below. Replace my-model with the exact --served-model-name. Leave the trailing slash off base_url. The default vLLM server expects an API key header and accepts any non-empty string, including "none".
provider: custom
model: my-model
base_url: http://vllm:8000/v1
api_key: "none"
For an ollama container, use base_url: http://ollama:11434/v1 and the installed model name, for example model: llama3. Keep provider: custom and a non-empty api_key. Local inference server configuration (as of ).
If the model server runs on the host
- macOS or Windows. Use
http://host.docker.internal:8000/v1for vLLM orhttp://host.docker.internal:11434/v1for Ollama. - Linux. Start Hermes with
--network host. Usehttp://127.0.0.1:8000/v1for vLLM orhttp://127.0.0.1:11434/v1for Ollama. In host network mode Docker ignores-p. Each service listens directly on the host, so check its bind address.
Reaching a model server on the host (as of ).
Or use desktop Local Models
The desktop app on macOS, Windows and Linux can manage llama.cpp and run a model on your machine. Open Settings → Providers → Local Models (or choose Run models locally during onboarding). Select Install runtime, pick a model, then choose Download and Use. From a terminal, hermes model followed by Local models opens the same setup. After download, inference works offline without an account or API key. The Docker image does not include the Electron desktop app. Desktop Local Models guide and Docker image contents (as of ).
Check the model connection from inside Hermes
For the container named hermes, ask vLLM for its models from inside the gateway. Look for your served model name in the response.
docker exec hermes curl -s http://vllm:8000/v1/models
If the model list is empty, check that the containers share a network, the inference server listens on 0.0.0.0 and its port matches base_url.
If Hermes follows your project rules in the CLI but ignores them in Telegram, check which AGENTS.md the Hermes gateway reads.
Docker verification and troubleshooting and Compose ownership and entrypoint notes (as of ).
4. Troubleshooting Hermes in Docker
Docker terminal backend and file permissions
If Hermes runs on your host and you want its shell and file tools to work inside Docker, edit the terminal settings in ~/.hermes/config.yaml. The sandbox has its own workspace. Your current project directory stays on the host unless you mount it. Changes to a writable bind mount reach the original files.
If the agent creates root-owned files in a mounted project, run its sandbox commands with your host UID and GID. Merge these lines into your existing configuration, then restart Hermes.
terminal:
backend: docker
docker_run_as_host_user: true
New files on writable mounts will belong to your user. If a project file still belongs to root, check its numeric owner with ls -ln. From the host account that should own it, run sudo chown "$(id -u):$(id -g)" ./file, replacing ./file with the affected path. If the error names /opt/data in the gateway container, check the gateway's UID and GID.
Sandbox mounts and host user settings (as of ).
Files in ~/.hermes belong to UID 10000
On the host, run ls -ldn ~/.hermes to see the folder's numeric owner and group. Compare those numbers with id -u and id -g for the account that runs Compose.
If the host user gets “Permission denied” when editing the data folder, check which IDs Compose passed to the container. The repository defaults to UID and GID 10000. Reapply the startup command as the owner of ~/.hermes, including HERMES_UID and HERMES_GID each time you recreate a service. The image's startup hook maps the Hermes account to those IDs and fixes volume ownership. Compose ownership settings and Volume initialization (as of ).
“Refusing to bind dashboard to 0.0.0.0”
The dashboard handles credentials. For a VPS, keep its host-network bind at 127.0.0.1 and use the SSH tunnel. A dashboard that must listen on a non-loopback address needs a configured sign-in provider. Dashboard authentication (as of ).
The dashboard is unreachable on Windows
Use the Windows Compose file with explicit port mappings. Its dashboard listens on 0.0.0.0:9119 inside the container after sign-in is configured. The mapping 127.0.0.1:9119:9119 makes it reachable at http://127.0.0.1:9119 on the PC. Reapply the Windows Compose command after changing the file. Docker Desktop service settings (as of ).
The gateway API or health check is unreachable on port 8642
The API is off by default. In the gateway environment, set API_SERVER_ENABLED=true and supply a private API_SERVER_KEY of at least eight characters. Set API_SERVER_HOST=127.0.0.1 for host-local clients on Linux host networking. On the Windows bridge network, set API_SERVER_HOST=0.0.0.0 inside the container and publish the port on PC loopback. Recreate the gateway, then run the check on its host. A healthy server returns a JSON status of ok. Docker API settings and API health endpoint (as of ).
curl http://127.0.0.1:8642/health
The gateway skips initialization or leaves zombie processes
A custom entrypoint can bypass /init. This skips volume setup and service supervision. Remove the override and use the service's command to select the gateway or dashboard. If you need a custom entrypoint, keep /init first in the chain. Recreate the affected container. Docker’s --init flag (Compose init: true) can reap orphan processes, but it takes PID 1 and the image loses s6 supervision. Entrypoint requirements and Hermes process supervision (as of ).
The container exits immediately or the gateway stays offline
Read the recent container output first. If it identifies a missing or invalid .env, rerun the setup wizard with the same mount. For a gateway stuck after a network interruption, use docker restart hermes. Gateway startup and recovery (as of ).
docker logs --tail 50 hermes
For the optional service, read docker logs hermes-dashboard. On the host, ~/.hermes/logs/gateways/default/current retains gateway output for the default profile and ~/.hermes/logs/container-boot.log records profile startup. These files survive container replacement. Where the logs go (as of ).
Docker reports that a port is already in use
On a bridge network, change the host side of the mapping to an unused port. If you only use chat platforms, you can omit the API mapping. With Linux host networking, check which process already listens on the service's port. Docker networking and troubleshooting (as of ).
Every docker exec fails with “Permission denied”
In images built before late August 2026, /opt/hermes can have mode 0700. Recreate the container with a newer image, or repair the running one with the command below. Install directory permissions (as of ).
docker exec -u root hermes chmod 0755 /opt/hermes
If the container starts but Hermes uses the wrong identity, use the Hermes Setup Fix Kit to check the profile and instructions the gateway loads.
5. Hermes Docker FAQ
Does Windows Docker Desktop need host networking?
No. The official Windows file uses explicit port mappings. Its dashboard mapping accepts connections on 127.0.0.1:9119 on the PC.
Why does localhost fail for my model server?
On a Compose network, localhost reaches the Hermes container itself. Use the other container's name, such as ollama or vllm.
Do I have to publish port 8642 for Telegram or Discord?
No. Publish it when a dashboard or an external tool needs to reach the gateway API or health endpoint. Chat platforms alone can run with the port unpublished.
Does publishing the dashboard only on PC loopback remove sign-in?
No. Docker's host port limits who can connect. The dashboard checks its own bind address inside the container and requires a provider when it binds to 0.0.0.0.
Do desktop Local Models require a Docker gateway?
No. The desktop app manages the runtime and model on your machine. Choose the Docker path if you want a containerized Hermes gateway to use a separate inference server.
FAQ sources · Windows Compose file, Docker guide and Local Models guide (as of ).