AWS Builder Center
Deploying Hermes Agent on AWS: A Quick-Start Guide

Deploying Hermes Agent on AWS: A Quick-Start Guide

In this blog post, I'll walk you through the entire process of deploying Hermes on AWS, breaking it down into simple, step-by-step instructions.

1. Introduction

Hermes Agent is an open-source, self-evolving AI Agent framework from Nous Research. It continuously learns through multi-turn conversations, automatically distills reusable skills, and can even chat with you through instant messaging platforms like WeChat and Telegram.
You might wonder: Why deploy on the cloud instead of running locally?
Three reasons:
  • Hassle-free: No local resource consumption, runs 24/7
  • Secure: API keys stored in a cloud secret management service
  • Scalable: Start with t3.small, upgrade anytime to higher specs
This guide walks you through deploying Hermes Agent on AWS step by step. Even if you're new to cloud services, you'll be up and running in 15-20 minutes at a cost as low as $25/month.

2. Technical Background

What is Hermes Agent?

Hermes Agent is an open-source AI Agent framework with self-evolving capabilities. Unlike traditional agents, it offers these core features:
Persistent Memory System
After each conversation, Hermes automatically saves important information to MEMORY.md and USER.md, which are loaded automatically in the next session. This means it remembers your preferences and project context — the more you use it, the better it understands you.
Skills System
Hermes doesn't just complete tasks — it learns how to complete them. It automatically creates and improves reusable skill documents that can be invoked by other agents. There are currently ~90 built-in skills, with more available from the agentskills.io community.
Single Gateway, Multi-Platform Access
A single Hermes Agent instance can connect to 15+ messaging platforms simultaneously: Telegram, Discord, Slack, WeChat, Signal, Email, Lark, WeCom, and more — no need for separate deployments per platform.

System Requirements

ResourceMinimumRecommended
CPU1 core2 cores
RAM1 GB2-4 GB
Disk500 MB2+ GB
Python3.11+3.11
Node.jsv22v22

Officially Supported Backends

Hermes Agent supports 6 execution backends:
BackendDescription
LocalRun directly on your machine (used in this guide)
SSHConnect to a remote machine
DaytonaServerless, near-zero cost
SingularityHPC container environment
ModalServerless, near-zero cost

3. AWS Deployment Plan

EC2 + Direct Installation

Three reasons:
  1. Lowest cost: t3.small instance + 20 GB EBS, only $25/month
  2. Simple and intuitive: Official one-click script handles all dependencies — no need to manually install Python or Node.js
  3. Flexible and controllable: SSH access for debugging and configuration changes

Resource Breakdown

AWS ResourceSpecsMonthly Cost Estimate
EC2t3.small (2 vCPU, 2 GB)~$15
EBSgp3 20 GB~$2
S3Standard storage 5 GB~$0.15
Secrets Manager5 secrets (optional)~$3 (optional)
Data Transfer50 GB/month~$5
Total (without Secrets Manager)~$22/month
Total (with Secrets Manager)~$25/month

4. Step-by-Step Deployment

Step 0: Prerequisites

Before you begin, make sure you have:
  • ✅ AWS account (sign up at aws.amazon.com  if you don't have one)
  • ✅ AWS IAM user with EC2 management permissions
  • ✅ SSH key pair (for EC2 login)
  • ✅ Credit card (AWS requires it for pay-as-you-go billing)

Step 1: Configure Security Group

A security group acts as a virtual firewall, controlling which traffic can flow in and out of your EC2 instance.

1.1 Create a Security Group

In the EC2 console, select "Security Groups" from the left sidebar, then click "Create security group".

1.2 Configure Inbound Rules

TypePort RangeSourceDescription
SSH22Your IPAllow only your IP for SSH access
HTTPS4430.0.0.0/0Web access (optional)
Custom TCP8080Your IPHermes Web Dashboard (optional)

1.3 Configure Outbound Rules

Leave the default — allow all outbound traffic.
Security reminder: Always restrict SSH port 22 to your fixed IP address. Never open it to 0.0.0.0/0.

Step 2: Create IAM Role (Authorize EC2 to Access AWS Services)

To allow your EC2 instance to access Bedrock and Secrets Manager, you need to create an IAM role first.

2.1 Create IAM Role

  1. Search for IAM in the AWS console and navigate to the IAM dashboard
  2. Select "Roles" from the left menu → Click "Create role"
  3. Trusted entity type: Select "AWS service"
  4. Use case: Select "EC2" → Click "Next"
  5. Add permissions: Skip for now (we'll add them next), click "Next"
  6. Role name: Enter hermes-agent-bedrock-role
  7. Click "Create role"

2.2 Add Bedrock Permissions

  1. Find the hermes-agent-bedrock-role role you just created in the IAM console
  2. Click the role name to enter its details page
  3. Click "Add permissions" → "Create inline policy"
  4. Select the "JSON" tab and enter the following policy:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream",
"bedrock:ListFoundationModels"
],
"Resource": "*"
}
]
}
  1. Click "Next"
  2. Policy name: Enter BedrockAccessPolicy
  3. Click "Create policy"

2.3 Add Secrets Manager Read Permissions (Optional)

⚠️ Only required if you use third-party APIs like OpenRouter/OpenAI. If you only use Bedrock, skip this step.
  1. In the IAM console, go to the hermes-agent-bedrock-role role details page
  2. Click "Add permissions" → "Create inline policy"
  3. Select the "JSON" tab and enter the following policy:
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret"
],
"Resource": "arn:aws:secretsmanager:*:*:secret:hermes-agent/*"
}
]
}
  1. Click "Next"
  2. Policy name: Enter SecretsManagerReadPolicy
  3. Click "Create policy"
Verification: Once the role is created, you'll be able to see it in the "Advanced details" section of the EC2 launch wizard (referenced in Step 3).

Step 3: Create EC2 Instance

3.1 Log in to AWS Console

Go to https://console.aws.amazon.com  and log in with your account.

3.2 Navigate to EC2 Console

Type EC2 in the top search bar and click to enter the EC2 console.

3.3 Launch a New Instance

Click the "Launch instance" button.

3.4 Configure Instance Parameters

ParameterRecommended Value
Namehermes-agent
AMIUbuntu Server 24.04 LTS (HVM), SSD Volume Type
Instance typet3.small (2 vCPU, 2 GB RAM)
Key pairSelect an existing key pair or create a new one
Network settingsDefault VPC or your private VPC
FirewallSelect existing security group (see Step 1)
Storage20 GB gp3 (default)
Advanced details → IAM instance profileSelect hermes-agent-bedrock-role (see Step 2)
Advanced details → User dataLeave empty (Hermes will be installed via the official script later)
Click "Launch instance".
Tip: It takes 1-2 minutes for the instance to start. You can check the status on the EC2 console's "Instances" page.

Step 4: Connect to Your EC2 Instance

4.1 Get the Public IP

On the EC2 console's "Instances" page, find your hermes-agent instance and copy its Public IPv4 address.

4.2 Log in via SSH

1
ssh -i /path/to/your-key.pem ubuntu@<your-EC2-public-IP>
For example:
1
ssh -i ~/.ssh/hermes-key.pem ubuntu@54.123.45.67
First-time login: If this is your first time connecting to this host, the terminal will ask you to verify the host fingerprint. Type yes to confirm.

Step 5: Verify Network Connectivity

Before installing Hermes Agent, confirm that your EC2 instance has internet access to avoid installation failures.

5.1 Check Public IP

Select the hermes-agent instance in the EC2 console and check the Public IPv4 address in the details:
  • ✅ Has an address (e.g., 54.xxx.xxx.xxx): A public IP is assigned, proceed to the next test
  • ❌ Empty: You need to allocate an Elastic IP (EIP) — see the "Allocate Elastic IP" step below
Note: If the instance has no public IP, you must allocate an EIP to access the internet.

5.2 Allocate and Associate an Elastic IP (if needed)

If the instance has no public IP, follow these steps:
  1. In the EC2 console, select "Elastic IPs" from the left menu
  2. Click "Allocate Elastic IP address"
  3. Select "Amazon's pool of IPv4 addresses", then click "Allocate"
  4. Once allocated, select the IP, click "Actions" → "Associate Elastic IP address"
  5. Select the hermes-agent instance and its private IP, then click "Associate"
Cost note: An EIP associated with a running instance is free. An unassociated EIP (while the instance is stopped) costs approximately $0.005/hour.

5.3 Check Route Table (Subnet Internet Gateway)

  1. EC2 console → "Network Interfaces" in the left menu
  2. Find the network interface of the hermes-agent instance, note its Subnet ID
  3. Go to the VPC console → "Route Tables"
  4. Filter for the route table associated with this subnet and check for the following route:
DestinationTarget (Next Hop)Status
0.0.0.0/0igw-xxxxxxxx (Internet Gateway)✅ Normal — instance can access the internet
No 0.0.0.0/0 route—❌ Cannot access the internet
If the internet gateway route is missing:
  1. VPC console → "Internet Gateways" → "Create internet gateway"
  2. Attach the internet gateway to your current VPC
  3. Add a 0.0.0.0/0 route pointing to the internet gateway in the route table

5.4 Test Network Connectivity

After SSH-ing into your EC2 instance, run:
1
2
3
4
5
6
7
8
# Test DNS resolution
nslookup mirrors.aliyun.com

# Test network connectivity
ping -c 3 8.8.8.8

# Test HTTPS access
curl -I https://mirrors.aliyun.com
Expected results:
CommandNormal Result
nslookupReturns the mirror site's IP address
pingReceives replies, no 100% packet loss
curl -IReturns HTTP/1.1 200 OK or 302 Found
If ping works but curl fails: Likely a DNS issue. Try:
1
2
# Manually set DNS
sudo echo "nameserver 8.8.8.8" >> /etc/resolv.conf
If there's no network at all: Go back to Steps 5.2 and 5.3 to check the EIP and route table.

Step 6: Install Hermes Agent (Official One-Click Script)

Hermes Agent provides an official one-click installation script that automatically handles all dependencies — no need to manually install Python or Node.js.

6.1 Run the Official Install Script

After SSH-ing into your EC2 instance, run:
1
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
The script automatically performs the following:
  • Installs uv (high-performance Python package manager)
  • Installs Python 3.11 (via uv, no sudo needed)
  • Installs Node.js v22 (for browser automation and WeChat bridging)
  • Installs ripgrep (high-speed file search)
  • Installs ffmpeg (TTS audio format conversion)
  • Clones the Hermes Agent repository
  • Creates a virtual environment
  • Sets up the global hermes command
Installation time: Approximately 2-5 minutes (depending on network speed).

6.2 Verify Installation

1
2
3
4
5
6
7
8
9
# Reload shell configuration (to activate the hermes command)
source ~/.bashrc

# Check if the hermes command is available
which hermes
# Should output: /home/ubuntu/.local/bin/hermes or ~/.local/bin/hermes

# Check version
hermes --version
✅ Verification successful: hermes --version outputs a version number with no errors.
❌ If hermes command is not found:
1
2
3
4
5
6
7
# Manually reload configuration
source ~/.bashrc

# If that doesn't work, check if installation succeeded
ls ~/.hermes/hermes-agent/
# If the directory exists, create a symlink manually
sudo ln -sf ~/.hermes/hermes-agent/scripts/hermes.sh /usr/local/bin/hermes

6.3 Run Diagnostics (Optional but Recommended)

1
hermes doctor
This command checks all dependencies and tells you if anything is missing.
Expected output:
1
2
3
4
5
✅ Python 3.11.x found
✅ Node.js v22.x found
✅ ripgrep found
✅ ffmpeg found
✅ Hermes Agent installed successfully

6.4 Start Hermes and Test

1
hermes
The first run will launch an interactive setup wizard. Follow the prompts to select your LLM Provider and model.
Success indicator: You enter the Hermes conversation interface and can type messages to receive AI responses.
Tip: Type /exit or press Ctrl+C to exit the conversation.

Step 7: Configure Secrets Manager (Optional)

⚠️ Only required if you use third-party APIs like OpenRouter/OpenAI. If you only use Bedrock, skip this step.
To securely manage API keys, we use AWS Secrets Manager.

7.1 Create Secrets

Search for Secrets Manager in the AWS console, then click "Store a new secret".
Select "Other type of secret" and add the following keys (based on the services you need):
Key NameExample Value
OPENAI_API_KEYsk-xxxxxxxxxxxxxxxx
OPENROUTER_API_KEYsk-or-v1-xxxxxxxx
WECHAT_SESSION_DIR/opt/data/wechat
ANTHROPIC_API_KEYsk-ant-xxxxxxxx
Click "Next", set the secret name to hermes-agent/api-keys, then click "Store".

5. Configuration and Usage

Hermes Agent supports multiple LLM Provider configurations, including AWS Bedrock, OpenRouter, OpenAI, and more. Below are the detailed configuration steps with screenshots:

Run the hermes command to enter Quick Setup

Select AWS Bedrock as the LLM Provider

Configure Model Region

Select Gateway: WeChat

Configure WeChat Parameters

Verify the Model is Working

Verify WeChat Integration


6. Troubleshooting Guide (Real-World Debugging Experience)

The following are typical issues encountered during actual deployment, along with their solutions.

Issue 1: Missing boto3 (Bedrock Provider Error)

Error message:
1
2
3
4
⚠️ API call failed (attempt 1/3): ImportError
🔌 Provider: bedrock Model: deepseek.v3.2
🌐 Endpoint: https://bedrock-runtime.us-east-1.amazonaws.com
📝 Error: The 'boto3' package is required for the AWS Bedrock provider.
Cause: Hermes Agent requires the boto3 package to use Bedrock, but it's not installed in the current Python environment.
Solution:
Navigate to the ~/.hermes/hermes-agent directory and install dependencies using uv sync:
1
2
cd ~/.hermes/hermes-agent
uv sync --extra bedrock

Issue 2: PEP 668 Externally-Managed Environment Error

Error message:
1
2
3
4
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install python3-xyz
Cause: Ubuntu's PEP 668 protection mechanism prevents pip from polluting the system Python. Never use --break-system-packages.
Solution (choose one):
Method 1: Use pip install --user (simplest)
1
pip install --user boto3
Method 2: Use uv sync (recommended for source installs)
1
2
cd ~/.hermes/hermes-agent
uv sync --extra bedrock
Method 3: Create a venv first
1
2
3
python3 -m venv ~/.hermes/venv
source ~/.hermes/venv/bin/activate
pip install boto3

Issue 3: which python Returns Empty

Error message:
1
2
ubuntu@ip:~$ which python
ubuntu@ip:~$
Cause: Ubuntu typically only has python3, not python (this is normal).
Solution:
1
2
3
4
5
# Use python3 instead
python3 --version

# Or create a symlink
sudo ln -s /usr/bin/python3 /usr/bin/python

Issue 4: uv tool install boto3 Fails

Error message:
1
2
uv tool install boto3
error: Failed to install entrypoints for `boto3`
Cause: uv tool install is designed for packages with executable entry points (like black, ruff). boto3 is a pure library with no executable entry point, so it fails. Even if it succeeded, each uv tool runs in an isolated environment that Hermes wouldn't use.
Correct approach: Install boto3 into Hermes's own environment:
1
2
cd ~/.hermes/hermes-agent
uv sync --extra bedrock

Issue 5: hermes-agent Is Not on PyPI

Error message:
1
2
3
uv tool install --force --with boto3 hermes-agent
× No solution found when resolving dependencies:
╰─▶ Because hermes-agent was not found in the package registry...
Cause: Hermes Agent is a GitHub open-source project and is not available on PyPI. You can't install it via pip install hermes-agent.
Correct installation (from source):
1
2
3
4
5
6
# 1. Clone the repository
git clone https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent

# 2. Enter the directory and install via uv
cd ~/.hermes/hermes-agent
uv sync --extra bedrock

Issue 6: uv sync Succeeds but hermes Still Reports Missing boto3

Error message:
1
2
3
4
5
uv sync --extra bedrock
# Shows success

hermes
# Still reports missing boto3
Root cause: uv sync installs dependencies into ~/.hermes/hermes-agent/.venv, but the hermes command points to the old environment (~/.hermes/hermes-agent/venv or the system Python). The two environments are isolated.
Diagnosis:
1
2
# Check where the hermes command points
cat ~/.local/bin/hermes
If the output looks like:
1
2
3
4
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "/home/ubuntu/.hermes/hermes-agent/venv/bin/hermes" "$@"
Note the path is venv (no dot), but uv sync creates .venv (hidden directory with a dot) — that's the problem.
Solution: Modify the ~/.local/bin/hermes script
1
2
3
4
5
6
7
8
9
# Method 1: Update the script to point to .venv (simplest)
cat > ~/.local/bin/hermes << 'EOF'
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "/home/ubuntu/.hermes/hermes-agent/.venv/bin/hermes" "$@"
EOF

chmod +x ~/.local/bin/hermes
1
2
3
4
5
6
7
8
9
10
# Method 2: Use uv run (more robust, recommended)
cat > ~/.local/bin/hermes << 'EOF'
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
cd "/home/ubuntu/.hermes/hermes-agent"
exec uv run hermes "$@"
EOF

chmod +x ~/.local/bin/hermes
Verification:
1
2
3
which hermes
hermes --version
hermes

Debugging Experience Summary

IssueKey PointCorrect Solution
Missing boto3Required for Bedrockuv sync --extra bedrock
PEP 668 errorDon't use --break-system-packagesUse uv sync or pip install --user
which python emptyUbuntu only has python3Use python3 or create a symlink
uv tool install boto3 failsboto3 is a pure library, no entry pointInstall into Hermes's own environment
hermes-agent not on PyPIIt's a GitHub projectClone and install from source
uv sync succeeds but Hermes still errorsScript points to old environmentModify the ~/.local/bin/hermes script


Related Resources

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article