AI agents & automation
How to install Hermes Agent on a VPS and connect it to Telegram
Set up Nous Research's open-source Hermes Agent on your own VPS, choose an AI model, connect it to Telegram and lock it down with the official safety settings.

On this page
Hermes Agent is an open-source personal AI agent from Nous Research. It runs on your server, remembers context between sessions, learns reusable skills, and can talk to you through Telegram, WhatsApp, Discord, Slack and more. It's released under the MIT license.
Before you start
- A VPS running Linux. The project says it runs on a small, low-cost VPS; it doesn't publish a RAM minimum. A plan with 4 GB of RAM leaves room for other tools too.
- An API key for an AI model provider. The model needs a context window of at least 64,000 tokens.
- Git, curl and tar installed (they are on most server images).
- A Telegram account if you want to chat with the agent from your phone.
Step 1: Create a non-root user
The Hermes docs are clear that the agent's gateway should never run as root. Create a separate user first:
sudo adduser hermes
sudo su - hermes
Step 2: Install Hermes Agent
Run the official installer as that user:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.bashrc
The installer downloads the project and the tools it needs (Python, Node.js and a few utilities). Settings and data live in ~/.hermes/. Check that everything is in place:
hermes doctor
Step 3: Choose your AI model
hermes model
Pick your provider and model from the list. API keys are stored in ~/.hermes/.env; you can also set one directly, for example:
hermes config set OPENROUTER_API_KEY your_key_here
chmod 600 ~/.hermes/.env
Then start a chat in the terminal with hermes to confirm the model answers.
Step 4: Connect Telegram
- In Telegram, open @BotFather, send
/newbot, and follow the steps. Copy the bot token it gives you. - Find your own Telegram user ID (bots such as @userinfobot show it).
- Run the gateway setup and enter the token and your user ID when asked:
hermes gateway setup
hermes gateway start
Your user ID goes in the allowed-users list. According to the docs, if no allow list is set, Hermes denies everyone by default, which is exactly what you want. Never enable the "allow all users" option on a real server.
Step 5: Keep it safe
Hermes has several safety layers. These are the settings that matter most:
- Command approval: in
~/.hermes/config.yaml,approvals.modedefaults tosmart. Leave it on. The docs warn that turning it off disables all safety prompts. - Avoid "YOLO mode" (
hermes --yolo) on a real server: it skips approvals. - Run commands in a sandbox: setting the terminal backend to Docker isolates the commands the agent runs from your server:
hermes config set terminal.backend docker
- Keep it updated: run
hermes updateregularly. - Separate it from important apps: for maximum safety the docs suggest running the agent on its own machine or virtual machine.
For a full checklist, read our guide to securing a self-hosted AI agent.
Hermes Agent or something else?
Hermes is great as a personal assistant that lives in your chat apps. If you want to automate business processes with clear steps (orders, customer messages, reports), n8n is often the better fit. Our OpenClaw vs Hermes vs n8n comparison explains the difference.
Frequently asked questions
Is Hermes Agent free?
The software is open source under the MIT license. You pay for your server and for the AI model you connect, unless you use a free or local model.
Which AI model should I use with Hermes Agent?
Any supported provider works, including OpenRouter, OpenAI, Anthropic and Google. The docs require a model with a context window of at least 64,000 tokens.
Sources & references
Related reading
AI agents & automation
OpenClaw vs Hermes Agent vs n8n: which should you self-host?
Two personal AI agents and one automation platform, compared: what each is built for, how you talk to it, how it's licensed and how much care it needs to run safely.
2 min read
AI agents & automation
How to secure a self-hosted AI agent: a practical checklist
A checklist for running n8n, OpenClaw, Hermes Agent or any AI agent on your own server safely: server basics, closed ports, limited permissions, sandboxing and prompt injection.
3 min read
AI agents & automation
How much does it cost to run an AI agent 24/7?
The real costs of running an AI agent: the server, the AI model's API usage and the hidden extras. A simple formula to estimate your monthly bill before you start.
2 min read