How to Run Multiple Separate Hermes Agents on One VPS
Run several separate Hermes setups on one server instead of renting a server for each. Every setup gets its own Docker container, its own memory and its own Telegram bot, and they never mix.
15 steps · 4 parts · copy-paste ready
// Contents
Part 01 / 04 — Prepare the server
Part 02 / 04 — Your first Hermes setup
Part 03 / 04 — Add more setups
Part 04 / 04 — Update Hermes
Prerequisites
- ▸A VPS with Ubuntu (4 GB of RAM is enough to start), or a Mac or Windows PC with Docker Desktop
- ▸A Telegram bot token for each setup, from @BotFather
- ▸Any AI model that works with Hermes
Prepare the server
You do this once per server. It installs Docker and gives you your own user, so you stop working as root. On a Mac or a Windows PC, step 1 shows what to install instead, and you skip steps 2 and 3.
Install Docker
your server, as root
Log in to your server as root and run:
curl -fsSL https://get.docker.com | shInstall Docker Desktop instead: download it from docker.com, open it and accept the terms. In Docker Desktop, open Settings, General and turn on Start Docker Desktop when you sign in. Your setups only run while it runs. Then skip to step 4.
wsl --install --no-distributionOpen Terminal as administrator, run this, then restart the PC.
winget install -e --id Docker.DockerDesktopRestart again, open Docker Desktop and accept the terms. Check it worked with docker ps: you should see a table header, not an error. In Docker Desktop, open Settings, General and turn on Start Docker Desktop when you sign in. Your setups only run while it runs. Then skip to step 4.
Check it worked: docker --version
Create your user
your server, as root
Still as root, run these three lines. They create your user, give it Docker rights, and copy your SSH login over to it.
adduser your-name
usermod -aG sudo,docker your-name && groups your-name
rsync --archive --chown=your-name:your-name ~/.ssh /home/your-nameSkip this step.
The second line should end with sudo and docker in the list, like sam : sam sudo users docker.
Switch to your new user
your server, as root
Switch over (keep the dash):
su - your-nameSkip this step.
Check it worked. You should see a table header, not an error: docker ps
From now on, log in as this user: ssh your-name@your-server-ip
Your first Hermes setup
Each setup runs in its own Docker container with its own memory and its own Telegram bot. Create it, answer a few questions, step inside it, restart it, and check it is connected.
Create a Hermes setup
your server as your user, or your own computer
This creates your first setup in its own container, with its own storage. Use the same name in both places, and leave /opt/data exactly as it is.
docker run -d \
--name your-setup-name \
--restart unless-stopped \
-v your-setup-name:/opt/data \
nousresearch/hermes-agent gateway rundocker run -d --name your-setup-name --restart unless-stopped -v your-setup-name:/opt/data nousresearch/hermes-agent gateway runWrite it on one line. PowerShell does not continue a line with \.
The first time, this downloads about 4.5 GB, so give it a few minutes.
Set it up
your server as your user, or your own computer
Run the setup and answer the questions: your model, your key and your Telegram bot token.
docker exec -it -u hermes your-setup-name hermes setupGo inside your setup
your server as your user, or your own computer
This opens a terminal inside the setup's container, where you can run any hermes command for that setup.
docker exec -it -u hermes your-setup-name bashType exit to come back out to your server before the next step.
Restart it
your server as your user, or your own computer
Restart the setup so it picks up your answers.
docker restart your-setup-nameWait about 20 seconds before the next step.
Check it is connected to Telegram
your server as your user, or your own computer
docker logs your-setup-name 2>&1 | grep "Connected to Telegram"docker logs your-setup-name 2>&1 | Select-String "Connected to Telegram"PowerShell has no grep. Use Select-String instead.
When you see Connected to Telegram (polling mode), message your bot. It answers.
Add more setups
Every extra setup is the same three steps with a new name. They never share memory, files or messages.
Create a second setup
your server as your user, or your own computer
Same command, new name. Change it in both places. Give every setup its own Telegram bot, or two setups will answer the same messages.
docker run -d \
--name your-second-setup-name \
--restart unless-stopped \
-v your-second-setup-name:/opt/data \
nousresearch/hermes-agent gateway rundocker run -d --name your-second-setup-name --restart unless-stopped -v your-second-setup-name:/opt/data nousresearch/hermes-agent gateway runWrite it on one line. PowerShell does not continue a line with \.
Set up the second one
your server as your user, or your own computer
Answer the questions again, this time with the second bot's token.
docker exec -it -u hermes your-second-setup-name hermes setupRestart the second one
your server as your user, or your own computer
docker restart your-second-setup-nameCheck both are running: docker ps
For a third setup and more, repeat these three steps with a new name each time.
Update Hermes
When Hermes releases a new version, download it once, then swap each setup over to it. Its memory, settings and Telegram bot stay: they live in the setup's storage (-v), not in the container.
Download the new version
your server as your user, or your own computer
Once for all your setups.
docker pull nousresearch/hermes-agentSwap a setup over to it
your server as your user, or your own computer
Removes the old container and starts it again with the same command as step 4. Use the same name in both places, exactly as when you created it.
docker rm -f your-setup-name
docker run -d \
--name your-setup-name \
--restart unless-stopped \
-v your-setup-name:/opt/data \
nousresearch/hermes-agent gateway rundocker rm -f your-setup-name
docker run -d --name your-setup-name --restart unless-stopped -v your-setup-name:/opt/data nousresearch/hermes-agent gateway runWrite the docker run line on one line. PowerShell does not continue a line with \.
Do not run hermes update inside a setup: the next update replaces the container and undoes it.
Check it is back on Telegram
your server as your user, or your own computer
Wait about 20 seconds, then:
docker logs your-setup-name 2>&1 | grep "Connected to Telegram"docker logs your-setup-name 2>&1 | Select-String "Connected to Telegram"PowerShell has no grep. Use Select-String instead.
Update one setup first and message its bot. When it answers, do the rest.
Everything on one page
The whole setup in one block, for next time.
# once, as root
curl -fsSL https://get.docker.com | sh
adduser your-name
usermod -aG sudo,docker your-name && groups your-name
rsync --archive --chown=your-name:your-name ~/.ssh /home/your-name
su - your-name
# for each setup (same name everywhere)
docker run -d --name your-setup-name --restart unless-stopped -v your-setup-name:/opt/data nousresearch/hermes-agent gateway run
docker exec -it -u hermes your-setup-name hermes setup
docker restart your-setup-name
# go inside a setup
docker exec -it -u hermes your-setup-name bash
# update: once, then for each setup
docker pull nousresearch/hermes-agent
docker rm -f your-setup-name
docker run -d --name your-setup-name --restart unless-stopped -v your-setup-name:/opt/data nousresearch/hermes-agent gateway runSkip the lines under # once, as root and install Docker Desktop instead (step 1). Everything else works as written, on Windows too.
Everyday commands
Two rules: every command that starts with docker exec gets -u hermes, and docker restart is run from the server, not from inside a setup (type exit first).
docker exec -it -u hermes your-setup-name bashGo inside a setup
Run Hermes commands inside it. Type exit to come back out.
docker restart your-setup-nameRestart a setup
After changing its settings.
docker logs -f your-setup-nameSee what a setup is doing
Live log. Press Ctrl-C to stop watching.
docker stats --no-streamMemory use of all setups
One line per setup.
docker stop your-setup-nameStop a setup
It stays stopped until you start it again.
Also: docker start your-setup-name
docker rm -f your-setup-nameRemove a setup, keep its memory
Create it again later with the same name and it picks up where it left off.
docker volume rm your-setup-nameDelete its memory for good
Run after removing the setup. This cannot be undone.
One setup or several, and how many fit?
Agents that work together as one team belong in one setup. Hermes can run a whole crew inside a single setup. Things that must stay apart, like different clients or work and personal, get one setup each.
Each setup uses about 400 MB of memory. A server with 4 GB of RAM runs 5 to 7 setups, and 8 GB runs 12 to 15.
Common problems and fixes
The bot does not answer: you did not restart after setup. Run docker restart with the setup's name, wait 20 seconds, then send a new message.
A new setup skips the first question and shows your other setup's model: you reused the old name after -v. Remove it with docker rm -f and create it again with the new name in both places.
Permission denied inside a setup: you left out -u hermes. Fix the files with docker exec -u root your-setup-name chown -R hermes:hermes /opt/data.
usermod: group 'docker' does not exist: install Docker (step 1) before creating your user (step 2).
docker: permission denied: log out and back in as your user, or switch with su - your-name (with the dash).
The setup wizard looks frozen: you typed -i instead of -it.
Windows: The term 'grep' is not recognized. PowerShell has no grep. Use Select-String "Connected to Telegram" instead.
Windows: docker run stops at the first line. PowerShell does not continue a line with \. Write the command on one line.
Two setups answer the same messages: they share a Telegram bot token. Give each its own bot.
After an update the setup starts empty, as if new: you used a different name after -v. Remove it and start it again with the old name in both places. Its memory is still there.
Read any command
execRun inside a setup
Runs something inside a setup that is already running.
-itInteractive terminal
Lets you type and see the answers (-i interactive, -t terminal).
-u hermesAs the hermes user
Does it as the hermes user, not as root.
run -dCreate, in the background
run creates a new setup, -d keeps it running in the background.
pullGet the newest version
Downloads the newest version of Hermes.
--restart unless-stoppedSurvives reboots
Starts it again after a crash or a server reboot.
-v name:/opt/dataIts own storage
Where the setup's memory lives. One per setup.
-fFollow or force
In docker logs it keeps showing new lines. In docker rm it removes even while running.
// What you're building toward
One server running as many separate Hermes setups as you need, each with its own memory and its own Telegram bot, all restarting on their own after a reboot.
Stuck on a step? Drop a comment on the video, or book a session and we'll walk through it together.
Usage & License
Use the prompts and downloadable templates on this page in your own personal and commercial projects. What's not allowed: reselling, repackaging, redistributing, or republishing this material — on YouTube, Gumroad, paid courses, newsletters, or anywhere else. Send people to komputermechanic.com instead. Violations get reported and taken down.