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.
Why Tencent Cloud Lighthouse?
Section titled “Why Tencent Cloud Lighthouse?”- 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
Quick Start
Section titled “Quick Start”1. Create Lighthouse Instance
Section titled “1. Create Lighthouse Instance”- Log in to Tencent Cloud Console
- Navigate to Lighthouse (轻量应用服务器)
- Click Create Instance
Recommended Configuration:
| Component | Recommendation |
|---|---|
| Region | Hong Kong, Singapore, or Silicon Valley (for global access) |
| Package | 2 vCPU, 4GB RAM, 80GB SSD |
| Operating System | Ubuntu 22.04 LTS |
| Traffic Package | 1TB/month (sufficient for most use cases) |
2. Configure Firewall
Section titled “2. Configure Firewall”In the Lighthouse console, open these ports:
| Port | Protocol | Purpose |
|---|---|---|
| 22 | TCP | SSH access |
| 80 | TCP | HTTP |
| 443 | TCP | HTTPS |
3. Connect and Install
Section titled “3. Connect and Install”# SSH into your instance (using the password from console)ssh ubuntu@<your-instance-ip>
# Update systemsudo apt update && sudo apt upgrade -y
# Install Hermes Agentcurl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
# Reload shellsource ~/.bashrc4. Configure and Run
Section titled “4. Configure and Run”# Interactive setuphermes setup
# Or configure manuallynano ~/.hermes/config.yaml
# Start Hermeshermes chatUsing Application Images
Section titled “Using Application Images”Tencent Cloud Lighthouse supports custom images. You can create a Hermes Agent image for rapid deployment:
Creating a Custom Image
Section titled “Creating a Custom Image”- Set up Hermes Agent on a base instance
- Configure all your preferred settings
- Install additional tools you need
- Create an image from the console
- Use this image for new instances
Sharing Images
Section titled “Sharing Images”You can share your configured image across regions or with team members:
# On the source instance, clean up sensitive datarm -f ~/.hermes/.envrm -rf ~/.hermes/memories/
# Then create the image from consolePerformance Optimization
Section titled “Performance Optimization”For 2GB RAM Instances
Section titled “For 2GB RAM Instances”If using the entry-level 2GB RAM package:
model: # Use a smaller context window max_tokens: 2000
terminal: # Limit concurrent processes timeout: 60SSD Optimization
Section titled “SSD Optimization”# Enable swap for small instances (optional)sudo fallocate -l 2G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfile
# Make permanentecho '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabBackup and Snapshot
Section titled “Backup and Snapshot”Automatic Snapshots
Section titled “Automatic Snapshots”Configure automatic snapshots in the Lighthouse console:
- Go to your instance details
- Click Snapshot tab
- Set up Automatic Snapshot Policy
- Recommended: Daily snapshots, retain 7 days
Manual Backup
Section titled “Manual Backup”# Backup Hermes configurationtar czf ~/hermes-backup-$(date +%Y%m%d).tar.gz ~/.hermes/
# Download to local machinescp ubuntu@<instance-ip>:~/hermes-backup-*.tar.gz ./Monitoring
Section titled “Monitoring”Basic Monitoring
Section titled “Basic Monitoring”# Install htop for interactive monitoringsudo apt install htop
# Check resource usagehtop
# Monitor disk usagedf -h
# Monitor memoryfree -hCloud Monitor
Section titled “Cloud Monitor”Enable Tencent Cloud Monitor for alerts:
- In the console, go to Cloud Monitor
- Add your Lighthouse instance
- Set up alert rules:
- CPU > 80%
- Memory > 85%
- Disk > 90%
Troubleshooting
Section titled “Troubleshooting”High Latency
Section titled “High Latency”If experiencing slow responses:
# Check network connectivityping api.openai.com
# Test with different DNSsudo nano /etc/resolv.conf# Add: nameserver 8.8.8.8# Add: nameserver 1.1.1.1Out of Memory
Section titled “Out of Memory”# Check what's using memoryps aux --sort=-%mem | head -20
# Reduce Hermes memory footprint# Edit ~/.hermes/config.yamlmemory: memory_char_limit: 1500 user_char_limit: 1000Traffic Limit
Section titled “Traffic Limit”Monitor your traffic usage:
# Check current month usage in console# Or install vnstatsudo apt install vnstatvnstatCost Optimization
Section titled “Cost Optimization”Choose the Right Region
Section titled “Choose the Right Region”- Hong Kong: Good for Asia, moderate price
- Singapore: Good for Southeast Asia
- Silicon Valley: Good for US West Coast
- Frankfurt: Good for Europe
Use Annual Plans
Section titled “Use Annual Plans”Save up to 30% with annual payment:
- 1-year plan: ~20% discount
- 3-year plan: ~30% discount
Traffic Package Management
Section titled “Traffic Package Management”If you exceed the traffic package:
- Monitor usage in console
- Purchase additional traffic if needed
- Or upgrade to a higher plan
Security Recommendations
Section titled “Security Recommendations”1. Disable Password Authentication
Section titled “1. Disable Password Authentication”# Edit SSH configsudo nano /etc/ssh/sshd_config
# Set:PasswordAuthentication noPubkeyAuthentication yes
# Restart SSHsudo systemctl restart sshd2. Configure UFW Firewall
Section titled “2. Configure UFW Firewall”sudo apt install ufwsudo ufw default deny incomingsudo ufw allow 22/tcpsudo ufw allow 80/tcpsudo ufw allow 443/tcpsudo ufw enable3. Automatic Security Updates
Section titled “3. Automatic Security Updates”sudo apt install unattended-upgradessudo dpkg-reconfigure unattended-upgradesMigration from Other Providers
Section titled “Migration from Other Providers”If migrating from another cloud provider:
-
Export your Hermes configuration:
Terminal window tar czf hermes-config.tar.gz ~/.hermes/ -
Transfer to new instance:
Terminal window scp hermes-config.tar.gz ubuntu@<new-instance>:~/ -
Extract and restore:
Terminal window tar xzf hermes-config.tar.gz# Re-enter API keys in ~/.hermes/.env