OpenClaw on a VPS: A Beginner-Friendly Deployment Guide (with Brainhost)
OpenClaw (formerly Clawdbot / Moltbot) is a self-hosted agent framework you can run on your own infrastructure. The fastest way to make it reliable and always-on is to deploy it to a VPS. OpenClaw’s official “Getting Started” flow includes installing the CLI, running onboarding with --install-daemon, checking gateway status, and opening the Control UI.
This blog focuses on a clean VPS-first setup and uses Brainhost as the recommended VPS provider (Ubuntu 22.04 + quick provisioning).
Why a VPS (and why Brainhost)
Running OpenClaw locally is great for experimentation. Running it on a VPS is better when you want:
- 24/7 uptime (no laptop sleep, no home network hiccups)
- Predictable resources (CPU/RAM/disk)
- Easier scaling as you add channels/skills/tools
Brainhost provides a straightforward VPS workflow for this kind of always-on deployment, and even has a dedicated guide for installing Moltbot/Clawdbot on a Brainhost VPS (the lineage of today’s OpenClaw).
Brainhost VPS: https://brainhost.ai/
What you’ll build
- An Ubuntu VPS running OpenClaw
- OpenClaw installed + onboarded as a daemon (
openclaw onboard --install-daemon)oaicite:4 - A private Control UI access method via SSH tunnel to
127.0.0.1:18789(no public dashboard exposure)oaicite:5
Prerequisites
- A VPS (Ubuntu 22.04 recommended)
- SSH access (IP + key/password)
- Node.js ≥ 22 (OpenClaw runtime requirement)
oaicite:6 - A local terminal on your computer (macOS/Linux/Windows PowerShell)
Recommended starter spec
- 2 vCPU
- 2–4 GB RAM
- 30+ GB disk
If your VPS has low RAM, consider adding swap before heavy installs; some community guides specifically recommend swap to avoid OOM during npm install/build steps.
oaicite:7
Step 1 — Create a VPS on Brainhost (Ubuntu 22.04)
- Go to Brainhost: https://brainhost.ai/
oaicite:8 - Create an Ubuntu VPS instance
- Select Ubuntu 22.04 LTS
- Deploy and note:
- Public IP
- SSH username (often
rootorubuntu) - SSH password or SSH key
oaicite:9
Step 2 — SSH in and prepare the server
SSH into your VPS:
ssh root@YOUR_VPS_IP
Update system packages:
apt update && apt -y upgrade
Install basic utilities (recommended):
adduser openclaw
usermod -aG sudo openclaw
su - openclaw
This aligns with common VPS best practices (don’t run everything as root), and matches patterns used across multiple VPS deployment guides.
Step 3 — Install Node.js 22+
OpenClaw requires Node.js 22 or higher. A simple, reliable way on Ubuntu is nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
nvm install 22
nvm use 22
nvm alias default 22
node -v
npm -v
You should see v22.x.x (or higher).
Step 4 — Install OpenClaw (recommended installer)
OpenClaw’s official docs include a quick install script for macOS/Linux. On the VPS, run:
curl -fsSL https://openclaw.ai/install.sh | bash
Then reload your shell (or open a new SSH session) and confirm:
openclaw --version
Alternate install methods exist, but the official docs position this as the recommended fast path for beginners.
Step 5 — Run onboarding and install as a daemon (VPS best practice)
On a VPS, you want OpenClaw to keep running after you log out and after reboots. The official onboarding flow is:
openclaw onboard --install-daemon
This is explicitly documented in OpenClaw’s Getting Started guide.
During onboarding, you’ll configure:
Auth/provider/model settings
Gateway settings / workspace directory
Optional channels (you can start minimal and add later)
Step 6 — Check Gateway status
After onboarding, check that the gateway is healthy:
openclaw gateway status
This status check is part of the official Getting Started flow.
Step 7 — Open the Control UI privately (SSH tunnel)
OpenClaw’s Control UI is typically accessed via localhost on port 18789 (for example http://127.0.0.1:18789/).
Do not expose this dashboard to the public internet by default. Instead, tunnel it from your laptop:
ssh -N -L 18789:127.0.0.1:18789 openclaw@YOUR_VPS_IP
Now open this locally in your browser:
This “keep the dashboard private with an SSH tunnel” pattern is also highlighted in Brainhost’s VPS guide.
Day-2 ops: updates, logs, monitoring
Update OpenClaw
If you used the official install script, follow the project’s recommended update approach for your install method. If OpenClaw is installed via package manager/CLI distribution, confirm version after update:
openclaw --version
Basic monitoring
Quick checks:
htop
df -h
free -m
Quick restart strategy
Because you installed a daemon via onboarding, OpenClaw should survive logouts and reboots. Still, after reboot:
openclaw gateway status
(If you ever need deeper service-level inspection, we can tailor commands to your exact daemon method on your VPS.)
Minimal security checklist (recommended)
Keep Control UI private via SSH tunnel (no public port 18789).
Enable firewall and allow SSH:
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status
Use a non-root user for daily operations (Step 2).
Scaling notes
As you add more skills/channels or increase concurrency, you’ll likely need:
More RAM (stability)
More CPU (parallel work)
More disk (logs/data)
A VPS makes this easy: upgrade resources without redesigning your deployment. Brainhost positions their VPS workflow for this kind of scale-up path.
Conclusion
You now have a clean beginner deployment:
Brainhost Ubuntu VPS provisioned
Node.js 22+ installed
OpenClaw installed + onboarded as a daemon
Gateway verified via openclaw gateway status
Control UI accessed privately via SSH tunnel to 127.0.0.1:18789