Guide
How to Stop, Start and Restart the Hermes Agent Gateway
The gateway is the long-running Hermes process that keeps your bot connected to Telegram, Discord, Slack and the rest. You stop it with hermes gateway stop — but what that command does depends on whether the gateway runs in a terminal, as a background service, under a profile, or inside Docker. This guide covers each case.
The Short Answer
hermes gateway stop # stop this profile's gateway
hermes gateway start # start the installed background service
hermes gateway restart # stop, then start again
hermes gateway status # is it running, and under what?If you started the gateway in the foreground with hermes gateway run, pressing Ctrl+C in that terminal stops it too.
What hermes gateway stop Actually Does
Hermes checks how the gateway is being run and stops it through the right mechanism:
- Installed as a service (
hermes gateway install): it stops the systemd unit on Linux, the launchd agent on macOS, or the Scheduled Task (or Startup-folder launcher) on Windows. - Started by hand: it signals the gateway process recorded in the profile's
gateway.pidfile and prints✓ Stopped gateway for this profile. If nothing is running you get✗ No gateway running for this profile. - Inside the official Docker image: the request goes through the s6 process supervisor. That matters because a bare
pkilllooks like a crash to the supervisor, which restarts the gateway straight away.
Two flags widen or redirect it. --all signals gateway processes across every profile on the machine. --system targets a Linux system-level service (installed with hermes gateway install --system) instead of the default per-user one, and needs root.
Stopping a Service with systemctl or launchctl
The Hermes commands are the safest route, because they also record that the stop was planned. If you manage services directly, the names are:
- Linux (systemd): a user unit called
hermes-gateway, orhermes-gateway-<profile>for a named profile — sosystemctl --user stop hermes-gateway. - macOS (launchd): the label
ai.hermes.gateway, orai.hermes.gateway-<profile>.
A systemd stop waits up to 90 seconds. If the gateway is still shutting down after that, Hermes says so and tells you to check hermes gateway status rather than hanging.
Profiles and the Shared Host Gateway
Each Hermes profile can have its own gateway, so name the profile when you mean a specific one:
hermes -p researcher gateway stop
hermes gateway list # every profile and its gateway statusNewer installs can instead run one host gateway that serves several profiles. In that setup, hermes -p researcher gateway stop parks that profile: its bots and cron jobs stop while the host gateway keeps serving every other profile. gateway start unparks it, and gateway restart restarts just that profile.
Graceful Stop vs. Interrupting Work
A stop does not wait for a long chat turn to finish. The default agent.restart_drain_timeout is 0, so active chat turns are not waited for (although they can be held briefly while cron work drains). Hermes treats an interrupted chat as recoverable and tells the user. Scheduled cron runs are different: an interrupted run is recorded as a failure, so they get up to agent.cron_drain_timeout (30 seconds by default) to finish first.
For a restart that waits for in-flight work, send /restart to the bot from a connected chat where you are allowed to run commands. It drains active runs before restarting, waiting up to agent.restart_after_turn_timeout (1,800 seconds by default).
One more guard: Hermes refuses gateway stop and gateway restart when they run from inside the gateway itself — for example, when the agent tries it through its own terminal tool. A bot that stops its own gateway would cut off the conversation that asked it to. Use /restart instead.
Stopping Hermes in Docker
The upstream docker-compose.yml runs the gateway in a container named hermes with the command gateway run. Stop the container itself:
docker stop hermes
# or, from the compose directory
docker compose stopInside the container, hermes gateway stop and hermes gateway restart go through the s6 supervisor: stop leaves the gateway stopped and restart restarts it, while the container itself keeps running.
When Two Gateways Are Running
The most common reason people go looking for a stop command is a second gateway they did not mean to start. Two gateways polling the same Telegram bot token fight over updates, and Telegram reports Conflict: terminated by other getUpdates request. Hermes also refuses to start a second gateway on the same host: it attaches to the running one, or refuses with A gateway already owns this host (PID …).
hermes gateway statusshows what is running and which service manager owns it.hermes gateway stop --allsignals gateway processes across profiles. Stop any installed service explicitly too, or its supervisor may start it again.hermes gateway run --replacereplaces an unsupervised instance in one step; for a supervised one, usehermes gateway restart.
After a Config Change: Restart, Don't Stop
Edits to .env or platform settings take effect after hermes gateway restart. You do not need to restart for a model change: switching with hermes model applies to new sessions.
On OpenClaw Launch
Managed Hermes bots on OpenClaw Launch have Stop, Start and Restart buttons on the dashboard, so you never manage the gateway process yourself. The bot runs supervised, comes back on its own after a crash, and there is only ever one gateway per bot.
On OpenClaw
OpenClaw has its own gateway with different commands, service names and Docker layout — see How to Stop the OpenClaw Gateway. The two are separate processes and do not share a stop command.
Frequently Asked Questions
How do I stop the Hermes Agent gateway?
Run hermes gateway stop. It stops the installed systemd, launchd or Windows background task, or the gateway process for the current profile if you started it by hand. Use --all to signal gateways across every profile.
What is the difference between hermes gateway run and hermes gateway start?
run keeps the gateway in the foreground of your terminal (inside the official Docker image it hands off to the s6 supervisor instead, unless you pass --no-supervise). start starts the background service you installed with hermes gateway install.
Does stopping the gateway delete my chats or memory?
No. The gateway only holds connections. Sessions, memory, skills and config stay in your Hermes home directory and load again when the gateway starts.
Is this the same as stopping OpenClaw?
No. OpenClaw and Hermes Agent are different frameworks with their own gateway commands. This guide is about Hermes; the OpenClaw version is linked above.
Related Guides
- Hermes Agent Errors Cheat Sheet — pairing, provider and gateway errors with fixes
- Hermes Agent Gateway Token Setup — securing the dashboard and API
- Hermes Agent with Docker Compose — the container setup this guide refers to
- How to Stop the OpenClaw Gateway — the OpenClaw equivalent