Table of contents
- What you'll achieve
- VPS sizing recommendation
- Option A: Docker (recommended)
- Step 1: Update the server
- Step 2: Install Docker and Compose
- Step 3: Fix Docker permissions
- Step 4: Clone the repository
- Step 5: Run the official Docker setup
- Step 6: Run onboarding from the CLI container
- Step 7: Validate logs
- Option B: Native install
- Step 1: Install OpenClaw
- Step 2: Run onboarding and install the daemon
- Step 3: Verify runtime
- Restart and stop OpenClaw safely
- Docker restart
- Docker stop
- Native restart
- Native stop
- Persistent data and backups
- Minimal hardening
- Secure Control UI access
- Common Docker / VPS questions
- When should I use Docker?
- When should I use native install?
- Where should I go for gateway tokens, browser relay, or skills?
- Related OpenClaw guides
Intermediate
OpenClaw Docker / VPS Deployment (Recommended)
Deploy OpenClaw on Ubuntu with Docker or a native setup, keep data persistent, and manage restarts safely.
- VPS
- Docker
- Ubuntu
- Deployment
OpenClaw VPS Setup (Docker or Native)
What you'll achieve
- Deploy OpenClaw on a VPS with Docker or a native setup
- Keep configs and state persistent
- Learn how to restart, stop, and verify the gateway
- Avoid common Docker, networking, permission, and data-loss pitfalls
VPS sizing recommendation
- 2 vCPU / 2 GB RAM / 20 GB SSD minimum
- Ubuntu 22.04 or later
Option A: Docker (recommended)
Step 1: Update the server
sudo apt update && sudo apt upgrade -ysudo apt install -y curl git ca-certificatesStep 2: Install Docker and Compose
sudo apt install -y docker.io docker-composedocker --versiondocker-compose --versionStep 3: Fix Docker permissions
sudo usermod -aG docker $USERLog out and back in before you continue.
Step 4: Clone the repository
git clone https://github.com/openclaw/openclaw.gitcd openclawStep 5: Run the official Docker setup
chmod +x ./docker-setup.sh./docker-setup.shStep 6: Run onboarding from the CLI container
docker compose exec openclaw-cli openclaw onboard --flow quickstartStep 7: Validate logs
docker compose logs -f openclaw-gatewayOption B: Native install
Step 1: Install OpenClaw
curl -fsSL https://openclaw.bot/install.sh | bashnpm i -g openclaw@latestStep 2: Run onboarding and install the daemon
openclaw onboard --install-daemonStep 3: Verify runtime
openclaw healthopenclaw status --allRestart and stop OpenClaw safely
Docker restart
docker compose restart openclaw-gateway openclaw-cliDocker stop
docker compose stopNative restart
openclaw gateway restart || openclaw restartNative stop
openclaw stop || pkill -f openclawPersistent data and backups
The important host paths are usually:
~/.openclaw/~/.openclaw/workspace/
Create a quick backup:
tar -czf openclaw-backup.tar.gz ~/.openclawMinimal hardening
sudo ufw allow OpenSSHsudo ufw enablesudo ufw statusDo not expose the gateway to the public internet unless you fully understand the risk. Keep it on localhost or protect it with tokens and reverse proxy auth.
Secure Control UI access
Use SSH tunneling instead of exposing ports:
ssh -N -L 18789:127.0.0.1:18789 user@your-vps-ipCommon Docker / VPS questions
When should I use Docker?
Use Docker if you want the cleanest repeatable setup and easier persistence management.
When should I use native install?
Use native install only if you know why you need it or your environment does not support Docker cleanly.
Where should I go for gateway tokens, browser relay, or skills?
Continue with advanced configuration for gateway token, browser relay, and skill-related settings.
Related OpenClaw guides
Frequently asked questions
Quick clarifications for common blockers while following this tutorial.
What is OpenClaw?Getting Started
How does OpenClaw work?Getting Started
How do I use OpenClaw for the first time?Getting Started
Related tutorials
OpenClaw Telegram Setup Guide
- Telegram
- Channel
OpenClaw Feishu / Lark Setup Guide
- Feishu
- Lark
- Channel
OpenClaw Local Install (Mac / Linux)
- Install
- Onboarding
- Mac
- Linux
Was this helpful?