Install OpenClaw on a VPS: Step-by-Step
Run the OpenClaw Gateway 24/7 on a Linux VPS: pick a provider, install with Node 26, run it as a service, and reach the dashboard safely over an SSH tunnel.
To run OpenClaw on a VPS, install Node 26 and OpenClaw on a Linux server, run openclaw onboard --install-daemon so the Gateway runs as a service, and open the dashboard from your laptop through an SSH tunnel. The Gateway stays on 127.0.0.1 the whole time, so nothing is exposed to the internet.
A VPS is worth it when you want the Gateway online 24/7, for example so your automations fire while your laptop is closed. The VPS becomes the source of truth: it owns OpenClaw's state and workspace, and you connect to it from your laptop or phone.
1. Pick a provider
Any Linux server works. The official VPS docs have setup guides for these:
| Provider | What the docs say it offers |
|---|---|
| DigitalOcean | Simple paid VPS |
| Hetzner | Docker on a Hetzner VPS |
| Hostinger | VPS with one-click setup |
| Oracle Cloud | Always Free ARM tier |
| Azure, GCP | Linux VM / Compute Engine |
| Fly.io, Railway, Render, Northflank | Managed or one-click browser setup |
AWS (EC2 or Lightsail) also works. For hardware sizing, see System Requirements: with a cloud AI provider, the server only runs the Gateway. If you plan to build the Docker image from source, that needs at least 6 GB of RAM (Docker install docs). A pre-built image skips the build, so it avoids that requirement.
For DigitalOcean and Hetzner list prices, with sources and a check date, see How much does OpenClaw cost to run?.
2. Lock down SSH first
Decide how you'll administer the server before you install anything:
- With Tailscale: install Tailscale, join the server to your tailnet, confirm a second SSH session works over the Tailscale address, then restrict public SSH.
- Without Tailscale: harden your SSH access the usual way (keys only, no password login) before you expose anything else.
This is separate from how you reach the OpenClaw dashboard, which stays private either way.
3. Install Node and OpenClaw
SSH into the server. Install Node 26 (recommended), or Node 24.22.1+ or 26.12.1+ for the latest security fixes. Then install OpenClaw:
# npm 12, or npm 11.16 and later
npm i -g openclaw@latest --allow-scripts=openclaw
# npm 11.15 and earlier: leave off --allow-scripts
npm i -g openclaw@latestCheck your npm version with npm --version. If openclaw isn't found afterwards, it's a PATH problem; see Troubleshooting.
You can also use the official installer, which sets up a supported Node for you:
curl -fsSL https://openclaw.ai/install.sh | bash4. Run onboarding and install the service
openclaw onboard --install-daemon
openclaw gateway statusOnboarding asks for your AI provider and key. --install-daemon installs the Gateway as a systemd user service, so it starts on its own and restarts if it crashes.
5. Open the dashboard from your laptop
Don't open port 18789 on the server's firewall. Open an SSH tunnel from your laptop instead:
ssh -N -L 18789:127.0.0.1:18789 <user>@<server-ip>Leave that running, open http://127.0.0.1:18789/ in your browser, and sign in with the Gateway's shared secret (a token by default). With the tunnel up, openclaw health and openclaw status --deep on your laptop also reach the remote Gateway.
Keep the Gateway on loopback
If you bind the Gateway to lan or tailnet instead, it requires gateway.auth.token or gateway.auth.password. Loopback plus an SSH tunnel or Tailscale Serve is the secure default.
6. Speed up a small server (optional)
On small VMs and ARM hosts, CLI commands can feel slow. Turn on Node's compile cache:
grep -q 'NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache' ~/.bashrc || cat >> ~/.bashrc <<'EOF'
export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
mkdir -p /var/tmp/openclaw-compile-cache
export OPENCLAW_NO_RESPAWN=1
EOF
source ~/.bashrcThe first run warms the cache. On slow hosts you can also give the service more time to start with systemctl --user edit openclaw-gateway.service:
[Service]
Environment=OPENCLAW_NO_RESPAWN=1
Environment=NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
TimeoutStartSec=907. Back it up
The VPS holds your agent's state and workspace, so back them up on a schedule. A snapshot feature from your provider works, or copy the OpenClaw directories off the server regularly.
Next steps
- Schedule your first job in Module 6: Autonomous Tasks.
- Connect a chat app from Channels.
- If something breaks, start with Troubleshooting.
FAQ
- How do I install OpenClaw on a VPS?
- SSH into a Linux server, install Node 26 (or Node 24.22.1+), run
npm i -g openclaw@latest --allow-scripts=openclaw, thenopenclaw onboard --install-daemonso the Gateway runs as a service. From your laptop, open the dashboard through an SSH tunnel:ssh -N -L 18789:127.0.0.1:18789 <user>@<host>. Source: OpenClaw Linux docs. - Which VPS providers work with OpenClaw?
- Any Linux server works. The official docs have guides for Azure, DigitalOcean, exe.dev, Fly.io, GCP, Hetzner, Hostinger, Oracle Cloud and others, and note that AWS also works well. Oracle Cloud's guide uses its Always Free ARM tier. Source: OpenClaw VPS docs.
- Should I open port 18789 on my VPS?
- No. The secure default is to keep the Gateway on loopback (127.0.0.1) and reach it through an SSH tunnel or Tailscale Serve. If you bind it to
lanortailnet, it requires a shared secret (gateway.auth.tokenorgateway.auth.password). Source: OpenClaw VPS docs. - Why is the OpenClaw CLI slow on a small VPS?
- On low-power VMs and ARM hosts, turn on Node's compile cache by setting
NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cacheandOPENCLAW_NO_RESPAWN=1in your shell profile. The first run warms the cache. Source: OpenClaw VPS docs. - Do I need a VPS to run OpenClaw?
- No. A VPS only matters if you want the Gateway, and your automations, running while your own computer is off. A Raspberry Pi or old laptop at home does the same job. See System Requirements.