OpenClaw on a Cheap VPS: Deploy Your Agent for $5/Month
Deploy OpenClaw on budget VPS providers. Compare Oracle Cloud Free Tier, DigitalOcean, Hetzner, and Contabo. Learn to configure SSL, DNS, and monitoring.
Prerequisites
OpenClaw installed locally Β· Basic Linux command-line knowledge Β· Understanding of SSH and DNS
OpenClaw on a Cheap VPS: Deploy Your Agent for $5/Month
Running OpenClaw locally on your computer works great for development, but a production AI assistant needs to run 24/7 on a dedicated server. The good news? You can host a fully functional OpenClaw instance for as little as $5/month on a Virtual Private Server (VPS). This guide walks you through selecting a provider, setting up your server, and deploying OpenClaw for reliable, always-on operation.
Why a VPS?
Your laptop isn't ideal for production deployment because:
- Availability: Your laptop can't run 24/7 reliably (updates, reboots, sleep mode)
- Connectivity: ISP connection issues or mobility means your assistant goes offline
- Performance: Shared resources with your personal work
- Security: Running internet-facing services on your personal device is risky
A VPS solves all these problems for just $5/monthβless than a cup of coffee.
VPS Provider Comparison
1. Oracle Cloud Always Free Tier (Best for Free)
Cost: Free indefinitely Specs: 4 vCPUs, 24GB RAM, 200GB storageOracle Cloud's always-free tier is genuinely unlimited and never expires. It's the best choice if you're budget-conscious and don't mind slight setup complexity.
Pros:- Truly free forever (not a trial)
- Powerful specs for the price
- Global data center options
- Slightly more complex console interface
- Account requires credit card
- Less popular documentation
2. DigitalOcean (Best for Beginners)
Cost: $6/month for 1GB RAM, $12/month for 2GB Specs: SSD storage, great documentation, simple interfaceDigitalOcean is known for excellent documentation and an intuitive interface. Perfect if this is your first VPS.
Pros:- Easiest setup process
- Excellent tutorials and community
- Simple pricing (no surprises)
- Good uptime history
- Slightly more expensive than alternatives
- Minimum specs needed for OpenClaw (2GB recommended)
OPENCLAW for $200 credit
3. Hetzner Cloud (Best for Performance)
Cost: β¬3-4/month (~$3-5 USD) for 2GB RAM, 40GB SSD Specs: Modern hardware, excellent network, fast SSDHetzner offers exceptional performance for the price. German-based with great reliability.
Pros:- Lowest cost for performance
- Excellent network connectivity
- Dedicated support team
- Locations across Europe and US
- Less documentation than DigitalOcean
- Interface not as polished
- Requires non-US payment method
4. Contabo (Most Storage)
Cost: β¬3.99/month (~$4.50 USD) for 4GB RAM, 200GB SSD Specs: Great for content-heavy applicationsContabo is excellent if you plan to store large datasets or run multiple instances.
Pros:- Massive storage for the price
- Good documentation
- Flexible billing
- Multiple data centers
- Slightly slower support response
- Less brand recognition
- Occasional reviews about overselling
Step 1: Choose Your Provider and Create an Account
For this guide, we'll use Hetzner Cloud (best value), but the process is similar for any provider:
- Go to hetzner.com/cloud
- Sign up for a new account
- Add payment method
- Click "Create Server"
Step 2: Launch Your VPS
Hetzner Cloud Setup
- Choose location: Select a region closest to your users (Germany, Finland, or US-East)
- Select image: Choose "Ubuntu 22.04" (LTS for stability)
- Select server: Choose "CX21" (3 vCPU, 4GB RAM, β¬3.99/month)
- Storage type: Select "SSD"
- Additional options: Enable backups (optional, adds ~20% to cost)
- SSH key: Create a new SSH key or upload your existing public key
- Name: Call it something like "openclaw-primary"
- Create: Click "Create Server"
Your server will boot in 2-3 minutes. You'll see the IP address on the dashboard.
Step 3: Connect to Your VPS
Open your terminal and SSH into the server:
ssh root@YOUR_VPS_IP_ADDRESS
Example:
ssh root@192.0.2.123
If you set up SSH keys, you'll log in directly. If using password, you'll be prompted.
Step 4: Prepare Your Server
Update packages and install Docker:
# Update system
apt-get update
apt-get upgrade -y
Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
Install Docker Compose
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Verify installation
docker --version
docker-compose --version
Step 5: Clone OpenClaw and Configure
# Clone repository
git clone https://github.com/openclaw-ai/openclaw.git /opt/openclaw
cd /opt/openclaw
Copy and edit environment file
cp .env.example .env
nano .env
Key environment variables for production:
# Change these for production
OPENCLAW_ENVIRONMENT=production
OPENCLAW_DEBUG=false
Change the secret key to something random
SECRET_KEY=$(openssl rand -base64 32)
Change default admin password
ADMIN_PASSWORD=$(openssl rand -base64 12)
Allow your domain (we'll get a domain next)
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
Email configuration for alerts
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password
AI Model - keep as is or change if you have OpenAI/other keys
AI_MODEL_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-xxxxx
Step 6: Set Up a Domain (Optional but Recommended)
Instead of accessing OpenClaw at 192.0.2.123, set up a domain:
- Buy a domain: Use Namecheap.com, GoDaddy, or Cloudflare Registrar (~$10/year)
- Point to your VPS: Update the A record to your VPS IP
- Create/update A record: @ β Your VPS IP
- Create/update CNAME: www β your domain
- Update OpenClaw: Modify
ALLOWED_HOSTSin your.envto include your domain
Example DNS records:
Type Name Value
A @ 192.0.2.123
CNAME www yourdomain.com
Wait 5-10 minutes for DNS to propagate.
Step 7: Set Up SSL/HTTPS
Encrypt traffic to your VPS with Let's Encrypt (free):
# Install Certbot
apt-get install certbot python3-certbot-nginx -y
Generate certificate for your domain
certbot certonly --standalone -d yourdomain.com -d www.yourdomain.com
Store certificate paths in .env
CERT_PATH=/etc/letsencrypt/live/yourdomain.com/fullchain.pem
KEY_PATH=/etc/letsencrypt/live/yourdomain.com/privkey.pem
Update your Docker Compose to use these certificates.
Step 8: Start OpenClaw
cd /opt/openclaw
docker-compose up -d
Check if everything started
docker-compose ps
View logs
docker-compose logs -f
Wait 30-60 seconds for all services to start. Check logs for errors.
Step 9: Access Your OpenClaw Instance
Navigate to your domain or VPS IP:
https://yourdomain.com
https://YOUR_VPS_IP
Log in with the admin credentials from your .env file.
Step 10: Configure Persistent Backups
Your VPS data is only on that server. Set up automated backups:
# Create daily backup script
cat > /opt/openclaw/backup.sh << 'EOF'
#!/bin/bash
BACKUP_DIR="/backups"
DATE=$(date +%Y%m%d_%H%M%S)
docker-compose -f /opt/openclaw/docker-compose.yml exec -T postgres pg_dump openclaw | gzip > $BACKUP_DIR/openclaw_$DATE.sql.gz
find $BACKUP_DIR -name "openclaw_*.sql.gz" -mtime +30 -delete
EOF
chmod +x /opt/openclaw/backup.sh
Create cron job to run daily at 2 AM
(crontab -l 2>/dev/null; echo "0 2 * /opt/openclaw/backup.sh") | crontab -
Store backups securely (consider uploading to AWS S3 or Backblaze B2).
Step 11: Monitor Your Instance
Check that OpenClaw is running and healthy:
# Check container status
docker-compose ps
View real-time logs
docker-compose logs -f openclaw-api
Check disk usage
df -h
Check memory usage
free -h
Test the API
curl https://yourdomain.com/api/health
Performance Tuning for Low-Resource VPS
If you're on a very tight budget (1GB RAM), optimize OpenClaw:
Reduce model size:# Use smaller model in .env
AI_MODEL_NAME=claude-3-haiku # Instead of opus
Limit concurrent connections:
Edit docker-compose.yml:
openclaw-api:
environment:
- WORKER_PROCESSES=2
- MAX_CONNECTIONS=20
Enable caching:
# Redis cache is already included, ensure it's configured
REDIS_MEMORY_LIMIT=512mb
Troubleshooting VPS Deployment
Connection refused to VPS
Your firewall may be blocking SSH. In your VPS provider console:
- Go to Firewall/Security Groups settings
- Ensure port 22 (SSH) is open to your IP
- Ensure ports 80, 443 (HTTP/HTTPS) are open for OpenClaw
"Out of memory" errors
Your server is running out of RAM. Check memory usage:
free -h
docker stats
Solutions:
- Upgrade to a larger VPS tier
- Disable unnecessary skills
- Use a smaller AI model
Domain not resolving
DNS changes take 5-30 minutes to propagate. Wait and retry:
nslookup yourdomain.com
dig yourdomain.com
SSL certificate issues
Ensure your domain correctly points to your VPS:
ping yourdomain.com # Should show your VPS IP
curl https://yourdomain.com # Should load OpenClaw
Scaling Beyond a Single $5 VPS
As you grow, consider:
- Load balancer: Distribute traffic across multiple OpenClaw instances
- Managed database: Move PostgreSQL to a managed service
- Separate Redis: Use managed Redis for caching
- CDN: Use Cloudflare for faster static asset delivery
For most users, one $5 VPS handles hundreds of requests daily.
Frequently Asked Questions
Q: Can I run multiple OpenClaw instances on one VPS?A: Yes, but performance will degrade. A $5 VPS is optimized for one instance. For multiple instances, use a larger server or multiple VPS instances.
Q: What if I want to upgrade VPS providers later?A: Your data lives in PostgreSQL. Export your database and restore on the new server. Skills and configurations are stored in the database.
Q: How do I access OpenClaw remotely but keep it private?A: Set ALLOWED_HOSTS to your domain only. Use a firewall to restrict API access to your IP address, or put OpenClaw behind a VPN.
A: Yes, multiple users can access the same OpenClaw instance. However, each concurrent user increases resource usage. A $5 VPS comfortably supports 5-10 regular users.
Q: How do I update OpenClaw on my VPS?A: SSH in, navigate to /opt/openclaw, run git pull origin main, then docker-compose pull && docker-compose up -d --build.
Next Steps
Your OpenClaw instance is now live on the internet. What's next?
- Connect Messaging Platforms β Set up WhatsApp, Telegram, or Discord for remote access
- Finding and Installing Skills β Expand your assistant's capabilities
- Security Best Practices β Secure your production instance