Skip to content

Deploy on Tencent Cloud

Tencent Cloud Lighthouse is an ideal platform for running Hermes Agent, offering simple deployment, predictable pricing, and good network connectivity in China and globally.

  • Simple: One-click application deployment
  • Affordable: Starting from ~30 CNY/month
  • Fast: SSD storage and optimized network
  • Global: Multiple regions including Hong Kong, Singapore, Silicon Valley
  1. Log in to Tencent Cloud Console
  2. Navigate to Lighthouse (轻量应用服务器)
  3. Click Create Instance

Recommended Configuration:

ComponentRecommendation
RegionHong Kong, Singapore, or Silicon Valley (for global access)
Package2 vCPU, 4GB RAM, 80GB SSD
Operating SystemUbuntu 22.04 LTS
Traffic Package1TB/month (sufficient for most use cases)

In the Lighthouse console, open these ports:

PortProtocolPurpose
22TCPSSH access
80TCPHTTP
443TCPHTTPS
Terminal window
# SSH into your instance (using the password from console)
ssh ubuntu@<your-instance-ip>
# Update system
sudo apt update && sudo apt upgrade -y
# Install Hermes Agent
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
# Reload shell
source ~/.bashrc
Terminal window
# Interactive setup
hermes setup
# Or configure manually
nano ~/.hermes/config.yaml
# Start Hermes
hermes chat

Tencent Cloud Lighthouse supports custom images. You can create a Hermes Agent image for rapid deployment:

  1. Set up Hermes Agent on a base instance
  2. Configure all your preferred settings
  3. Install additional tools you need
  4. Create an image from the console
  5. Use this image for new instances

You can share your configured image across regions or with team members:

Terminal window
# On the source instance, clean up sensitive data
rm -f ~/.hermes/.env
rm -rf ~/.hermes/memories/
# Then create the image from console

If using the entry-level 2GB RAM package:

~/.hermes/config.yaml
model:
# Use a smaller context window
max_tokens: 2000
terminal:
# Limit concurrent processes
timeout: 60
Terminal window
# Enable swap for small instances (optional)
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Make permanent
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Configure automatic snapshots in the Lighthouse console:

  1. Go to your instance details
  2. Click Snapshot tab
  3. Set up Automatic Snapshot Policy
  4. Recommended: Daily snapshots, retain 7 days
Terminal window
# Backup Hermes configuration
tar czf ~/hermes-backup-$(date +%Y%m%d).tar.gz ~/.hermes/
# Download to local machine
scp ubuntu@<instance-ip>:~/hermes-backup-*.tar.gz ./
Terminal window
# Install htop for interactive monitoring
sudo apt install htop
# Check resource usage
htop
# Monitor disk usage
df -h
# Monitor memory
free -h

Enable Tencent Cloud Monitor for alerts:

  1. In the console, go to Cloud Monitor
  2. Add your Lighthouse instance
  3. Set up alert rules:
    • CPU > 80%
    • Memory > 85%
    • Disk > 90%

If experiencing slow responses:

Terminal window
# Check network connectivity
ping api.openai.com
# Test with different DNS
sudo nano /etc/resolv.conf
# Add: nameserver 8.8.8.8
# Add: nameserver 1.1.1.1
Terminal window
# Check what's using memory
ps aux --sort=-%mem | head -20
# Reduce Hermes memory footprint
# Edit ~/.hermes/config.yaml
memory:
memory_char_limit: 1500
user_char_limit: 1000

Monitor your traffic usage:

Terminal window
# Check current month usage in console
# Or install vnstat
sudo apt install vnstat
vnstat
  • Hong Kong: Good for Asia, moderate price
  • Singapore: Good for Southeast Asia
  • Silicon Valley: Good for US West Coast
  • Frankfurt: Good for Europe

Save up to 30% with annual payment:

  • 1-year plan: ~20% discount
  • 3-year plan: ~30% discount

If you exceed the traffic package:

  1. Monitor usage in console
  2. Purchase additional traffic if needed
  3. Or upgrade to a higher plan
Terminal window
# Edit SSH config
sudo nano /etc/ssh/sshd_config
# Set:
PasswordAuthentication no
PubkeyAuthentication yes
# Restart SSH
sudo systemctl restart sshd
Terminal window
sudo apt install ufw
sudo ufw default deny incoming
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Terminal window
sudo apt install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades

If migrating from another cloud provider:

  1. Export your Hermes configuration:

    Terminal window
    tar czf hermes-config.tar.gz ~/.hermes/
  2. Transfer to new instance:

    Terminal window
    scp hermes-config.tar.gz ubuntu@<new-instance>:~/
  3. Extract and restore:

    Terminal window
    tar xzf hermes-config.tar.gz
    # Re-enter API keys in ~/.hermes/.env