Skip to content

Last updated · 2026-01-30

OpenClaw VPS Setup (Docker or Native)

What you’ll achieve

  • Deploy OpenClaw on a VPS with either Docker or a native install
  • Keep configs and data persistent
  • Complete onboarding and verify the gateway
  • Avoid common pitfalls (permissions, networking, data loss)

VPS sizing recommendation

  • 2 vCPU / 2GB RAM / 20GB SSD
  • Ubuntu 22.04+

(Optional affiliate card)

md
<AffiliateBox title="2 vCPU / 2GB RAM (Recommended)" desc="Great for 24/7 OpenClaw uptime" href="YOUR_AFFILIATE_LINK" />

Step 1: Update server

bash
sudo apt update && sudo apt upgrade -ysudo apt install -y curl git ca-certificates

Step 2: Install Docker + Compose

bash
sudo apt install -y docker.io docker-composedocker --versiondocker-compose --version

Step 3: Fix Docker permissions

bash
sudo usermod -aG docker $USER

Log out and back in.

Step 4: Clone the repo

bash
git clone https://github.com/openclaw/openclaw.gitcd openclaw

Step 5: Run the official Docker setup

bash
chmod +x ./docker-setup.sh./docker-setup.sh

Optional: bake extra system packages into the image.

bash
export OPENCLAW_DOCKER_APT_PACKAGES="ffmpeg build-essential"./docker-setup.sh

Host persistence paths (per official docs):

  • ~/.openclaw/ (config/state)
  • ~/.openclaw/workspace/ (workdir)

Step 6: Onboard via the CLI container

bash
docker compose exec openclaw-cli openclaw onboard --flow quickstart

Step 7: Logs + validation

bash
docker compose logs -f openclaw-gateway

Option B: Native install (no Docker)

bash
curl -fsSL https://openclaw.bot/install.sh | bash

Step 2: Install the CLI

bash
npm i -g openclaw@latestopenclaw --version

Step 3: Run onboarding + install daemon

bash
openclaw onboard --install-daemon

Step 4: Verify

bash
openclaw healthopenclaw status --all

Step 10: Minimal hardening

bash
sudo ufw allow OpenSSHsudo ufw enablesudo ufw status

Step 11: Backups

bash
cd ~/openclawtar -czf openclaw-data-backup.tar.gz openclaw-data

Secure Control UI access (SSH tunnel)

If you need Control UI access, use SSH tunneling instead of exposing ports:

bash
ssh -N -L 18789:127.0.0.1:18789 user@your-vps-ip

TweetEmbed examples:

Next steps

  • Channel setup: /docs/channel-telegram / /docs/channel-whatsapp / /docs/channel-feishu
  • Troubleshooting: /docs/troubleshooting
  • VPS plan guide: /vps