1. A Server of Its Own
OpenClaw's README is direct about the trust model: messages that reach the assistant are untrusted input, and unless you configure a sandbox, its tools run on the host. Its security documentation treats one gateway as one trust boundary, not a wall between strangers. So give it a VPS that does nothing else, and do not put your other projects' keys or data on it.
On a fresh Ubuntu 24.04 server, secure it first, then create the user OpenClaw will run as. The docs say never to run the gateway as root:
sudo adduser claw sudo loginctl enable-linger claw # keep its services running after logout sudo -iu claw
2. Install and Onboard
As claw:
curl -fsSL https://openclaw.ai/install.sh | bash
The installer adds Node.js 24 if it is missing (OpenClaw needs Node 24.16 or 26.1 and newer) and starts the onboarding wizard, which asks for a model provider and its API key and which chat apps to connect. If you install with npm instead, start the wizard yourself:
npm install -g openclaw@latest --allow-scripts=openclaw openclaw onboard --install-daemon
Then check the install:
openclaw --version openclaw doctor
3. Run the Gateway as a Service
openclaw gateway install systemctl --user enable --now openclaw-gateway.service openclaw gateway status openclaw logs --follow
If systemctl --user says it cannot connect to the bus, set export XDG_RUNTIME_DIR=/run/user/$(id -u) in that shell first; that happens when you switch user with sudo on a headless server. The service restarts by itself if it stops, and survives reboots because of the lingering you turned on in step 1.
4. Open the Dashboard Over SSH
On a normal install the gateway binds to the server's loopback address, port 18789, and requires a token or password. That one port serves the dashboard and its API. From your own computer:
ssh -N -L 18789:127.0.0.1:18789 [email protected] # then open http://127.0.0.1:18789 in your browser
The tunnel does not skip the gateway's own sign-in: you still need its token. OpenClaw's docs prefer Tailscale or a VPN for regular access; on our servers, WireGuard does the same. Do not open 18789 in the firewall, and if you run OpenClaw in a container, note that container installs bind to every address by default.
5. Decide Who Can Talk to It
- Pairing: by default, someone new who messages the assistant gets a pairing code instead of an answer. Approve only people you know, with
openclaw pairing approve <channel> <code>. - Groups: group chats are allowlisted and usually need a mention; keep it that way.
- Audit: run
openclaw security auditafter any change to channels or tools, andopenclaw doctor --fixwhen something looks wrong. - Separate people, separate gateways: for users who should not see each other's data, run a gateway per person, ideally on separate servers.
Updates and Backups
Update with the method you installed with (for npm, the same npm install -g openclaw@latest command), then openclaw gateway restart. Its state, memory and credentials live in the claw user's home directory; back it up as carefully as a password manager, with Borg to a storage box.
Weighing up other agents? Hermes Agent runs the same way and can import an OpenClaw setup.