AWS Builder Center
Running OpenClaw and Hermes Agent on a Single Amazon EC2 - A Developer's Guide

Running OpenClaw and Hermes Agent on a Single Amazon EC2 - A Developer's Guide

A step-by-step guide to running OpenClaw and Hermes Agent simultaneously on a single Amazon EC2 t4g.xlarge instance, each connected to a separate WeChat account and sharing the same Amazon Bedrock backend (Claude Opus 4.6). Covers instance upgrade, Hermes installation, WeChat configuration, and key gotchas — including user authorization and token limit fixes.

In the  previous post , I deployed OpenClaw on Amazon EC2. This time I took it further: installing  Hermes Agent  on the same EC2 instance, running both AI Agents simultaneously, each connected to a different WeChat account, sharing the same Amazon Bedrock backend. This post covers the full process — installation, WeChat configuration, and the gotchas I ran into.

Why Run Two Agents on One Machine?

OpenClaw and Hermes Agent are two different open-source AI Agent projects with distinct approaches:
  •  OpenClaw  — Node.js, 20+ messaging platforms via plugins, focused on the "personal assistant" experience
  •  Hermes Agent  — Python, built by Nous Research, focused on CLI interaction, skill systems, and autonomous task execution
Both support Amazon Bedrock. Both support WeChat. I wanted to run them side by side on the same EC2 instance, connect each to a different WeChat account, and compare the experience.

Starting Point: Existing OpenClaw Deployment

From the previous post:
  • EC2 instance running in  ap-southeast-2  (Sydney)
  • OpenClaw Gateway running as a systemd user service
  • WeChat connected via the  openclaw-weixin  plugin
  • Model:  au.anthropic.claude-opus-4-6-v1  (Claude Opus 4.6 via Bedrock)

Step 1: Upgrade the Instance

The original  t4g.large  (2 vCPU, 8GB RAM) handles one Agent fine, but running two simultaneously would be tight. I upgraded to  t4g.xlarge  and expanded EBS from 50GB to 100GB:
Item
Before
After
Instance Type
t4g.large (2 vCPU, 8GB)
t4g.xlarge (4 vCPU, 16GB)
EBS
50GB gp3
100GB gp3
How: Stop instance in EC2 console → Change Instance Type → Start. EBS expansion can be done online without downtime.

Step 2: Install Hermes Agent

Connect via SSM:
Bash
aws ssm start-session --target <instance-id> --region ap-southeast-2
sudo su - ubuntu
Clone and run the setup script:
Bash
mkdir -p ~/.hermes
cd ~/.hermes
git clone https://github.com/nousresearch/hermes-agent.git
cd hermes-agent
./setup-hermes.sh
The setup script automatically:
  • Installs  uv  (Python package manager)
  • Creates a Python 3.11 virtual environment
  • Installs all dependencies (hash-verified via  uv.lock )
  • Symlinks the  hermes  command to  ~/.local/bin/ 
  • Syncs built-in skills to  ~/.hermes/skills/ 
After installation, reload your shell:
Bash
source ~/.bashrc
hermes --version
# Hermes Agent v0.10.0 (2026.4.16)

Step 3: Configure the Bedrock Model

Edit  ~/.hermes/config.yaml :
YAML
model:
default: "au.anthropic.claude-opus-4-6-v1"
provider: "bedrock"
Hermes uses the EC2 instance's IAM Role for Bedrock authentication automatically — no API key needed. Same as OpenClaw — both Agents share the same IAM Role and Bedrock access.

Step 4: Install and Start the Gateway

Bash
# Install as a systemd user service
hermes gateway install

# Start
hermes gateway start

# Verify
hermes gateway status
Note: You must  install  before  start . Running  start  directly gives  Unit hermes-gateway.service not found .

Step 5: Configure WeChat

Bash
hermes gateway setup
The wizard walks you through:
  1. Select platform: Choose weixin
  1. QR pairing: Terminal displays a QR code, scan with WeChat to confirm
  1. DM authorization: Choose "Use DM pairing approval" (recommended)
  1. Group chats: Choose "Disable group chats" (recommended)
  1. Home channel: Confirm your WeChat user ID
  1. Restart gateway: Confirm restart
On success:
Plain text
微信连接成功,account_id=<your-account-id>@im.bot
✓ Weixin configured!

Gotcha: WeChat Messages Not Getting Replies

After setup, I sent a message from WeChat to Hermes. No reply. Checked the logs:
Bash
journalctl --user -u hermes-gateway -f
Found the issue:
Plain text
WARNING gateway.run: Unauthorized user: <user-id>@im.wechat on weixin
The DM pairing approval mode was enabled, but my WeChat user hadn't been authorized yet. Fix:
Bash
echo 'WEIXIN_ALLOWED_USERS=<your-user-id>@im.wechat' >> ~/.hermes/.env
hermes gateway restart
After restart, WeChat messages worked.
Lesson learned: If Hermes doesn't reply on WeChat, check the gateway logs first. It's almost certainly a user authorization issue.

The Result

Both Agents running simultaneously, each connected to a different WeChat account:
OpenClaw and Hermes Agent Architecture

Verify both are running:
Bash
# OpenClaw
systemctl --user status openclaw-gateway
# ● active (running)

# Hermes
systemctl --user status hermes-gateway
# ● active (running)

Comparing the Two Agents

Feature
OpenClaw
Hermes Agent
Runtime
Node.js (TypeScript)
Python 3.11
Config directory
 ~/.openclaw/ 
 ~/.hermes/ 
WeChat implementation
Plugin ( openclaw-weixin )
Native adapter ( weixin.py )
WeChat protocol
iLink Bot API
iLink Bot API (same)
Gateway port
18789 (HTTP)
No listening port (long-poll)
Model config
 openclaw.json 
 config.yaml  +  .env 
Memory usage
~682MB
~123MB
Service management
systemd user service
systemd user service
Messaging platforms
20+
15+
Standout features
Canvas, plugin system
CLI interaction, skill system, persistent memory
Both use Tencent's iLink Bot API for WeChat — same protocol, different implementations. OpenClaw extends via plugins; Hermes has it built in natively.

FAQ

1/ WeChat shows "No auxiliary LLM provider configured" warning

Symptom: When chatting with Hermes on WeChat, you see:
Plain text
No auxiliary LLM provider configured — context compression will drop middle
turns without a summary. Run `hermes setup` or set OPENROUTER_API_KEY.
Cause: Hermes uses an auxiliary model (defaults to Gemini Flash via OpenRouter) for context compression and memory management. When only Bedrock is configured, Hermes can't use Bedrock's AWS SDK authentication for auxiliary tasks, so compression falls back to dropping middle conversation turns without generating a summary.
Fix: Get an API key from  OpenRouter  (free tier available), then configure it:
Bash
echo 'OPENROUTER_API_KEY=your-key-here' >> ~/.hermes/.env
hermes gateway restart
With this configured, Hermes uses Gemini Flash as the auxiliary model to generate conversation summaries during context compression — much smarter than simply dropping middle turns.
OpenRouter's free tier is more than enough for auxiliary model calls. Gemini Flash is very cheap, so the additional cost for daily use is negligible.

2/ WeChat replies truncated (Response truncated due to output length limit)

Symptom: Hermes shows "Response truncated due to output length limit" on WeChat or CLI when performing complex tasks like generating PowerPoint presentations or writing long code files.
Cause: In Bedrock mode, Hermes has  max_tokens=4096  hardcoded as the default in  run_agent.py , and the  max_tokens  setting in  config.yaml  isn't properly passed to the Agent. When the model needs to generate substantial content in a single tool call, 4096 tokens isn't enough, causing the output to be truncated.
Fix: Modify the default value in the Hermes source code. Edit  ~/.hermes/hermes-agent/run_agent.py , find the Bedrock converse call (around line 6686):
Python
# Before
max_tokens=self.max_tokens or 4096,

# After
max_tokens=self.max_tokens or 16384,
Then restart the gateway:
Bash
hermes gateway restart
Additionally, for tasks that require large code output (like PPT generation), guide the model to write files in segments (e.g., one file per 3 slides) to avoid hitting the per-call output limit.
Note: Setting  max_tokens  too high (e.g., 65536) can cause Bedrock API timeouts (Read timed out) due to long generation times. 16384 is a good balance.

Cost Impact

Resource
Before
After
Monthly Change
Calculation
EC2
t4g.large (~$49)
t4g.xlarge (~$98)
+$49
$0.1344/hr × 730 hrs
EBS
50GB gp3 (~$4)
100GB gp3 (~$8)
+$4
$0.08/GB-mo × 100GB
VPC Endpoints
×4 (~$29)
×4 (~$29)
No change
—
Total (excl. API)
~$82
~$135
+$53
—
Pricing reference (us-east-1):  Amazon EC2 T4g Instances  Note: Actual prices may vary by region and time. Refer to official AWS pricing pages for current rates.

Wrapping Up

Running OpenClaw and Hermes Agent on the same EC2 instance works well. They use different runtimes (Node.js vs Python), different config directories, different systemd services — no conflicts. For WeChat, both use the iLink Bot API and can each bind to a separate WeChat account.
The biggest gotcha was Hermes user authorization — after pairing WeChat, you still need to manually add your user ID to the  .env  allowlist, or messages get silently dropped.
If you already have OpenClaw running on AWS, adding Hermes Agent takes about 20 minutes. Worth trying.
Resources:
Happy Deploying! 🦞⚕



References

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