# How to run Hermes Agent 24/7 on a VPS or home server

> Keep Hermes Agent online around the clock: install the gateway as a service, enable linger or a system service, and lock it down before going public.

Canonical: https://hermeswatcher.com/learn/run-hermes-agent-24-7  
Section: Learn · Running & deploying  
Last reviewed: Oct 28, 2026  
Basis: Explained from the official Hermes Agent docs and repository (Nous Research). Steps follow the linked official sources.

## Short answer

Yes. The part of Hermes that stays online is the messaging gateway: one background process that connects your chat apps to the agent. To run it 24/7, install it as a service on a machine that stays on.

The README says you can run Hermes on a $5 VPS. The docs' Team Telegram tutorial agrees that a $5 a month VPS is plenty for the gateway, because the model calls happen remotely. It also says to use a server, not your laptop, since the bot needs to stay running.

- Linux VPS or home server: the most direct route. Install Hermes with the Linux installer, then install the gateway as a service.
- Docker: run the gateway container with a restart policy.
- Mac or Windows PC: the gateway can start at login, but it only runs while the computer is on and you are logged in.

## What you need

- Hermes installed and working in the CLI first. See /learn/install-hermes-agent-linux or /learn/install-hermes-agent-docker.
- At least one chat app set up with `hermes gateway setup`. See /learn/messaging-gateway-explained.
- For sizing, the only documented figures are Docker's: 1 GB of memory minimum, at least 2 GB with browser tools.
- SSH access to the server. The docs warn that browser-based VPS consoles mangle characters like `:` and `@` when you paste commands.

## Linux: install the gateway as a service

These commands are from the official Messaging Gateway page:

bash:

```
hermes gateway install               # Install as user service
hermes gateway start                 # Start the service
hermes gateway stop                  # Stop the service
hermes gateway status                # Check status
journalctl --user -u hermes-gateway -f  # View logs

# Enable lingering (keeps running after logout)
sudo loginctl enable-linger $USER

# Or install a boot-time system service that still runs as your user
sudo hermes gateway install --system
sudo hermes gateway start --system
sudo hermes gateway status --system
journalctl -u hermes-gateway -f
```

Which one? The docs say to use the user service on laptops and dev boxes, and the system service on a VPS or headless host that should come back at boot without relying on linger.

There is a trade-off. A system service needs root for every restart, including the automatic restart after `hermes update`. For a headless machine you never log into, the docs say a user service plus `sudo loginctl enable-linger $USER` also starts at boot and lets updates restart the gateway with no root at all.

Do not add a custom `ExecStopPost` kill rule to the systemd unit. The docs say it causes an endless restart loop.

## Docker: use a restart policy

Run the gateway as the container's main process, with a restart policy. The official command:

sh:

```
docker run -d \
  --name hermes \
  --restart unless-stopped \
  -v ~/.hermes:/opt/data \
  -p 8642:8642 \
  nousresearch/hermes-agent gateway run
```

Inside the image, the gateway is also supervised. If it crashes, it restarts within a couple of seconds without losing the container. Leave out `-p 8642:8642` if you only use chat apps. Never run two gateway containers on the same data folder.

## Mac and Windows PCs

- Mac: `hermes gateway install` creates a launchd agent that starts the gateway when you log in. Logs are in `~/.hermes/logs/gateway.log`.
- Windows: `hermes gateway install` registers a Scheduled Task called `Hermes_Gateway` that runs at login, with no admin needed. If the gateway is killed from outside, it stays down until you run `hermes gateway start`.
- WSL2: the WSL VM shuts down when idle. The docs suggest keeping WSL alive with a Task Scheduler entry, or running `hermes gateway run` inside tmux. They also say WSL's systemd support is unreliable.

The official docs do not give power or sleep settings. The gateway only answers while the machine is awake and you are logged in, so a VPS is the simpler choice for true 24/7.

## Updates and security

- `hermes update` pauses and restarts running gateways for you. You can also send `/update` from a supported chat app. The docs say the bot goes offline for about 5 to 15 seconds during the restart.
- By default the gateway ignores anyone who is not on an allowlist or paired by DM. Keep it that way.
- Do not open ports without auth. The docs warn that opening any port on an internet-facing machine is a security risk, and the dashboard requires an auth provider on any non-local address.
- Use SSH, not a browser console. OAuth logins that redirect to `127.0.0.1` need an SSH tunnel when Hermes runs on a remote server.

Read /learn/security-model-approvals-and-sandboxing and /learn/keeping-costs-under-control before you leave an agent running unattended.

## Next step

Next: give your always-on agent a job, such as the daily research briefing workflow. If the bot goes quiet, start with /troubleshoot/gateway-bot-not-responding.

## Related tools

- [Know whether an automation actually worked](https://hermeswatcher.com/workflows/reliable-recurring-automation.md)
- [Wake up to a useful research briefing](https://hermeswatcher.com/workflows/daily-research-briefing.md)
- [Deployment: separate the agent host from its execution sandbox](https://hermeswatcher.com/tools/deployment.md)
- [Telegram: reach Hermes from a private bot conversation](https://hermeswatcher.com/tools/telegram.md)
- [Scheduled tasks: automate a proven run](https://hermeswatcher.com/tools/scheduling.md)
- [Command approvals: decide what the agent may run unattended](https://hermeswatcher.com/tools/approvals-security.md)

## Sources

- [Messaging Gateway](https://hermes-agent.nousresearch.com/docs/user-guide/messaging)
- [Hermes Docker Setup](https://hermes-agent.nousresearch.com/docs/user-guide/docker)
- [Updating & Uninstalling](https://hermes-agent.nousresearch.com/docs/getting-started/updating)
- [Tutorial: Team Telegram Assistant](https://hermes-agent.nousresearch.com/docs/guides/team-telegram-assistant)
- [Windows (Native) Guide](https://hermes-agent.nousresearch.com/docs/user-guide/windows-native)
- [Windows (WSL2) Guide](https://hermes-agent.nousresearch.com/docs/user-guide/windows-wsl-quickstart)
- [OAuth over SSH / Remote Hosts](https://hermes-agent.nousresearch.com/docs/guides/oauth-over-ssh)
- [Hermes Agent README](https://github.com/NousResearch/hermes-agent)

---

HermesWatcher is an independent guide. It is not affiliated with or endorsed by Nous Research. The [official Hermes Agent documentation](https://hermes-agent.nousresearch.com/docs) and [repository](https://github.com/NousResearch/hermes-agent) from Nous Research are the authority; each page here lists the official sources it was written from. If this site and the official docs disagree, trust the official docs. Index for agents: https://hermeswatcher.com/llms.txt
