OpenClaw is an open source personal AI agent that runs around the clock. It connects to the messaging apps you already use (WhatsApp, Telegram, Discord and others), keeps its own memory and workspace, and executes real tasks on the machine it lives on. You talk to it from your phone; it works from its server.
That last part is the point of this guide. An agent that only runs while your laptop is open is a demo. On a VPS it becomes a service: always reachable, on a stable IP, with a fixed monthly bill. Here is a clean production install on Ubuntu 24.04 LTS, from empty server to a daemon that survives reboots.
1. Size the server honestly
OpenClaw itself is a Node.js application. The official minimum is 2 GB of RAM, but real installs on 1 GB machines fail and 2 GB leaves no headroom once a browser tool or a second channel joins the party. Our recommendation:
- Minimum: 2 vCPU, 4 GB RAM, 25 GB NVMe.
- Comfortable: 2 to 4 vCPU, 8 GB RAM, 40 GB NVMe. Room for browser automation and several channels.
- OS: Ubuntu 24.04 LTS. It is what the upstream docs test against.
The model itself does not run on the VPS: OpenClaw calls a hosted model through your API key. The server carries the agent loop, the channels and the tools, which is exactly the kind of steady light load a small VPS is made for.
2. Install Node.js 26
OpenClaw tracks current Node releases. Grab Node 26 from NodeSource rather than the Ubuntu archive, which lags several major versions behind:
apt update && apt upgrade -y
curl -fsSL https://deb.nodesource.com/setup_26.x | bash -
apt install -y nodejs
node --version # v26.x
3. Install OpenClaw, then step out of root
The installer script does the fetching. Pass --no-onboard so it does
not start the interactive wizard as root:
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
Then create the account the agent will actually live under. Running a tool
executor as root on an internet-facing machine is asking for trouble, and the
upstream docs are explicit: root is for bootstrap only. The
enable-linger line matters, it lets systemd keep this user's
services running with nobody logged in:
adduser openclaw
usermod -aG sudo openclaw
loginctl enable-linger openclaw
su - openclaw
4. Run the onboarding wizard
Everything interactive happens once, inside the openclaw session:
openclaw onboard --install-daemon
The wizard walks through model authentication (your Anthropic or other provider
key), the first channel, gateway token generation and daemon installation. With
--install-daemon it registers a systemd user service named
openclaw-gateway.service, which is why the linger step above was not
optional. State lands in ~/.openclaw/: configuration, credentials
and session data, with the agent's files and memory under
~/.openclaw/workspace/. That one directory is your whole backup
surface.
5. Reach the dashboard without exposing it
The gateway listens on port 18789, bound to loopback. Leave it
there. Do not put it behind a public reverse proxy and do not bind it to the
public interface: this process holds your API keys and can run commands. From
your workstation, an SSH tunnel gives you the dashboard on demand:
ssh -L 18789:localhost:18789 openclaw@your-vps
# then open http://localhost:18789 locally
If you must bind wider: on a private network (a VPN or an
overlay like WireGuard), OpenClaw refuses to serve without authentication.
Set gateway.auth.token or a password first, and keep the public
interface out of it entirely.
6. Keep it stable on a small box
Two environment variables cut startup cost and stop respawn storms on modest
hardware. Add them to the service override
(systemctl --user edit openclaw-gateway.service):
[Service]
Environment=OPENCLAW_NO_RESPAWN=1
Environment=NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
Restart=always
RestartSec=2
TimeoutStartSec=90
On a 4 GB server, add a swap file as well. It is not for regular use; it absorbs the occasional npm update or model burst instead of letting the OOM killer take the gateway down:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
7. Verify it holds
openclaw doctor
openclaw status
openclaw gateway status
systemctl --user status openclaw-gateway.service
doctor checks the install end to end. The service status is the
health signal to keep an eye on afterwards: a rising restart count means
something fails silently and systemd keeps patching over it. Reboot the VPS once
on purpose and confirm the gateway comes back on its own before you trust it
with anything.
Checklist
- Ubuntu 24.04 LTS, 4 GB RAM or more, Node.js 26 from NodeSource.
- Installer with
--no-onboard; wizard run as the dedicatedopenclawuser. loginctl enable-linger openclawso the daemon outlives logouts.- Gateway on loopback port 18789, reached through an SSH tunnel only.
- Auth token set before any non-loopback bind.
- Compile cache and no-respawn set in the systemd override; swap on 4 GB.
~/.openclaw/in your backups.- One deliberate reboot to prove the daemon returns.
Skip the setup: our VPS range offers OpenClaw as a preinstalled image. The server boots with Node 26, the dedicated user and the daemon already in place; you connect over SSH, run the onboarding wizard with your own keys, and your agent is live in minutes.