A chat agent on your laptop answers while the lid is open. On a server it answers at 2am and can run a job while you sleep, which is the whole point and also the whole risk: a process with shell access that nobody is watching needs a supervisor, a lock on the door, and a backup.
Install
# Official installer: bootstraps the package manager, Python and the launcher
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
# Reload the shell so `hermes` is on PATH
source ~/.bashrc
hermes --version
hermes doctor
hermes doctor is the useful one. It checks the interpreter, the dependencies and the config before you add a provider, so a failure there is not confused with a provider problem later.
Install as your normal user, not root. The default layout is ~/.hermes/ — unless HERMES_HOME says otherwise — and every path below assumes that.
Pick a model
The provider is the step that decides whether any of this works.
hermes model # interactive picker: provider, model, credentials
hermes setup --portal # or: Nous Portal, one sign-in, 300+ models and the tool gateway
Two things worth knowing before you choose:
- Provider, not model, is the risk. A model you picked because a benchmark liked it is no use if the key expires.
hermes fallback addgives you a second provider to fail over to, and a server with no provider at 3am is a server that does nothing. - Secrets go in
.env, settings inconfig.yaml. Do not hand-edit the config to paste a key into it.hermes config set KEY VALUEfor settings; the env file for anything that authenticates.
Verify with one real turn before going further:
hermes chat -q "Reply with the output of \`date -u\` and nothing else."
If that prints a timestamp, the provider, the key and the network all work. Adding the gateway before this passes is how people end up debugging Telegram when the problem is an expired key.
Connect Telegram
Create the bot in Telegram by messaging @BotFather, /newbot, and keep the token it returns. Then either use the guided setup or write the token yourself.
hermes gateway setup # interactive; walks each platform and offers to start the gateway
The token and the allowlist belong in ~/.hermes/.env:
TELEGRAM_BOT_TOKEN=123456789:AA... # anything with this token controls the bot
TELEGRAM_ALLOWED_USERS=12345678,87654321 # your numeric Telegram ID, comma-separated
The allowlist is not optional in practice. A bot token that leaks gives the finder a shell on your server, and the default when no allowlist matches is to deny — keep it that way rather than setting an allow-all flag to make testing quicker.
Send the bot one message and confirm a reply before you install the service. A gateway that is running but unconfigured looks identical to a working one from systemctl.
Keep it running
The foreground command stops when its parent does. The service does not.
hermes gateway install # user service: survives logout, restarts on failure
hermes gateway start
hermes gateway status
# optional: a boot-time system service, needs sudo, survives reboot without a login
sudo hermes gateway install --system
On a headless box, enable lingering so your user services start without a login session:
sudo loginctl enable-linger "$USER"
loginctl show-user "$USER" --property=Linger
Then test the failure you actually care about: reboot the machine, and check that the bot answers without you logging in.
sudo reboot
# after it comes back
hermes gateway status
journalctl --user -u 'hermes-gateway*' -n 50 --no-pager
If it does not come back, the answer is almost always lingering or the unit not being enabled — not the bot token.
Lock it down
An agent with a terminal is a remote shell with a language model attached, and the defaults assume one trusted user on a private machine.
- Run as a non-root user. Root plus a prompt-injected instruction is a wiped server.
- Keep the allowlist short. Numeric IDs, not usernames, and add a second person only if they need it.
chmod 600 ~/.hermes/.envand check the backup file too. A.envin a world-readable directory is the most common own goal on a shared VPS.- Keep approval on for dangerous commands. Hermes asks before things like
rm -rf,sudoand service restarts; turning approval off globally to stop the prompts is trading a minute for an incident. - Run it on a machine where a compromise is contained. Ideally not the machine with your only copy of anything. This is the same argument as everywhere else in this set of guides: a disposable machine is a good place for an agent, a shared one is not.
# A quick audit of what the agent can already reach
sudo ss -tulpn | grep -v 127.0.0.1
ls -l ~/.hermes/.env
Back up and update
hermes backup # one archive of the Hermes home: profiles, memory, skills, sessions, .env
hermes update --check # what a new release would change
hermes update --backup # take a snapshot, then update
The archive contains live credentials. Store it somewhere you would store a private key, not in a public bucket, and not in the repository the agent works on. Restore with hermes import <file>.
Updating restarts the gateway. Do it when you can watch the bot answer afterwards, not at the start of a long unattended job.
Where Cubs fits
On a Cubs machine, install Hermes from Agents & Tools rather than from the shell, then run hermes setup in a terminal to pick a provider. You are a normal user with no passwordless sudo, so the boot-time system service is not available — run hermes gateway in a terminal and leave it there, which is fine because the machine runs until you pause it. Pausing stops the gateway process along with everything else and keeps the disk, so the config, the sessions and the bot token are still there when you resume; the bot simply does not answer while paused, and a message sent in that window is not queued.