Prerequisites
Before starting, ensure you have:
Server Requirements
- • RamNode VPS (4GB+ RAM recommended)
- • Ubuntu 20.04/22.04 or Debian 11+
- • 2+ CPU cores
- • 20GB+ disk space
- • SSH access to your VPS
API Requirements
- • OpenAI API key (required)
- • Anthropic API key (optional)
- • Google API key (optional)
- • Basic Linux knowledge
Initial Server Setup
Connect to your RamNode VPS and prepare the environment:
ssh root@your-server-ipapt update && apt upgrade -yapt install -y curl wget git python3 python3-pip build-essential
apt install -y ca-certificates gnupg lsb-release💡 System Tip: Agent.Zero requires significant computational resources. A VPS with at least 4GB RAM is recommended for optimal performance.
Install Docker
Agent.Zero runs in Docker containers for isolation and easy management:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/nullapt update
apt install -y docker-ce docker-ce-cli containerd.io docker-compose-pluginsystemctl start docker
systemctl enable docker
usermod -aG docker $USERdocker --version && docker compose version✅ Docker is now installed and ready for Agent.Zero deployment!
Clone and Install Agent.Zero
Download and set up the Agent.Zero framework:
cd /opt
git clone https://github.com/frdel/agent-zero.git
cd agent-zeromkdir -p work_dir
chmod 755 work_dirWhat is Agent.Zero?
Agent.Zero is a powerful autonomous AI agent framework designed to be dynamic and self-learning. It can execute code, manage multiple agents, and complete complex tasks with minimal human oversight. Its Docker-first architecture ensures secure and isolated execution.
Configuration Setup
Configure Agent.Zero with your specific settings:
cp .env.example .envnano .envConfigure the following essential settings:
# OpenAI Configuration (Required)
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4
# Anthropic Configuration (Optional)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
ANTHROPIC_MODEL=claude-3-sonnet
# Agent Configuration
AGENT_NAME=Agent.Zero
AGENT_PERSONALITY=helpful,analytical,creative
# Docker Configuration
DOCKER_ENABLED=true
EXECUTION_TIMEOUT=300
# Web Interface
WEB_PORT=8080
WEB_HOST=0.0.0.0🔐 Security: Never commit your API keys to version control. Keep your .env file secure and use strong, unique API keys.
API Keys Configuration
Set up your AI model API keys for Agent.Zero:
OpenAI API Key (Required)
Essential for Agent.Zero's core functionality:
- 1. Visit OpenAI API Keys
- 2. Create a new API key
- 3. Add credit to your OpenAI account
- 4. Copy the key to your .env file
Additional API Keys (Optional)
Enhance Agent.Zero with additional capabilities:
- • Anthropic Claude: Advanced reasoning capabilities
- • Google Search: Web search functionality
- • Weather APIs: Real-time weather data
cd /opt/agent-zero
python3 -c "import os; from dotenv import load_dotenv; load_dotenv(); print('OpenAI Key:', 'SET' if os.getenv('OPENAI_API_KEY') else 'NOT SET')"First Run and Testing
Start Agent.Zero and verify it's working correctly:
cd /opt/agent-zero
docker compose up --build -ddocker compose psdocker compose logs -f agent-zero# Connect to the running container
docker compose exec agent-zero python3 -c "
import sys
sys.path.append('/app')
from agent_zero import Agent
print('Agent.Zero is ready!')
"🚀 Success: Agent.Zero is now running! You can access the web interface on port 8080.
Web Interface Setup
Access and configure the Agent.Zero web interface:
apt install -y nginx
nano /etc/nginx/sites-available/agent-zeroserver {
listen 80;
server_name your-domain.com; # Replace with your domain
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
proxy_read_timeout 86400;
}
}ln -s /etc/nginx/sites-available/agent-zero /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx🌐 Web Access: You can now access Agent.Zero through your domain or server IP address.
Multi-Agent Configuration
Set up multiple Agent.Zero instances for enhanced capabilities:
cd /opt/agent-zero
docker compose up --scale agent-zero=3 -d# Add to .env file
MULTI_AGENT_MODE=true
AGENT_COORDINATION=true
MAX_AGENTS=5
AGENT_COMMUNICATION=websocketMulti-Agent Benefits
- • Parallel Processing: Handle multiple tasks simultaneously
- • Specialization: Assign different roles to different agents
- • Redundancy: Improved reliability and fault tolerance
- • Coordination: Agents can cooperate on complex tasks
Performance Optimization
Optimize Agent.Zero for your RamNode VPS:
System Optimization
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
sysctl -pDocker Resource Limits
version: '3.8'
services:
agent-zero:
# ... existing configuration
deploy:
resources:
limits:
memory: 2G
cpus: '1.5'
reservations:
memory: 1G
cpus: '1.0'Agent.Zero Performance Settings
# Add to .env file
EXECUTION_TIMEOUT=600
MAX_CONCURRENT_TASKS=3
MEMORY_LIMIT=2048
CPU_LIMIT=150
CACHE_ENABLED=true
CACHE_SIZE=1000⚡ Performance Tip: Monitor resource usage with docker stats and adjust limits based on your workload.
Security Configuration
Secure your Agent.Zero deployment:
ufw --force enable
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 80
ufw allow 443apt install -y certbot python3-certbot-nginx
certbot --nginx -d your-domain.com# Add to .env file
ENABLE_AUTH=true
ADMIN_PASSWORD=your_secure_admin_password
SESSION_TIMEOUT=3600
RATE_LIMITING=true
MAX_REQUESTS_PER_MINUTE=60🔒 Security Warning: Agent.Zero has powerful capabilities. Always run it behind authentication and never expose it directly to the internet without proper security measures.
Monitoring and Maintenance
Monitor your Agent.Zero deployment:
apt install -y htop iotop nethogs
docker stats --no-stream#!/bin/bash
# /opt/monitor-agent-zero.sh
echo "=== Agent.Zero Status ==="
docker compose -f /opt/agent-zero/docker-compose.yml ps
echo -e "
=== Resource Usage ==="
docker stats --no-stream
echo -e "
=== Disk Usage ==="
df -h
echo -e "
=== Memory Usage ==="
free -h
echo -e "
=== Recent Logs ==="
docker compose -f /opt/agent-zero/docker-compose.yml logs --tail=10chmod +x /opt/monitor-agent-zero.sh
crontab -e
# Add: 0 */6 * * * /opt/monitor-agent-zero.sh >> /var/log/agent-zero-monitor.log📊 Monitoring Tip: Regular monitoring helps prevent issues and ensures optimal performance. Consider setting up log rotation to manage disk space.
Troubleshooting
Common issues and solutions:
🛠️ Support: For additional help, check the Agent.Zero GitHub repository or contact RamNode support for VPS-specific issues.
🎉 Agent.Zero Successfully Deployed!
Your autonomous AI agent is now running on RamNode VPS. Agent.Zero can now execute code, manage tasks, and cooperate with other agents to complete complex workflows.
