Deploy Hermes Agent with Docker and connect a Telegram bot
Run Nous Research's Hermes Agent in Docker with a persistent data folder, pick a model provider, connect a BotFather bot, restrict who can use it and start the gateway in the background.
Verification
- Test environment
- Unknown
- Tested on
- Unknown
- Last updated
- 2026-11-20
Hermes Agent from Nous Research is an agent that automates tasks, runs several sub-agents in parallel and supports scheduled (cron) jobs. The author found it easier to use than OpenClaw. This guide runs it in Docker, keeps its data in a persistent folder so updates don't wipe it, and connects it to Telegram.
The commands assume a Linux host or WSL2 with Docker installed (follow Docker's official install instructions) and docker version working.
1. Create the data folder and run setup
mkdir -p ~/.hermes
docker run -it --rm \
-e HERMES_UID="$(id -u)" \
-e HERMES_GID="$(id -g)" \
-v "$HOME/.hermes:/opt/data" \
nousresearch/hermes-agent setup
The bind mount keeps configuration, credentials, sessions and memories in ~/.hermes on the host.
2. Choose a provider, model and terminal backend
Choose Full setup; move with the arrow keys and select with Space or Enter. Pick a provider, or Custom endpoint to enter your own compatible API's base URL and key, then a default model (you can switch later in chat). In this container setup a local terminal backend runs commands inside the Hermes container, not on your host; the separate Docker backend is a different arrangement you don't need here.
3. Create and connect the Telegram bot
- In Telegram, message @BotFather and send
/newbot. - Pick a display name and a username ending in
bot. - Copy the token BotFather returns.
- In Hermes' platform list, highlight Telegram, press Space, confirm with Enter, choose to enter a token and paste it.
Before starting, restrict who can use the bot: an authorized chat can trigger tools and terminal commands. In ~/.hermes/.env set:
TELEGRAM_ALLOWED_USERS=YOUR_NUMERIC_TELEGRAM_USER_ID
Keep the bot token and API keys private.
4. Pick optional tools
Tick only the CLI tools you need; paid services need their own keys. For browsing choose a local or hosted browser option. Image generation can be skipped. For search, DuckDuckGo via ddgs is free; Tavily is another option with a free quota. Microsoft Edge TTS gives free spoken replies (it reads text aloud; transcribing voice messages needs a separate speech-to-text provider).
5. Start the gateway in the background
docker run -d \
--name hermes \
--restart unless-stopped \
-e HERMES_UID="$(id -u)" \
-e HERMES_GID="$(id -g)" \
-v "$HOME/.hermes:/opt/data" \
nousresearch/hermes-agent gateway run
Telegram alone needs no published port (the original also mapped 8642 for the gateway API, which is optional). Check it with docker ps --filter name=hermes and docker logs --tail 100 hermes, then message your bot from the allowed account; a real reply confirms the setup. Back up ~/.hermes and run only one gateway container per data folder.
Adapted from the XMLans blog: Hermes Agent Docker Setup with Telegram: A Practical Guide (Chinese original: Hermes Agent Docker部署小教程).
Sources
- Hermes Agent Docker部署小教程(星梦博客)www
.xmlans .com (opens in a new tab) · checked 2026-11-20 - Hermes Agent Docker Setup with Telegram: A Practical Guide (XMLans blog)en
.xmlans .com (opens in a new tab) · checked 2026-11-20