VPS Deployment
Deploy OpenClaw on a cloud server
1Server Requirements
- Ubuntu 22.04 / Debian 12 or CentOS 9 (Ubuntu recommended)
- At least 2 CPU cores, 4GB RAM
- Works with DigitalOcean, AWS, Linode, Hetzner, etc.
2Install Base Environment
SSH into your server and install dependencies:
terminal
# Update system
sudo apt update && sudo apt upgrade -y
# Install Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install OpenClaw
npm install -g clawdbot
# Configure API key
export ANTHROPIC_API_KEY="your-api-key"3Configure Nginx Reverse Proxy
Install Nginx and set up reverse proxy:
terminal
# Install Nginx
sudo apt install -y nginx
# Create config file
sudo tee /etc/nginx/sites-available/openclaw << 'EOF'
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:3000;
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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
EOF
# Enable site
sudo ln -s /etc/nginx/sites-available/openclaw /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx4Configure SSL Certificate
Use free SSL from Let's Encrypt:
terminal
# Install Certbot
sudo apt install -y certbot python3-certbot-nginx
# Request certificate
sudo certbot --nginx -d your-domain.com
# Test auto-renewal
sudo certbot renew --dry-run5Manage with systemd
Create a systemd service for auto-start:
terminal
sudo tee /etc/systemd/system/openclaw.service << 'EOF'
[Unit]
Description=OpenClaw AI Assistant
After=network.target
[Service]
Type=simple
User=root
Environment=ANTHROPIC_API_KEY=your-api-key
ExecStart=/usr/bin/clawdbot start
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclawTips
- β’Run the service as a non-root user for better security
- β’Configure UFW firewall to only allow ports 80/443
- β’Regularly back up the ~/.openclaw directory
Warning
- β’Always configure SSL to avoid transmitting API keys in plain text
- β’Enable authentication for public deployments to prevent unauthorized access
Frequently Asked Questions
What VPS specifications do I need for OpenClaw?βΎ
At minimum 2 CPU cores and 4GB RAM. Ubuntu 22.04 is recommended. Works with any cloud provider: DigitalOcean, AWS, Linode, Hetzner, etc.
Do I need to configure SSL for OpenClaw on a VPS?βΎ
Yes, SSL is strongly recommended to protect API keys in transit. Use free Let's Encrypt certificates with Certbot for automatic setup and renewal.
How do I manage OpenClaw as a service on Linux?βΎ
Create a systemd service file that runs "clawdbot start". Enable it with systemctl to get automatic restarts and boot-time startup.