Skip to content

Deploy on Alibaba Cloud

Deploy Hermes Agent on Alibaba Cloud ECS for a reliable, scalable solution with low latency for users in China and Asia-Pacific regions.

  • Alibaba Cloud account
  • Basic knowledge of Linux server management
  • (Optional) Domain name for HTTPS setup
  1. Log in to Alibaba Cloud Console
  2. Navigate to Elastic Compute Service (ECS)
  3. Click Create Instance

Recommended Configuration:

ComponentRecommendation
RegionChoose closest to your users (e.g., Shanghai, Beijing, Singapore)
Instance Typeecs.t6-c1m2.large or higher (2 vCPU, 4GB RAM)
Operating SystemUbuntu 22.04 LTS 64-bit
Storage40GB SSD minimum
NetworkVPC with public IP

Open the following ports in your security group:

PortProtocolPurpose
22TCPSSH access
80TCPHTTP (for web UI)
443TCPHTTPS (for web UI)
3000TCPHermes default port (optional)
Terminal window
# SSH into your instance
ssh root@<your-ecs-public-ip>
# Update system
apt update && apt upgrade -y
# Install dependencies
apt install -y curl git python3 python3-pip python3-venv
# Install Hermes Agent
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
# Source the environment
source ~/.bashrc
Terminal window
# Set up your API keys
hermes setup
# Or manually edit config
nano ~/.hermes/config.yaml

Example configuration:

model:
provider: openrouter
model: anthropic/claude-3.5-sonnet
api_key: ${OPENROUTER_API_KEY}
messaging:
telegram:
enabled: true
bot_token: ${TELEGRAM_BOT_TOKEN}
Terminal window
# Start in foreground (for testing)
hermes chat
# Or start as a service
hermes gateway install --system
systemctl start hermes-gateway
systemctl enable hermes-gateway

Using Alibaba Cloud Marketplace (Coming Soon)

Section titled “Using Alibaba Cloud Marketplace (Coming Soon)”

We are working with Alibaba Cloud to provide a pre-configured marketplace image. This will include:

  • Pre-installed Hermes Agent
  • Optimized system configuration
  • Pre-configured security settings
  • One-click deployment

Using Alibaba Cloud RDS for Memory Storage

Section titled “Using Alibaba Cloud RDS for Memory Storage”

For production deployments, consider using Alibaba Cloud RDS PostgreSQL for persistent memory:

memory:
provider: postgres
connection_string: ${RDS_CONNECTION_STRING}

Configure OSS (Object Storage Service) for large file handling:

storage:
backend: oss
bucket: your-bucket-name
region: oss-cn-shanghai

For high-availability deployments:

  1. Create multiple ECS instances
  2. Set up Alibaba Cloud SLB (Server Load Balancer)
  3. Configure health checks
  4. Distribute traffic across instances
Terminal window
# Install CloudMonitor agent
wget http://update2.aegis.aliyun.com/download/cms_install.sh
chmod +x cms_install.sh
./cms_install.sh

Set up alerts for:

  • CPU usage > 80%
  • Memory usage > 85%
  • Disk usage > 90%
  • Network anomalies
Terminal window
# Configure Hermes to output structured logs
# Edit ~/.hermes/config.yaml
logging:
format: json
level: info
output: /var/log/hermes/app.log

For non-critical workloads, use Spot instances to save up to 90%:

  1. Create a Spot instance in ECS console
  2. Set appropriate bid price
  3. Use auto-scaling groups for resilience

Configure auto-scaling to handle varying loads:

Terminal window
# Create scaling group
aliyun ess CreateScalingGroup \
--RegionId cn-shanghai \
--MinSize 1 \
--MaxSize 5 \
--ScalingGroupName hermes-agent-group

Instead of AccessKeys, use RAM roles for ECS instances:

Terminal window
# Attach RAM role to ECS instance
aliyun ecs AttachInstanceRamRole \
--RegionId cn-shanghai \
--InstanceIds '["i-xxxxxxxxx"]' \
--RamRoleName HermesAgentRole

Configure security groups strictly:

Terminal window
# Only allow specific IPs for SSH
aliyun ecs AuthorizeSecurityGroup \
--RegionId cn-shanghai \
--SecurityGroupId sg-xxxxxxxxx \
--IpProtocol tcp \
--PortRange 22/22 \
--SourceCidrIp YOUR_OFFICE_IP/32

Enable automatic snapshots:

Terminal window
aliyun ecs CreateAutoSnapshotPolicy \
--RegionId cn-shanghai \
--TimePoints "[0, 12]" \
--RepeatWeekdays "[1, 4]" \
--RetentionDays 7
Terminal window
# Check security group rules
aliyun ecs DescribeSecurityGroupAttribute \
--RegionId cn-shanghai \
--SecurityGroupId sg-xxxxxxxxx
# Verify network connectivity
ping <your-ecs-ip>
telnet <your-ecs-ip> 22
Terminal window
# Monitor resource usage
top
free -h
df -h
# Check Hermes logs
journalctl -u hermes-gateway -f

For Alibaba Cloud specific issues:

For Hermes Agent issues: