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.
Step 1: Install Hermes via CLI
Section titled “Step 1: Install Hermes via CLI”The Hermes development team provides an automated installation script that handles all complex dependencies, including Python 3.11 and Node.js.
- Open your Ubuntu Terminal.
- 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:
hermes --versionStep 2: Ensure LM Studio is Ready
Section titled “Step 2: Ensure LM Studio is Ready”Before configuring Hermes, your Windows machine must be actively broadcasting the LLM.
-
Open LM Studio on your Windows host.
-
Load your Qwen3.6:27b model.
-
Go to the Local Server tab (double arrows icon).
-
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.
- In your Ubuntu Terminal, start the setup wizard:
hermes setup-
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).
-
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
-
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
-
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:
- Open your Ubuntu terminal and run the gateway wizard:
hermes gateway setup-
When prompted to select a messaging platform, choose Telegram.
-
Bot Token: Paste the API Token you received from BotFather (e.g., 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ).
-
Allowed Users: Hermes strictly blocks unknown users. Paste your numeric Telegram User ID (which you got from @userinfobot) to authorize yourself.
For Discord:
- Open your Ubuntu terminal and run the gateway wizard:
hermes gateway setup-
When prompted to select a messaging platform, choose Discord.
-
Bot Token: Paste your Discord Bot Token. (If you lost it, go to the Discord Developer Portal -> Your App -> Bot -> click “Reset Token”).
-
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:
hermes gateway runVerify 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!
Step 6: Auto-Start Hermes on System Boot
Section titled “Step 6: Auto-Start Hermes on System Boot”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:
which hermes(Note this path, it is usually /usr/local/bin/hermes or ~/.local/bin/hermes).
Create a new systemd service file:
xdg-open ~/.config/systemd/user/hermes-gateway.servicePaste the following configuration into the editor. Update the ExecStart line if your which hermes path was different.
[Unit]Description=Hermes AI Agent GatewayAfter=network-online.target
[Service]Type=simple# Ensure the path matches your installationExecStart=/usr/local/bin/hermes gateway runRestart=alwaysRestartSec=10
[Install]WantedBy=default.targetSave 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:
# 1. Reload systemd to detect the new filesystemctl --user daemon-reload
# 2. Enable the service to start automaticallysystemctl --user enable hermes-gateway.service
# 3. Start the service right nowsystemctl --user start hermes-gateway.service
# 4. Enable 'linger' so the service starts at the boot screen before you log insudo loginctl enable-linger $USER