LinuxPublished on September 21, 202619 min read

Install Hermes Agent on a Linux VPS: secure deployment and 24/7 operation

Hermes Agent is an open source AI agent built by Nous Research. This guide shows you how to install Hermes Agent on a VPS running Debian or Ubuntu. The agent runs permanently under a dedicated account, even when your own computer is off. You need an account with sudo, reachable with an SSH key, and an API key from a model provider.

This guide covers the Hermes Agent project by Nous Research, released under the MIT license. Do not confuse it with other products named Hermes. The commands follow the official documentation as of November 2026 (version 0.22).

Understand what you are installing

Hermes Agent does more than chat. It uses tools, runs commands, keeps a memory, schedules tasks and answers from Telegram or Discord. That flexibility carries more risk than a regular chatbot. An agent that runs commands must not run as root. It must not answer the whole Internet either, or leave its API keys in a world-readable file.

By the end of this guide, the setup will look like this.

  • Hermes Agent runs as an unprivileged Linux user named hermes.

  • Configuration, sessions and secrets stay in /home/hermes/.hermes/.

  • The AI model comes from the service you choose, or from a compatible endpoint you run yourself.

  • The messaging gateway runs as a systemd user service and restarts with the server.

  • Only the Telegram, Discord or other accounts you have approved can talk to the agent.

  • No Hermes admin port is open to the Internet.

Hermes Agent is free and open source. The model provider, however, may charge for usage. The project does not ship a large language model that can run on a small VPS. Cost and request handling therefore depend on the provider you pick.

Before installing an autonomous agent, apply the server security basics. The guide Secure a Linux VPS covers updates, SSH key access, the firewall, backups and logs. For key-based login, follow Set up an SSH key on a Linux VPS.


Size the VPS

The official installation docs support Linux. The script needs Git, curl, tar and a SHA-256 tool. It then provides Python 3.14, Node.js, ripgrep and FFmpeg itself, in pinned versions.

Hermes does not publish minimum hardware specs, because needs vary with the tools you enable. The figures below are operating guidelines, not official requirements.

UsevCPUMemoryStorageNote
CLI and gateway with a remote model24 GB25 GB NVMeReasonable baseline for personal use
Browsing, audio or several sessions48 GB50 GB NVMeMore headroom for Chromium and parallel tasks
Model running on the serverVariesVariesVariesDepends on the model, often with a GPU

A small VPS is enough when the model runs behind an API. It can fall short if the agent starts a browser, handles large files or runs several tasks at once. Watch memory, disk and processes after a few days of real use.


Update the system

Log in to the VPS with your admin account. Refresh the package lists and upgrade the installed packages.

sudo apt update
sudo apt upgrade

Then install the prerequisites. According to the docs, the Node.js shipped with Hermes needs libatomic1, which minimal Debian and Ubuntu images lack. The installer can add it, but only with sudo, which the agent account will not have. unzip is used later to check backups.

sudo apt install ca-certificates curl git tar libatomic1 unzip

Check that the commands respond.

git --version
curl --version
tar --version
sha256sum --version

If a kernel or core system update asks for a reboot, reboot before going further. That way you will not debug Hermes while the server still runs old libraries.


Create a dedicated Linux account

Do not install Hermes in /root, and do not run its gateway as the superuser. The official production checklist calls for a non-root account.

Create a user named hermes.

sudo adduser --disabled-password --gecos "" hermes

Recent adduser versions, such as the one in Debian 13, replace the --gecos option with --comment. If the command rejects --gecos, write --comment "" instead.

Do not add it to the sudo group. Do not add it to the docker group either without weighing the consequences. Direct access to the Docker socket gives, in practice, root-level rights on the server.

To manage this account over SSH, install only the public key you want. If the ~/.ssh/authorized_keys file of your current account holds the right key, copy it like this.

sudo install -d -m 0700 -o hermes -g hermes /home/hermes/.ssh
sudo install -m 0600 -o hermes -g hermes \
  ~/.ssh/authorized_keys /home/hermes/.ssh/authorized_keys

Check the permissions.

sudo ls -ld /home/hermes /home/hermes/.ssh
sudo ls -l /home/hermes/.ssh/authorized_keys

Next, let user services keep running after logout. This is called lingering. The Hermes systemd service can then start with the server, with no SSH session open.

sudo loginctl enable-linger hermes

Check the result. The expected output is Linger=yes.

loginctl show-user hermes -p Linger

Now open a new SSH connection with this account. Replace 203.0.113.10 with the Main IP shown on the VPS page in the client area.

ssh hermes@203.0.113.10

Unless stated otherwise, every following command runs from this session, without sudo.


Download and review the official installer

Hermes publishes a quick install command.

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

It is handy, but it pipes the downloaded script straight into the shell. On a server, keep download and execution apart. You can then read the script and record the exact fingerprint of the file you ran.

Download the installer from the official domain.

curl --proto '=https' --tlsv1.2 -fsSLo /tmp/hermes-install.sh \
  https://hermes-agent.nousresearch.com/install.sh

Show its SHA-256 fingerprint, then read its content.

sha256sum /tmp/hermes-install.sh
less /tmp/hermes-install.sh

The fingerprint identifies the file you reviewed and documents your deployment. On its own, it does not prove the publisher signed it. At a minimum, check that the script comes from the official domain and sends nothing to an unexpected destination. Its paths should also match the docs.

When run in a terminal, the script then opens the setup wizard, followed by the messaging wizard. You can answer now, or skip them and come back in the next steps.

Install without the browser

If the agent does not need to drive Chromium or control a screen, install less software.

bash /tmp/hermes-install.sh --skip-browser --skip-computer-use

This mode suits a bot that relies on a remote model, APIs and text tools. Hermes remembers this choice, and updates do not add these tools back. To add them later, use these two commands.

hermes pm install chromium
hermes pm install cua-driver

Install with the browser

To use local browsing, run the script without these options.

bash /tmp/hermes-install.sh

The script installs Chromium (Chrome for Testing) and the computer-use driver in the account's home. On Linux, Chromium also needs system libraries, which the script does not install. An administrator must add them from their own account. For Debian and Ubuntu, the official docs give npx playwright install-deps chromium, to run with sudo.

The installer puts things in these locations.

ItemLocation
Project code~/.hermes/hermes-agent/
hermes command~/.local/bin/hermes
Configuration and data~/.hermes/
Install log~/.hermes/logs/install.log

Everything stays in /home/hermes. Run as root, the script would use root's home and put the secrets in /root/.hermes. This guide avoids exactly that.


Check the installation

Reload the shell environment.

source ~/.bashrc

Then check the command path, the version and the overall health.

command -v hermes
hermes --version
hermes doctor

The first result should point to /home/hermes/.local/bin/hermes. hermes doctor checks the environment, the configuration and the dependencies. It also tells you how to fix what is missing. If the script failed, its full log is in ~/.hermes/logs/install.log.

If hermes is still not found, add the folder to your PATH, then reload the shell.

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Always use this installed launcher. Do not call a hard-coded path such as venv/bin/hermes or the ~/.hermes/hermes-agent/hermes file. The docs advise against it, because you would bypass the intended Python environment.


Configure the model provider

Hermes drives a model, but the VPS does not do the inference itself. Start the model picker.

hermes model

You can also go through the full setup wizard.

hermes setup

The project supports many providers and custom endpoints. Choose based on your needs for privacy, cost, data location and tool compatibility. According to the official FAQ, Hermes collects no telemetry. Conversations, memory and skills stay in ~/.hermes/. Model requests, however, go to the provider you configure.

Enter the keys in the wizard. Never put a secret straight into a command. It could stay in the shell history, in the logs of an automation tool or in the process list.

Then lock down the sensitive files that were created.

chmod 700 ~/.hermes
find ~/.hermes -maxdepth 1 -type f \
  \( -name '.env' -o -name 'auth.json' \) \
  -exec chmod 600 {} +

The secrets belong to the hermes account and never go into a Git repository. For business use, the secrets documentation also covers loading them from an external manager such as 1Password or Bitwarden Secrets Manager.

Finally, test a simple request. The --oneshot option makes the agent answer and then exit. Since version 0.21, -q alone opens an interactive session.

hermes chat --oneshot -q "Reply with OK"

If the call fails, check the key, the model name and the credit on your provider account. Also check the server clock and HTTPS access.


Know which data to protect

The ~/.hermes/ folder is the first thing to protect and back up. Depending on the features you use, it holds files such as these.

PathPurposeSensitivity
config.yamlNon-secret settings for the agent and its toolsMedium
.envAPI keys, tokens and secret settingsCritical
auth.jsonLogin credentials for providersCritical
state.dbGateway and session stateHigh
SOUL.mdAgent instructions and identityMedium
memories/Memory kept by the agentHigh
sessions/Session history and contextHigh
pairing/Approved and pending pairingsHigh
skills/Added skillsVaries
cron/Scheduled tasksHigh
logs/Runtime logsVaries

A file without an API key is not public for all that. Conversations, memories and logs can hold business data, internal paths or document excerpts. Restrict access to the hermes account and encrypt backups stored off the server.


Harden the agent configuration

Open the built-in configuration editor.

hermes config edit

These settings make a cautious policy explicit.

approvals:
  mode: smart
  timeout: 300
  cron_mode: deny
  single_query_mode: deny
  unattended_mode: deny

security:
  allow_private_urls: false

Then validate the configuration.

hermes config check

In smart mode, the default, an auxiliary model assesses each command flagged as dangerous. Low-risk commands go through, truly dangerous ones are denied and doubtful cases come to you. manual mode always asks for your approval. off mode, the same as --yolo, removes these prompts. It is not suitable for an agent reachable through messaging on a VPS.

timeout: 300 gives you five minutes to answer a prompt. With no answer, the command is denied. The three deny values cover scheduled tasks, single queries started with -q and APIs with nobody to answer. A dangerous command is then denied instead of being approved automatically.

allow_private_urls: false is the default. Web tools then refuse private ranges, loopback and cloud metadata addresses. Set it to true only if access to the internal network is essential. You are moving a trust boundary when you do.

These mechanisms reduce risk, but they do not turn local execution into a sandbox. A malicious prompt, a compromised tool or a model mistake can still change every file the hermes account can reach.

Run commands in a container

For a production gateway allowed to run code, the docs recommend a separate backend such as Docker.

terminal:
  backend: docker
  docker_forward_env: []
  container_cpu: 1
  container_memory: 2048
  container_disk: 10240
  container_persistent: false

These limits are an example to adapt to the VPS memory and disk. The disk limit only applies with the overlay2 driver on an XFS file system. An empty docker_forward_env list keeps the server's variables away from commands in the container.

With this backend, Hermes no longer asks for approval on dangerous commands. The container acts as the boundary, so it has to be set up properly.

This option assumes a properly hardened Docker install. Do not give the hermes account unchecked access to the Docker socket. To understand its permission model, read Install Docker on a Linux VPS and Docker Compose on a Linux VPS. In a sensitive setting, the SSH backend to a separate worker machine goes further. The gateway and its messaging secrets then stay away from the commands the model produces.


Connect Telegram, Discord or another messaging app

Hermes offers a single gateway for several platforms. Start its wizard.

hermes gateway setup

The wizard asks for each platform's credentials, such as a Telegram or Discord bot token. Create a bot just for the agent and give it only the permissions it needs. Do not reuse a token already used by another app.

Restrict who can talk to the agent

A valid bot token is not enough. You also have to decide who can give the agent instructions. Without an allowlist or open access, Hermes rejects unknown users. Keep this closed-by-default behavior.

There are two methods.

  1. Code pairing. An unknown user who messages the bot gets an 8-character code, valid for one hour. You approve only the request you expect.

  2. An explicit list of allowed IDs, platform by platform.

To see pending and approved pairings, use this command.

hermes pairing list

To approve a Telegram code, pass it like this. Replace ABC12DEF with the code the bot sent. To remove access later, use hermes pairing revoke telegram followed by the account ID.

hermes pairing approve telegram ABC12DEF

For an explicit list, add only the IDs you need to ~/.hermes/.env.

# Numeric IDs of the allowed accounts, comma-separated
TELEGRAM_ALLOWED_USERS=123456789
DISCORD_ALLOWED_USERS=111222333444555666

Never set GATEWAY_ALLOW_ALL_USERS=true in production, nor a per-platform equivalent such as DISCORD_ALLOW_ALL_USERS=true. Anyone who can reach the bot could use the agent, spend your model budget and trigger its tools.

After each change to .env, check its permissions again.

chmod 600 ~/.hermes/.env

Install the gateway as a systemd service

Install the user service that ships with Hermes.

hermes gateway install
hermes gateway start
hermes gateway status

Thanks to the lingering you enabled earlier, the service keeps running after you close the SSH session and restarts with the VPS. Check that it is enabled.

systemctl --user is-enabled hermes-gateway
systemctl --user is-active hermes-gateway

Read the latest log lines.

journalctl --user -u hermes-gateway -n 100 --no-pager

To follow events live, add the -f option.

journalctl --user -u hermes-gateway -f

The docs also offer a system service, installed with sudo hermes gateway install --system. The hermes account has no sudo, so the user service is the right choice here. hermes update can then restart the gateway without any extra rights. Never install a user unit and a system unit for the same profile. Two gateways would then fight over the same bot.

Add a systemd watchdog

The gateway already watches its own event loop. If the loop freezes, the process exits and systemd starts it again. As an option, systemd can also restart the gateway when its heartbeats stop. Add this setting to ~/.hermes/config.yaml.

gateway:
  systemd_watchdog_seconds: 120

Then regenerate the unit and restart the gateway.

hermes gateway install --force
hermes gateway restart
hermes gateway status

The value 120 sets the delay to two minutes. This watchdog catches a stuck process. It does not monitor the connection to Telegram, Discord or the model provider.


Do you need to open a firewall port?

For a standard Telegram or Discord bot, the gateway makes its own outbound connections. You have no Hermes port to publish on the Internet. The firewall can therefore allow only the services you want, starting with SSH. You set it inside the VPS operating system, since the client area has no network firewall for VPS. The guide How to set up the UFW firewall on Ubuntu or Debian explains these rules.

Do not open a port just because it shows up in a Docker example or API docs. Server interfaces and the dashboard widen the attack surface. The dashboard can even read and edit your .env file. For any web interface, follow these rules.

  • Bind it to 127.0.0.1 rather than 0.0.0.0.

  • Reach it through an SSH tunnel or a VPN.

  • Or put it behind an HTTPS reverse proxy with strong authentication.

  • Never treat a hidden port number as access control.

A local SSH tunnel follows this principle.

ssh -L 9119:127.0.0.1:9119 hermes@203.0.113.10

This tunnel does not start the dashboard. It makes a service already bound to loopback reachable from your computer. Started with hermes dashboard --no-open, the dashboard listens on 127.0.0.1:9119 by default. If you publish an app through Nginx or Apache, also encrypt the traffic with TLS. The guide Certbot: install a Let's Encrypt SSL certificate on a VPS shows how.


Back up Hermes, secrets included

A backup of the whole VPS is still useful. The automatic VPS backup option makes a full copy every night, kept outside the server. It is a paid option, described in How to set up automatic VPS backups. A Hermes export on top of that makes it easier to restore on another machine.

hermes backup

According to the official migration procedure, this command creates a hermes-backup-<date>.zip archive in the home folder. It holds the configuration, the API keys (.env and auth.json), memories, sessions, skills and profiles. The project code, downloaded tools and browser profiles are left out.

The command exits with an error if files are missing from the archive, with the message "Backup incomplete". By default, it keeps only the three most recent archives in the folder.

This archive is therefore a critical secret. Once it exists, follow these steps.

  1. Check that it exists and that its size makes sense.

  2. Test its integrity with unzip -t.

  3. Copy it to storage outside the VPS. The guide Rclone: cloud sync on a Linux VPS shows how.

  4. Encrypt it at rest.

  5. Set a retention period.

  6. Delete the local copy once you no longer need it.

Here is a sample check. Replace the name with the one of the archive actually created. Do not use a wildcard in a restore command if several archives exist.

ls -lh ~/hermes-backup-*.zip
unzip -t ~/hermes-backup-2026-11-04-103000.zip

A restore runs on an existing Hermes install. Stop the gateway first, as the docs require.

hermes gateway stop
hermes import ~/hermes-backup-2026-11-04-103000.zip
hermes setup
hermes doctor
hermes gateway start

Test this procedure now and then on a temporary VPS or a separate machine. An untested backup is only a hope.

hermes profile export is not a substitute for hermes backup. A profile export strips credentials on purpose, while the full backup includes them. The export is for sharing a clean profile, the backup for recovering after an incident.


Update Hermes safely

An install made with the script follows the stable channel, meaning the releases published on GitHub. Still, avoid blind automatic updates on a gateway that runs tools. First see what is available and what would be affected.

hermes update --check
hermes update --plan

--check compares your version with the latest release, without touching the code, the dependencies or the gateway. --plan lists the install, the running services and how each one would restart. Both options are safe on a live instance.

For an important instance, ask for a full backup before the update.

hermes update --backup

The update documentation describes what this does. It updates the code and dependencies, migrates the configuration and restarts the gateways it finds. All output is copied to ~/.hermes/logs/update.log, and a detailed receipt goes to ~/.hermes/logs/update_receipts/. The full backup is stored in ~/.hermes/backups/. If your SSH connection drops midway, the update carries on. Read this log afterwards to see whether it finished.

Then check the state of the install.

cd ~/.hermes/hermes-agent
git status --short
hermes doctor
hermes --version
hermes gateway status
hermes pm status

Empty output from git status --short means the code has no local changes. If files show up although you never touched the code, review them before any further update. hermes pm status shows the state of the dependencies and any failed steps.

To get a full backup on every update, add this setting to ~/.hermes/config.yaml.

updates:
  pre_update_backup: full

By default, with the quick value, Hermes copies only its state files before an update. Keep an off-server copy either way. An archive left on the VPS protects you neither from losing the server nor from a compromised account.


Monitor and troubleshoot the installation

Keep this short set of checks at hand.

hermes doctor
hermes config check
hermes gateway status
journalctl --user -u hermes-gateway -n 200 --no-pager
df -h
free -h

It covers most incidents. It spots an invalid configuration, a stopped service or a platform error. It also shows a full disk or a lack of memory.

The hermes command is not found

Reload ~/.bashrc and check the path.

source ~/.bashrc
printf '%s\n' "$PATH"
ls -l ~/.local/bin/hermes

The gateway stops after SSH logout

Check lingering from the admin account.

loginctl show-user hermes -p Linger

Turn it back on if needed.

sudo loginctl enable-linger hermes

The bot answers the wrong people, or nobody

Check the pairings and the access variables.

hermes pairing list
grep -E '^(TELEGRAM|DISCORD|GATEWAY)_ALLOW' ~/.hermes/.env

This grep shows the allowlists and any open-access flags, but not the tokens. Still, review your terminal before pasting its output into a ticket.

The configuration no longer matches after an update

Use the built-in check and migration tools.

hermes config check
hermes config migrate

Read the proposed changes before accepting them, then run hermes doctor again.

The model call fails

Common causes are an invalid key, a model you are not allowed to use, no credit left, a wrong endpoint or a DNS problem. Test DNS resolution and HTTPS without showing the key.

getent hosts hermes-agent.nousresearch.com
curl -I https://hermes-agent.nousresearch.com/

Then reconfigure the provider with hermes model rather than editing a secret blindly.

The browser does not start

Run hermes doctor. If Chromium is missing, install it with hermes pm install chromium. Its system libraries are installed from the admin account, while the browser and its profile stay with the hermes account. Do not give the service account sudo to fix this.


Check everything before going live

Before you let the agent run permanently, confirm each point.

  • Hermes runs as the unprivileged hermes user, never as root.

  • The hermes account is not in the sudo group, nor in the docker group without a reason.

  • The install script came from the official domain and was read before it ran.

  • hermes doctor reports no error you do not understand.

  • The .env and auth.json files are readable by their owner only.

  • Messaging accounts go through pairing or an explicit list.

  • No open access is enabled, neither GATEWAY_ALLOW_ALL_USERS nor a per-platform equivalent.

  • The approval mode is not set to off.

  • Unattended tasks deny dangerous commands.

  • Private URLs stay blocked unless there is a documented need.

  • No dashboard or API port is exposed directly to the Internet.

  • Full backups are encrypted, copied off the server and tested.

  • Updates are previewed, preceded by a backup and checked afterwards.

  • Logs, disk space and memory are monitored.


Need help?

Open a ticket from Tickets › Open a Ticket, or from the Contact support tile at the bottom of the VPS page. You can also ask your question on the OuiHeberg Discord.

Was this article helpful?

268 views
Share this article
VPS Linux
Need a Linux VPS?

Root access, your choice of distribution and management from the OuiHeberg client area.

View plans →

Related Articles