Skip to content

Install & Configure Hermes Agent

Hermes is an advanced AI agent framework. In this guide, we will install Hermes on our Ubuntu virtual machine and configure it to route all intelligence requests directly to your Windows-hosted LM Studio, completely bypassing paid cloud APIs.

The Hermes development team provides an automated installation script that handles all complex dependencies, including Python 3.11 and Node.js.

  1. Open your Ubuntu Terminal.
  2. Run the official installation command:
    Ubuntu Terminal
    curl -sSL [https://hermes-agent.com](https://hermes-agent.com) | bash

Allow the installation to complete. Depending on your internet speed, downloading the Python and Node.js environments may take a few minutes.

Verify the Installation: Once finished, confirm the system recognizes the command by checking the version:

Ubuntu Terminal
hermes --version

Before configuring Hermes, your Windows machine must be actively broadcasting the LLM.

  1. Open LM Studio on your Windows host.

  2. Load your Qwen3.6:27b model.

  3. Go to the Local Server tab (double arrows icon).

  4. Ensure the server is Started and listening on port 1234.

Step 3: Run the Setup Wizard (Local LLM Routing)

Section titled “Step 3: Run the Setup Wizard (Local LLM Routing)”

We will now run the Hermes configuration wizard. Because we are not using a cloud provider like OpenRouter, we must point Hermes to our local network.

  1. In your Ubuntu Terminal, start the setup wizard:
Ubuntu Terminal
hermes setup
  1. Select the Provider: When prompted to choose a model provider, look for an option like Custom Provider, Localhost, or OpenAI. (Note: LM Studio natively emulates the OpenAI API, so selecting OpenAI is the standard fallback method).

  2. Set the API Key: Since we are running locally, you do not need a real paid API key. If the wizard requires text, simply type: lm-studio

  3. Set the Base URL (Crucial): When asked for the Base URL or API Endpoint, you must input your Windows Real IP address followed by the LM Studio port and the v1 path.

    • Example: http://192.168.X.X:1234/v1

  4. Select Default Model: Type the exact filename of the model loaded in LM Studio (e.g., qwen3.6-27b).

Step 4: Connect a Messenger Interface (Gateway)

Section titled “Step 4: Connect a Messenger Interface (Gateway)”

Hermes does not connect to your chat platforms automatically. You must configure its “Gateway” so it can log into the bots you created previously. You can connect Hermes to either Telegram or Discord.

For Telegram:

  1. Open your Ubuntu terminal and run the gateway wizard:
Ubuntu Terminal
hermes gateway setup
  1. When prompted to select a messaging platform, choose Telegram.

  2. Bot Token: Paste the API Token you received from BotFather (e.g., 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ).

  3. Allowed Users: Hermes strictly blocks unknown users. Paste your numeric Telegram User ID (which you got from @userinfobot) to authorize yourself.

For Discord:

  1. Open your Ubuntu terminal and run the gateway wizard:
Ubuntu Terminal
hermes gateway setup
  1. When prompted to select a messaging platform, choose Discord.

  2. Bot Token: Paste your Discord Bot Token. (If you lost it, go to the Discord Developer Portal -> Your App -> Bot -> click “Reset Token”).

  3. Allowed Users: Paste your personal Discord User ID to ensure the agent only listens to your commands in the server.

(Note: The wizard will save these credentials permanently in the ~/.hermes/.env file).

Step 5: Start the Agent & Gateway With the LLM routed and the messenger authenticated, you need to start the Hermes system. Hermes requires the gateway to run so it can actively listen for new messages.

Start the gateway service:

Ubuntu Terminal
hermes gateway run

Verify the Connection:

Open your Telegram app or your Discord server.

Send a simple message like: “Hello Hermes, what model are you currently running?”

The gateway will receive the message, send it to LM Studio on your Windows host for processing, and reply directly in your chat!

To ensure your agent is always online 24/7, even if your Ubuntu VM restarts and sits at the login screen, we will configure a background service.

First, verify where Hermes is installed:

Ubuntu Terminal
which hermes

(Note this path, it is usually /usr/local/bin/hermes or ~/.local/bin/hermes).

Create a new systemd service file:

Ubuntu Terminal
xdg-open ~/.config/systemd/user/hermes-gateway.service

Paste the following configuration into the editor. Update the ExecStart line if your which hermes path was different.

Ubuntu Terminal
[Unit]
Description=Hermes AI Agent Gateway
After=network-online.target
[Service]
Type=simple
# Ensure the path matches your installation
ExecStart=/usr/local/bin/hermes gateway run
Restart=always
RestartSec=10
[Install]
WantedBy=default.target

Save the file (Ctrl + S) and close the text editor.

Now, execute these four commands to enable the service and allow it to run completely in the background without needing a user login:

Ubuntu Terminal
# 1. Reload systemd to detect the new file
systemctl --user daemon-reload
# 2. Enable the service to start automatically
systemctl --user enable hermes-gateway.service
# 3. Start the service right now
systemctl --user start hermes-gateway.service
# 4. Enable 'linger' so the service starts at the boot screen before you log in
sudo loginctl enable-linger $USER