GuidesEngineering

How to Host OpenClaw: Docker, VPS, and the Zero-Ops Alternative

A practitioner's guide to OpenClaw hosting, from Docker Compose and VPS deployment to managed cloud options and the zero-ops alternative for teams who want always-on agents without infrastructure.

Headshot of Iddo Gino
Iddo Gino · Founder & CEO
Server rack with network cables and status LEDs illustrating hosting infrastructure for OpenClaw deployment
Photo by Taylor Vick on Unsplash

Your personal AI agent needs a server that never sleeps. OpenClaw isn't a chatbot you open in a browser tab. It's a persistent agent that connects to 25+ messaging channels (WhatsApp, Telegram, Slack, Discord, Signal, and more) and executes tasks on its own: browsing the web, managing files, running shell commands, scheduling workflows. All of that requires a host running 24/7. Your options run from a local Docker Compose setup to a VPS deployment to fully managed platforms that take infrastructure off your plate.

This guide covers each OpenClaw deployment path with real commands, configuration files, and security hardening steps, then gets into the total cost picture most hosting listicles skip.

Docker is the officially recommended production deployment method for self-hosted OpenClaw. The project publishes pre-built images at ghcr.io/openclaw/openclaw (primary) and openclaw/openclaw on Docker Hub.

Prerequisites

Quick Start with the Official Setup Script

Fastest way to get a running OpenClaw container:

git clone https://github.com/openclaw/openclaw.git
cd openclaw
export OPENCLAW_IMAGE='ghcr.io/openclaw/openclaw:latest'
./scripts/docker/setup.sh

The setup script prompts for your API keys, generates a gateway auth token into .env, creates the required directories, and starts the gateway. Once it's up, the Control UI lives at http://127.0.0.1:18789/.

Understanding the docker-compose.yml

The official docker-compose.yml defines two services (openclaw-gateway and openclaw-cli) with security hardening built in:

services:
  openclaw-gateway:
    image: ${OPENCLAW_IMAGE:-openclaw:local}
    build: .
    command: ["node", "dist/index.js", "gateway", "--bind", "${OPENCLAW_GATEWAY_BIND:-lan}", "--port", "18789"]
    ports:
      - "${OPENCLAW_GATEWAY_PORT:-18789}:18789"  # Gateway UI
      - "${OPENCLAW_BRIDGE_PORT:-18790}:18790"    # Bridge
      - "${OPENCLAW_MSTEAMS_PORT:-3978}:3978"     # MS Teams
    volumes:
      - "${OPENCLAW_CONFIG_DIR:-${HOME}/.openclaw}:/home/node/.openclaw"
      - "${OPENCLAW_WORKSPACE_DIR:-${HOME}/.openclaw/workspace}:/home/node/.openclaw/workspace"
    environment:
      - OPENCLAW_GATEWAY_TOKEN=${OPENCLAW_GATEWAY_TOKEN}
      - TZ=${TZ:-UTC}
    cap_drop:
      - NET_RAW
      - NET_ADMIN
    security_opt:
      - no-new-privileges:true
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "node", "dist/docker-healthcheck.js"]
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 20s

  openclaw-cli:
    image: ${OPENCLAW_IMAGE:-openclaw:local}
    build: .
    volumes:
      - "${OPENCLAW_CONFIG_DIR:-${HOME}/.openclaw}:/home/node/.openclaw"

A few things to know here. The default image is openclaw:local (built from source); set OPENCLAW_IMAGE to ghcr.io/openclaw/openclaw:latest (or a pinned tag) to pull the pre-built image instead. cap_drop removes unnecessary network capabilities, and no-new-privileges prevents privilege escalation inside the container. Ports aren't bound to 127.0.0.1 by default in the compose file, so if you're deploying on a public-facing VPS, bind them to loopback or put a reverse proxy in front. Pin your image tag to a specific version (e.g., 2026.7.2) rather than latest. OpenClaw ships updates multiple times per week, and some releases contain breaking changes.

OpenClaw VPS Deployment: Always-On Self-Hosting

For a persistent OpenClaw deployment that survives reboots and stays online while your laptop sleeps, a VPS on a cloud provider is the standard move. Minimum viable spec: 2 vCPUs, 4 GB RAM, Ubuntu 22.04+.

Step-by-Step: Hetzner / DigitalOcean VPS

SSH into your server and install Docker:

ssh root@YOUR_VPS_IP
apt-get update && apt-get install -y git curl ca-certificates
curl -fsSL https://get.docker.com | sh

Clone the repo and create persistent storage directories:

git clone https://github.com/openclaw/openclaw.git
cd openclaw
mkdir -p /root/.openclaw/workspace
chown -R 1000:1000 /root/.openclaw

The chown to UID 1000 matches the container's non-root user. Generate your gateway token and create your .env file:

OPENCLAW_GATEWAY_TOKEN=$(openssl rand -hex 32)
cat > .env << EOF
OPENCLAW_IMAGE=ghcr.io/openclaw/openclaw:2026.7.2
OPENCLAW_GATEWAY_TOKEN=${OPENCLAW_GATEWAY_TOKEN}
OPENCLAW_GATEWAY_BIND=lan
TZ=UTC
EOF

Start the gateway:

docker compose up -d

Securing Access with an Nginx Reverse Proxy

Don't expose OpenClaw directly on a public IP. Put it behind Nginx with SSL:

server {
    listen 443 ssl http2;
    server_name openclaw.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/openclaw.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/openclaw.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:18789;
        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;
    }
}

Those WebSocket upgrade headers are essential. OpenClaw's gateway relies on persistent WebSocket connections. Grab your SSL certificate with Certbot:

apt install -y certbot python3-certbot-nginx
certbot --nginx -d openclaw.yourdomain.com

Or skip Nginx entirely and access through an SSH tunnel for a simpler security model:

ssh -N -L 18789:127.0.0.1:18789 root@YOUR_VPS_IP

Then open http://127.0.0.1:18789/ locally.

VPS Cost Comparison

| Provider | Spec | Monthly Cost | |---|---|---| | Hetzner CX22 | 2 vCPU / 4 GB | ~$4.59 | | DigitalOcean Basic | 2 vCPU / 4 GB | ~$24 | | Contabo Cloud VPS S | 4 vCPU / 8 GB | ~$6.99 (from ~$4.50/mo on annual plans) | | Oracle Cloud Free | 4 ARM / 24 GB | $0 |

Oracle Cloud's Always Free tier gives you up to 4 ARM OCPUs, 24 GB RAM, and 200 GB block storage. That's enough to run OpenClaw plus a local 7B-parameter model via Ollama. Easily the most generous free option, though availability varies by region and there are reports that Oracle may be reducing the ARM allocation in some accounts to 2 OCPUs and 12 GB RAM.

OpenClaw Cloud Hosting: Managed Options

Several managed providers handle infrastructure so you can skip Docker and VPS config:

These services handle patching, uptime monitoring, and SSL renewal. The tradeoff: less control over configuration and, in some cases, limited plugin support.

Security Hardening: What the Listicles Skip

SecurityScorecard's STRIKE team found 135,000+ internet-exposed OpenClaw instances across 82 countries. An estimated 15,000 to 50,000 were vulnerable to remote code execution. Nine CVEs dropped in just four days in March 2026 (March 18-21), including CVE-2026-22172 scoring 9.9 CVSS. Not theoretical. CrowdStrike warned that a misconfigured instance "could be commandeered as a powerful AI backdoor agent capable of taking orders from adversaries."

Essential hardening steps for any self-hosted deployment:

  1. Bind to loopback only. Never expose the gateway on 0.0.0.0 without a reverse proxy and authentication.
  2. Enable sandbox mode. Set agents.defaults.sandbox.mode to "all" or "non-main" in ~/.openclaw/openclaw.json to isolate tool execution in separate containers.
  3. Set DM policy to "pairing." Unknown senders receive expiring pairing codes instead of open access.
  4. Run the security audit. Execute openclaw security audit --deep after every configuration change.
  5. Set LLM spending limits. Unmonitored agent loops have caused monthly bills exceeding $3,600, with individual overnight incidents costing $200-500. Configure budget caps with your API provider.
  6. Pin image versions. Use specific tags like 2026.7.2, not latest.
  7. Restrict file permissions. Set ~/.openclaw/ to 700 and openclaw.json to 600.

Verify your deployment health at any time:

curl http://127.0.0.1:18789/healthz   # liveness
curl http://127.0.0.1:18789/readyz    # readiness
openclaw security audit --deep        # full security probe

The Real Cost of OpenClaw Hosting

Most cost comparisons leave out two big line items: API runaway risk and maintenance labor.

OpenClaw itself is free (MIT license). A basic setup runs $5-24/month for the VPS plus $10-60/month in LLM API fees depending on usage. But total cost of ownership for self-hosted OpenClaw also includes 4-10 hours of initial setup, 1-3 hours per month of ongoing maintenance (updates, security patches, debugging), and the constant risk of an autonomous agent loop draining your API credits.

Managed providers at $3-20/month absorb patching and monitoring. Purpose-built agent platforms absorb everything, including the MCP integration layer that self-hosters have to configure by hand.

The Zero-Ops Alternative: Skip Hosting Entirely

If what you actually want is "always-on AI agents with tool integrations" and not "host this specific open-source project," the hosting question itself might be wrong.

Gamut is a managed always-on agent platform with 130+ MCP integrations pre-configured and a marketplace of 130+ agent templates across 21 categories. No Docker to configure. No VPS to patch. No gateway tokens to rotate. No risk of a 3 a.m. agent loop draining your API wallet. You get the persistent, multi-channel agent behavior that draws people to OpenClaw, without owning the infrastructure.

For teams evaluating the space more broadly, our OpenClaw alternatives comparison and best AI agents roundup cover the full landscape.

FAQ

How much does it cost to host OpenClaw?

OpenClaw is free software. Hosting costs range from $0 (Oracle Cloud Free Tier) to $5-24/month for a VPS, plus $10-60/month in LLM API fees. Managed hosting starts at $2.99/month. Factor in 1-3 hours/month of maintenance labor for self-hosted setups.

What are the minimum server requirements for OpenClaw?

Node.js 22.22.3+ (or 24.15+, 25.9+; Node 26 recommended), Docker Engine with Compose v2, 2 GB RAM minimum (4 GB+ recommended; 8 GB for browser automation), and WebSocket connectivity. An SSL certificate is required for production use.

Is OpenClaw safe to run on a public VPS?

Only with proper hardening. Bind the gateway to loopback (127.0.0.1), enable token authentication, use sandbox mode for tool execution, and place Nginx with SSL in front. Run openclaw security audit --deep after every config change. Never expose an unauthenticated gateway on a public IP.

Can I run OpenClaw without Docker?

Yes. Install directly via curl -fsSL https://openclaw.ai/install.sh | bash and run openclaw onboard --install-daemon to set up as a systemd service. Docker is recommended for production but not strictly required.

Should I self-host OpenClaw or use managed hosting?

Self-host if you need maximum data control and have DevOps capacity. Use managed hosting if you lack dedicated infrastructure staff or want automatic security patching. Consider a purpose-built agent platform if your goal is always-on agents with tool integrations rather than running OpenClaw specifically.

Skip the infrastructure. Ship the agent.

Gamut gives you always-on AI agents with 130+ MCP integrations and zero hosting overhead. No Docker, no VPS, no patching -- just agents that work.