Innovate | Connect | Transform
ContactService statusUSD $

GICT knowledge base

Deploy Hermes Agent on Your VPS and Talk to It from Telegram 24/7

Published

AI

Hermes Agent is an open-source AI agent built by Nous Research. You have probably heard of Nous from their Hermes and Nomos language models. This is the agent they built to go with those models, and it has picked up over 30,000 GitHub stars because it does something most AI assistants cannot: it gets better at its job the longer you use it.

The secret is a built-in learning loop. When Hermes finishes a complex task, it sometimes writes a skill document that captures how it solved the problem. Next time a similar job comes up, it loads that skill and applies what it learned. Over weeks and months, the agent builds a library of its own experience. It also maintains memory files that survive between sessions, so it remembers your preferences, your projects, and what it has already figured out for you.

You can run Hermes as a CLI chat interface, but the real power shows when you connect it to a messaging platform. Telegram is the easiest to set up. Once the gateway is running, you message your bot on Telegram and Hermes responds from your VPS. You close your laptop, the server keeps running, and you still have a fully functional AI agent on your phone. It runs 24 hours a day, seven days a week, without your laptop being open.

Running it on a VPS instead of your laptop means better uptime, your own control over the data, and no API calls going through a third-party relay unless you choose to route them that way. A cheap VPS handles the gateway and agent runtime without breaking a sweat. Here is how to set the whole thing up from a clean server to a working Telegram-connected agent.

What You Need Before Starting

This setup assumes a clean Ubuntu 22.04 VPS with root access. The minimum viable VPS has 1GB of RAM if you only want the CLI. Add the messaging gateway and tools, and you want at least 2GB. Anything less and you will fight with OOM kills when the agent loads large context windows.

You also need a few external accounts before you start. Create a Telegram bot by messaging @BotFather on Telegram. It gives you a bot token that looks like a long string of numbers and letters. Keep that token handy. You also need an OpenRouter API key from openrouter.ai. OpenRouter gives you access to models from Anthropic, OpenAI, Google, Meta, and others through a single API key. There are free models available if you want to test without spending money.

Aside from that, just need basic comfort with a command line, SSH access to your VPS, and about 30 minutes to get everything running.

Step 1: Set Up Your VPS

SSH into your server as root. Update the package lists and upgrade everything to its latest version.

ssh root@your-vps-ip
apt update && apt upgrade -y

Create a dedicated user for Hermes. Do not run the agent as root. If the agent gets compromised or a tool behaves unexpectedly, you want the blast radius limited to a non-privileged account.

adduser hermes
usermod -aG sudo hermes
su - hermes

Install git. The Hermes installer needs it to pull the repository.

sudo apt install git -y

Set up a basic firewall. Allow SSH so you do not lock yourself out, then enable the firewall.

sudo ufw allow OpenSSH
sudo ufw enable

Your VPS is ready. Stay logged in as the hermes user for the rest of the installation.

Step 2: Install Hermes Agent

Nous Research ships a one-line installer that handles every dependency. Python, Node.js, uv, ripgrep, ffmpeg, the full repository clone, virtual environment setup, and the global hermes command symlink. One command does all of it.

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

The installer takes a minute or two depending on your server speed. When it finishes, reload your shell so the new hermes command is on your PATH.

source ~/.bashrc

Verify the installation worked.

hermes --version

Run the built-in diagnostic tool. It checks your Python version, Node.js version, uv availability, and whether it can find the core files.

hermes doctor

If everything checks out, you are ready to configure your model provider. If something is missing, hermes doctor tells you exactly what to fix.

Step 3: Configure Your Model Provider

Run the setup wizard. It walks you through provider selection, API key entry, model choice, and optional platform connections in a single guided flow.

hermes setup

Choose OpenRouter when prompted. It is the easiest path because you get access to hundreds of models through one API key. Enter your OpenRouter API key when asked.

Pick a model to start with. If you want cheap and fast, openai/gpt-4o-mini works well. If you want more reasoning capability, anthropic/claude-3-haiku-20240307 is a good middle ground and costs less than Claude 3.5 Sonnet. OpenRouter shows pricing per model so you can see the cost before you commit.

Once the wizard finishes, test it with a quick conversation.

hermes

Type something like “what can you help me with?” and watch how Hermes responds. When you are done testing, type /exit or press Ctrl+C to leave the CLI.

Step 4: Set Up the Messaging Gateway with Telegram

The gateway is what bridges a messaging platform to your agent. Without it, you need to be SSHed into your server to chat. With it, Hermes responds to messages from your phone through a Telegram bot.

Run the gateway setup wizard.

hermes gateway setup

Choose Telegram from the list of platforms. Enter the bot token you got from @BotFather. The wizard confirms when the connection is ready.

Open Telegram, find your bot by its username, and send it a message. Hermes should reply. If it does, the gateway is working. You now have an AI agent that responds on Telegram and runs entirely on your VPS.

The gateway setup is the same pattern for Discord, Slack, WhatsApp, Signal, and the other supported platforms. Telegram is just the fastest to get running because you do not need to set up app credentials or deal with webhook configurations.

Step 5: Run It 24/7 with Systemd

The CLI chat works great when you are sitting at your terminal. The gateway setup works for as long as your SSH session stays open. But if you want Hermes running when you are asleep, on vacation, or just not paying attention to your server, you need a system service that survives logout and reboots.

Install the gateway as a systemd service. This registers it with your server’s init system so it starts automatically on boot.

sudo hermes gateway install --system

Start the service.

sudo hermes gateway start --system

Check that it is running.

sudo hermes gateway status --system

View live logs with journalctl. This is where you see what Hermes is doing when it processes messages.

sudo journalctl -u hermes-gateway -f

Press Ctrl+C to stop following the logs. The service keeps running in the background. Now send a message from Telegram. Hermes responds even if you have not touched your server in hours. Reboot the VPS and wait for it to come back online. Hermes comes back with it, no manual intervention needed.

Step 6: Use the Skills and Memory System

Skills are what make Hermes different from a stateless chatbot. When the agent finishes a complex task, it sometimes decides the work is worth preserving. It writes a skill document that describes the problem and the approach it used. Load that skill on a future job and Hermes skips the discovery phase and applies the solution directly.

List the skills Hermes has created so far.

hermes skills list

Create a skill manually. This is useful when you want to document a specific workflow or preference that you know matters for your work.

hermes skills create

Skills follow the agentskills.io open standard, which means they are portable. If you move to a different agent that supports the same standard, your skills travel with you.

Memory works differently from skills. Hermes maintains two files that survive between sessions. MEMORY.md holds what the agent has learned about the world and your projects. USER.md holds what it has learned about you. The agent reads and updates these files during every conversation. Over time, it builds a model of your preferences, your codebase, and the patterns in how you work.

Test the memory by asking Hermes something specific about a previous conversation. If you asked it to set up a nginx config two days ago and you ask about nginx today, it usually has enough context to help without re-explaining everything.

Step 7: Connect MCP Servers

MCP stands for Model Context Protocol. It is the USB-C standard for AI tool connections, and Hermes supports it on both sides: connecting to external MCP servers and acting as an MCP server itself.

Edit your Hermes configuration file to add an MCP server. The file lives at ~/.hermes/config.yaml.

nano ~/.hermes/config.yaml

Add a filesystem MCP server as an example. This gives Hermes access to read and write files on your VPS through MCP.

mcp_servers:
  filesystem:
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/hermes/projects"]

Restart the gateway to load the new MCP configuration.

sudo hermes gateway restart --system

Send a message on Telegram asking Hermes to list the files in /home/hermes/projects. It discovers the MCP server tools and uses them. You can connect GitHub MCP servers, database MCP servers, or any of the tools available in the MCP ecosystem without writing native Hermes integrations.

Hermes also exposes its own tools through MCP. Other agents like Claude Code or Cursor can connect to your Hermes instance and use its conversation history, session search, and attachment management as tools. The bidirectional support makes Hermes a hub in an MCP ecosystem rather than a closed system.

What You Have Now

A fully operational Hermes Agent running on your VPS, connected to Telegram, with a systemd service that starts on boot and keeps running after logout. The agent builds skills and memory across sessions, so it genuinely gets more useful the longer you use it. MCP server support means you can extend what it can do without waiting for the Hermes team to add native integrations.

The learning loop is the part worth emphasizing to anyone skeptical about self-hosted AI agents. A cloud API chatbot resets every session. Hermes remembers. It writes skills for tasks it solved weeks ago and applies them when the same problem shows up again. That is not a feature most agents have, and it changes how you work with the tool over time.

Ready to deploy your own self-improving AI agent? InterServer VPS plans starting at $3/month give you the RAM and uptime you need to run Hermes Agent and its gateway around the clock.

Related InterServer guide: If you want AI agents to connect directly to InterServer hosting tools, read InterServer MCP Server: Connect AI Agents to Your Hosting Account.

Related guides

Account services are unavailable until the production backend is configured.