HomeTutorialsSeparate Hermes Agents on One VPS
    AI Agents // Hermes

    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

    1.9kbuilders viewed
    — Watch the Full Tutorial

    // Contents

    WHAT YOU'LL NEED

    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
    Each step shows the systems it works on. Where a Mac or Windows needs something different, that version is right under the step's command.

    All 15 steps are . Or skip the setup:

    Membership

    Build beyond this tutorial

    • 3 paid tutorials of your choice today
    • Every new tutorial, the day it drops
    • One-line auto-installers for what you unlock
    • Private members Telegram
    • Priority inbox, reply within 24h

    $10/month. $20 covers your first 2 months.

    Become a member

    Get all 15 steps by email

    No card needed.

    Want them as a single Markdown file? We'll email you a 6 digit code to confirm.

    Part 01 / 04

    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.

    STEP 1

    Install Docker

    your server, as root

    Linux

    Log in to your server as root and run:

    Linux
    curl -fsSL https://get.docker.com | sh
    Mac

    Install 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.

    Windows, as admin
    wsl --install --no-distribution

    Open Terminal as administrator, run this, then restart the PC.

    Windows, after restart
    winget install -e --id Docker.DockerDesktop

    Restart 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

    STEP 2

    Create your user

    your server, as root

    Linux

    Still as root, run these three lines. They create your user, give it Docker rights, and copy your SSH login over to it.

    Linux
    adduser your-name
    usermod -aG sudo,docker your-name && groups your-name
    rsync --archive --chown=your-name:your-name ~/.ssh /home/your-name
    Mac and Windows

    Skip this step.

    The second line should end with sudo and docker in the list, like sam : sam sudo users docker.

    STEP 3

    Switch to your new user

    your server, as root

    Linux

    Switch over (keep the dash):

    Linux
    su - your-name
    Mac and Windows

    Skip 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

    Part 02 / 04

    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.

    STEP 4

    Create a Hermes setup

    your server as your user, or your own computer

    LinuxMacWindows

    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.

    Linux / Mac
    docker run -d \
      --name your-setup-name \
      --restart unless-stopped \
      -v your-setup-name:/opt/data \
      nousresearch/hermes-agent gateway run
    Windows (PowerShell)
    docker run -d --name your-setup-name --restart unless-stopped -v your-setup-name:/opt/data nousresearch/hermes-agent gateway run

    Write 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.

    STEP 5

    Set it up

    your server as your user, or your own computer

    LinuxMacWindows

    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 setup
    STEP 6

    Go inside your setup

    your server as your user, or your own computer

    LinuxMacWindows

    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 bash

    Type exit to come back out to your server before the next step.

    STEP 7

    Restart it

    your server as your user, or your own computer

    LinuxMacWindows

    Restart the setup so it picks up your answers.

    docker restart your-setup-name

    Wait about 20 seconds before the next step.

    STEP 8

    Check it is connected to Telegram

    your server as your user, or your own computer

    LinuxMacWindows
    Linux / Mac
    docker logs your-setup-name 2>&1 | grep "Connected to Telegram"
    Windows (PowerShell)
    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.

    Part 03 / 04

    Add more setups

    Every extra setup is the same three steps with a new name. They never share memory, files or messages.

    STEP 9

    Create a second setup

    your server as your user, or your own computer

    LinuxMacWindows

    Same command, new name. Change it in both places. Give every setup its own Telegram bot, or two setups will answer the same messages.

    Linux / Mac
    docker run -d \
      --name your-second-setup-name \
      --restart unless-stopped \
      -v your-second-setup-name:/opt/data \
      nousresearch/hermes-agent gateway run
    Windows (PowerShell)
    docker run -d --name your-second-setup-name --restart unless-stopped -v your-second-setup-name:/opt/data nousresearch/hermes-agent gateway run

    Write it on one line. PowerShell does not continue a line with \.

    STEP 10

    Set up the second one

    your server as your user, or your own computer

    LinuxMacWindows

    Answer the questions again, this time with the second bot's token.

    docker exec -it -u hermes your-second-setup-name hermes setup
    STEP 11

    Restart the second one

    your server as your user, or your own computer

    LinuxMacWindows
    docker restart your-second-setup-name

    Check both are running: docker ps

    For a third setup and more, repeat these three steps with a new name each time.

    Part 04 / 04

    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.

    STEP 12

    Download the new version

    your server as your user, or your own computer

    LinuxMacWindows

    Once for all your setups.

    docker pull nousresearch/hermes-agent
    STEP 13

    Swap a setup over to it

    your server as your user, or your own computer

    LinuxMacWindows

    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.

    Linux / Mac
    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 run
    Windows (PowerShell)
    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 run

    Write 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.

    STEP 14

    Check it is back on Telegram

    your server as your user, or your own computer

    LinuxMacWindows

    Wait about 20 seconds, then:

    Linux / Mac
    docker logs your-setup-name 2>&1 | grep "Connected to Telegram"
    Windows (PowerShell)
    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.

    STEP 15

    Everything on one page

    LinuxMacWindows

    The whole setup in one block, for next time.

    Linux
    # 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 run
    Mac and Windows

    Skip the lines under # once, as root and install Docker Desktop instead (step 1). Everything else works as written, on Windows too.

    // Cheat sheet

    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 bash

    Go inside a setup

    Run Hermes commands inside it. Type exit to come back out.

    docker restart your-setup-name

    Restart a setup

    After changing its settings.

    docker logs -f your-setup-name

    See what a setup is doing

    Live log. Press Ctrl-C to stop watching.

    docker stats --no-stream

    Memory use of all setups

    One line per setup.

    docker stop your-setup-name

    Stop a setup

    It stays stopped until you start it again.

    Also: docker start your-setup-name

    docker rm -f your-setup-name

    Remove 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-name

    Delete its memory for good

    Run after removing the setup. This cannot be undone.

    // Planning

    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.

    // If something goes wrong

    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.

    // What the letters mean

    Read any command

    exec

    Run inside a setup

    Runs something inside a setup that is already running.

    -it

    Interactive terminal

    Lets you type and see the answers (-i interactive, -t terminal).

    -u hermes

    As the hermes user

    Does it as the hermes user, not as root.

    run -d

    Create, in the background

    run creates a new setup, -d keeps it running in the background.

    pull

    Get the newest version

    Downloads the newest version of Hermes.

    --restart unless-stopped

    Survives reboots

    Starts it again after a crash or a server reboot.

    -v name:/opt/data

    Its own storage

    Where the setup's memory lives. One per setup.

    -f

    Follow 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.