Modern AI agent frameworks allow developers to deploy autonomous tools that process natural language prompts, connect to cloud LLMs, and interface directly with communication channels like Telegram. In this comprehensive technical guide, we cover the end-to-end deployment of the Hermes Agent on enterprise Linux distributions—including Ubuntu and RedHat family (CentOS / AlmaLinux / Rocky Linux)—paired with Ollama Cloud model endpoints and a Telegram Bot bridge.

Architecture Overview

The operational flow connects end users through Telegram to the background Hermes daemon, which routes prompts to Ollama Cloud for inference:

1. System Preparation & Prerequisites

Before installing the Hermes framework, ensure your server packages are up to date and that Python 3.10+ along with virtual environment tools are installed.

On Ubuntu / Debian Systems:

sudo apt update && sudo apt upgrade -y
sudo apt install -y python3 python3-pip python3-venv git curl

On RHEL / CentOS / AlmaLinux / Rocky Linux Systems:

sudo dnf check-update
sudo dnf install -y python3 python3-pip git curl

2. Installing Hermes Agent

Create a dedicated service user and set up an isolated Python environment for the agent:

sudo useradd -m -s /bin/bash hermes
sudo su - hermes

# Clone repository or initialize project workspace
git clone [repository_url_here] ~/hermes-agent
cd ~/hermes-agent

# Set up Python Virtual Environment
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

3. Configuring Ollama Cloud Model Integration

Hermes interfaces with Ollama API endpoints for model completion. Export the environment configuration in your project .env file:

# Environmental Configuration (.env)
OLLAMA_BASE_URL="[api_url_here]"
OLLAMA_API_KEY="your_ollama_cloud_api_key_here"
DEFAULT_MODEL="llama3.3:70b"
TEMPERATURE=0.7

4. Setting Up Telegram Bot Integration

To connect Hermes to Telegram:

  1. Open Telegram and message @BotFather.
  2. Send /newbot, follow the prompts, and copy the HTTP API Token.
  3. Obtain your numeric Telegram User ID using @userinfobot.

Add the Telegram credentials to your configuration:

# Telegram Settings
TELEGRAM_BOT_TOKEN="1234567890:ABCdefGHIjklMNOpqrsTUVwxyZ"
ALLOWED_TELEGRAM_USERS="987654321"
AUTO_RESPOND_CHATS=true

5. Creating a Systemd Service for Auto-Start

To ensure Hermes runs continuously as a background service and automatically recovers after system reboots, create a systemd unit file on both Ubuntu and RHEL family OSs:

sudo nano /etc/systemd/system/hermes.service

Paste the following unit configuration:

[Unit]
Description=Hermes AI Agent with Ollama Cloud & Telegram Bridge
After=network.target

[Service]
Type=simple
User=hermes
WorkingDirectory=/home/hermes/hermes-agent
ExecStart=/home/hermes/hermes-agent/venv/bin/python main.py
Restart=always
RestartSec=5
EnvironmentFile=/home/hermes/hermes-agent/.env

[Install]
WantedBy=multi-user.target

Enable and start the daemon:

sudo systemctl daemon-reload
sudo systemctl enable --now hermes
sudo systemctl status hermes

6. Testing the Integration

Once the daemon is active, send a message to your Telegram bot (e.g., /start). Check system logs in real time using journalctl:

journalctl -u hermes -f