← Back to Blog

How to Deploy OpenClaw on Any Linux VPS

Ronak KadhiRonak Kadhi
March 22, 20265 min read
Blog cover for How to Deploy OpenClaw on Any Linux VPS

The universal deployment guide. Whether you're on DigitalOcean, Hetzner, Linode, Vultr, or OVH — if it runs Linux, this works.

Requirements

| Resource | Minimum | Recommended | | ---------- | --------- | ------------- | | CPU | 1 vCPU | 2+ vCPUs | | RAM | 2 GB | 4 GB | | Storage | 20 GB SSD | 50 GB+ SSD | | OS | Ubuntu 22.04+ | Ubuntu 24.04 LTS |

Part 1: Server Foundation

System update, create service user, harden SSH (port 2222, key-only, no root), configure UFW + Fail2Ban, set up swap if needed, set timezone to UTC.

Get Your Free Marketing Audit

AI agents analyze your site for SEO, CRO, and content issues — full report in 2 minutes.

Audit My Site Free →

Part 2: Install Docker

Docker Engine with Compose v2, daemon configured for production (json-file logging with limits, overlay2 storage, live-restore for daemon restarts).

Part 3: Deploy ClawdBot

Structured /opt/clawdbot/ directory with secrets (chmod 700), Docker Compose with security hardening (non-root, cap_drop ALL, no-new-privileges, resource limits). Optional systemd service for boot persistence.

Part 4: nginx Reverse Proxy

Full config with upstream keepalive, separate rate limit zones for API and auth, WebSocket endpoint for real-time updates, security headers (HSTS, CSP, X-Frame-Options), SSL via certbot.

Part 5: Monitoring and Maintenance

Health check with auto-restart and alerting, automated daily backups, update script with rollback on failed health checks, cron schedule for all maintenance tasks.

VPS Provider Reference

| Provider | Cheapest Viable | Notes | | ---------- | ---------------- | ------- | | DigitalOcean | $24/mo (4 GB) | Best docs | | Hetzner | €4.51/mo (4 GB) | Best price/performance EU | | Hostinger | $5.49/mo (4 GB) | Budget option | | Contabo | €5.99/mo (8 GB) | Cheap, slower I/O |

Full control, full responsibility. If you'd rather skip the sysadmin work, RunAgents wraps all of this into a managed platform with a dashboard your whole team can use.


Want to skip the sysadmin work entirely? RunAgents gives you managed OpenClaw hosting with task management, team collaboration, and agent debugging built in. Get started free →

Related Guides

Frequently Asked Questions

What are the minimum server specs to run OpenClaw on a Linux VPS?

Minimum is 1 vCPU, 2 GB RAM, and 20 GB SSD. Recommended is 2+ vCPUs and 4 GB RAM for comfortable multi-agent use. If you're on a 2 GB plan, add swap space to prevent out-of-memory kills during heavy agent operations. SSD storage is important — HDD will noticeably slow down agent performance.

Should I use Ubuntu or Debian for my OpenClaw server?

Ubuntu 24.04 LTS is recommended. It has the best Docker support, most tutorials are written for it, and unattended-upgrades works reliably. Debian 12 works fine too and uses slightly less resources, but you'll find less community support for troubleshooting. Avoid non-LTS releases — you want stability for a 24/7 agent server.

Do I need Docker Compose or can I run OpenClaw with plain Docker?

Docker Compose v2 is strongly recommended. It handles multi-container orchestration, environment variables, volume mounts, resource limits, health checks, and restart policies in a single docker-compose.yml file. Running with plain docker run works but makes updates, security hardening, and maintenance significantly harder.

How do I set up automatic updates for OpenClaw on my VPS?

Create an update script that pulls the latest Docker image, recreates the container, runs a health check, and automatically rolls back if the health check fails. Schedule it via cron (weekly is a good cadence). Also enable unattended-upgrades on the host OS for security patches.

Which Linux VPS provider offers the best value for running AI agents?

Hetzner offers the best price-to-performance ratio in Europe (€4.51/month for 4 GB RAM). For US-based deployments close to LLM API providers, DigitalOcean ($24/month) has the best documentation and reliability. Hostinger ($5.49/month) is the budget pick. If you want to skip VPS management entirely, RunAgents provides managed hosting with a team dashboard starting at $49/month.

Get Your Free Marketing Audit

Our AI agents analyze your site and surface every SEO, CRO, and content problem — with prioritized fixes. Full report in 2 minutes.

Audit My Site Free →

No credit card required