Running OpenClaw locally has one big, unavoidable problem: itโs just not reliable. The moment your computer shuts down or goes to sleep, the agent goes offline. Your IP changes, you canโt manage it from your phone, and thereโs no real 24/7 uptime. Moving it to a VPS fixes all of that in one go โ you get a fixed public IP, the service stays online around the clock, and you can check on it from anywhere. The cost is pretty reasonable too. A basic plan that can handle personal use runs $3โ5/month.
Choosing the right configuration
You really donโt need to overspec it. Just match the resources to how youโll actually use it:
| Use case | Recommended configuration |
|---|---|
| Personal use | 2 cores / 2GB RAM / NVMe SSD |
| Small team | 2 cores / 4GB RAM |
| High concurrency | 4 cores / 8GB RAM |
The absolute entry-level 1-core / 1GB plans usually struggle once you turn on browser automation โ memory gets eaten up fast. 2 cores and 2GB is the sweet spot for smooth, stable running. For the OS, Ubuntu 22.04 LTS is still the safest choice. It has long-term support, great compatibility with pretty much everything, and youโll find documentation everywhere.
Docker deployment: the cleanest approach
Running OpenClaw through Docker is hands-down the best way. Everything stays isolated, it wonโt clash with other stuff on the server, and moving or upgrading later is much easier.
Install Docker first:
sudo apt update && sudo apt install -y docker.io docker-compose
sudo systemctl enable docker && sudo systemctl start docker
sudo usermod -aG docker $USER
newgrp docker
Then pull and start OpenClaw:
docker run -d \
--name openclaw \
-p 8080:8080 \
--restart always \
-v ~/.openclaw:/app/data \
openclaw/openclaw:latest
The --restart always flag makes sure the container comes back up automatically after any reboot. The volume mount -v ~/.openclaw:/app/data keeps your data safe on the host even if you ever rebuild the container.
Quick check that itโs running:
docker ps
docker logs -f openclaw
Security hardening: do this immediately after deployment
Donโt put this off. Anything exposed to the public internet gets scanned by bots within minutes.
Set up UFW and only open the ports you actually need:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw deny 8080 # Access through Nginx proxy, not directly
sudo ufw enable
Set up Nginx reverse proxy with basic authentication:
sudo apt install nginx apache2-utils -y
sudo htpasswd -c /etc/nginx/.htpasswd your_username
Nginx config:
server {
listen 80;
server_name your_domain_or_IP;
location / {
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Enable HTTPS with Letโs Encrypt:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d your_domain
Add Fail2ban to block brute-force attacks:
sudo apt install fail2ban -y
sudo systemctl enable fail2ban && sudo systemctl start fail2ban
Create a rules file:
sudo nano /etc/fail2ban/jail.local
[sshd]
enabled = true
maxretry = 5
bantime = 3600
findtime = 600
[nginx-http-auth]
enabled = true
port = http,https
logpath = /var/log/nginx/error.log
maxretry = 5
bantime = 3600
sudo systemctl restart fail2ban
Performance optimization: check here first if things feel slow
If OpenClaw feels sluggish or tasks are lagging, start by checking resource usage:
htop
If CPU or memory is consistently above 90%, either upgrade the plan or kill off anything you donโt actually need.
Enable BBR for better network performance โ especially useful for cross-border connections:
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
Confirm itโs working:
sysctl net.ipv4.tcp_congestion_control
# Should output: net.ipv4.tcp_congestion_control = bbr
Node location makes a surprisingly big difference in latency. If youโre in mainland China, go for Hong Kong, Singapore, or Japan nodes. For European or US users, pick the closest region. Donโt cheap out on location just to save a couple of dollars.
Automation: reduce manual maintenance
For anything that needs to run long-term, a little automation saves a ton of headache.
Clean up old logs so the disk doesnโt fill up:
crontab -e
# Add:
0 3 * * * find /var/log -type f -name "*.log" -mtime +7 -delete
Simple daily backup:
nano ~/backup.sh
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
tar -czf ~/backups/openclaw_$DATE.tar.gz ~/.openclaw
find ~/backups -mtime +7 -delete
echo "Backup done: $DATE"
chmod +x ~/backup.sh
crontab -e
# Add:
0 2 * * * ~/backup.sh >> ~/backup.log 2>&1
Monitoring: know about problems before they escalate
Install Uptime Kuma so you get alerts the moment something goes down:
docker run -d \
--name uptime-kuma \
--restart always \
-p 3001:3001 \
-v uptime-kuma:/app/data \
louislam/uptime-kuma:latest
Go to http://yourIP:3001 to set up monitoring and connect Telegram or email notifications.
Check live container stats anytime:
docker stats openclaw
Common pitfalls
Starting with 1-core / 1GB RAM: memory gets exhausted fast once browser automation kicks in. Begin with at least 2 cores and 2GB.
Skipping security setup after deployment: unauthenticated services get found and abused almost immediately.
Not setting up backups: VPS maintenance reboots happen. Without proper volume mounts and regular backups, rebuilding a container can mean losing everything.
Choosing an ultra-cheap, heavily oversold provider: performance tanks during peak hours, and long-term stability becomes painful.
Summary
Follow this order: Docker deployment, firewall + authentication, HTTPS, Fail2ban, BBR acceleration, automated backups, and monitoring alerts. Each step is fairly straightforward on its own, but together they give you a solid, reliable foundation for running OpenClaw long-term without constant headaches.