Guide Menu expand_more
install vps
How to Install OpenClaw on an Ubuntu VPS Safely
Install OpenClaw on an Ubuntu VPS with safer defaults, Node setup notes, Gateway checks, firewall notes, and beginner-friendly explanations.
Who this is for
This guide is for anyone setting up OpenClaw on a fresh Ubuntu VPS (like DigitalOcean, Hostinger, or Hetzner). It is specifically designed to get you running safely without exposing your server to the public internet right away.
Prerequisites
- A fresh Ubuntu VPS (22.04 or 24.04).
- A non-root user with
sudoprivileges. If you haven’t done this, complete the Fresh Ubuntu VPS Setup guide first. - Node.js v24 or later installed.
- SSH access to your server.
Installation Steps
Update your system packages
Always start by making sure your VPS has the latest security updates.
bash sudo apt update && sudo apt upgrade -yVerify Node.js installation
OpenClaw requires a recent version of Node.js.
bash node -vv24.x.xInstall OpenClaw globally
Now, install the OpenClaw CLI using
npm. The-gflag installs it globally so you can run it from anywhere.bash npm install -g openclaw-cliInitialize your workspace
Create a dedicated folder for your OpenClaw config. Keeping things organized helps with troubleshooting later.
bash mkdir ~/openclaw-workspace && cd ~/openclaw-workspace\nopenclaw initWorkspace initialized successfully in /home/user/openclaw-workspaceStart the Gateway safely
Start the OpenClaw Gateway. By default, it will listen on
localhost:18789. Do not change this to0.0.0.0unless you know exactly what you are doing.bash openclaw start[OK] OpenClaw Gateway running on http://127.0.0.1:18789
Bad Output / Common Mistakes
- EACCES error during install: This happens if you try to
npm install -gwithout the right permissions. Never usesudo npm install -g. Instead, usenvmor configure your npm prefix. - Gateway crashing on startup: Usually means port 18789 is already in use, or your Node version is too old. Run
openclaw doctorto diagnose.
Rollback / Undo
If you need to uninstall OpenClaw completely, you can do so by removing the global npm package and deleting the workspace directory:
npm uninstall -g openclaw-cli\nrm -rf ~/openclaw-workspace Next steps and when to ask for help
Once OpenClaw is running on localhost, you can safely access the dashboard using an SSH tunnel or a private network like Tailscale. Do not modify UFW to open port 18789 directly.
If you are stuck on permission errors, Node.js issues, or the Gateway keeps crashing, use the Setup Help service. We can help you audit your setup without asking for any raw secrets or root passwords.
Sources
- OpenClaw Docs - Getting Started: https://docs.openclaw.ai/start/getting-started (Checked on 2026-06-03)
- OpenClaw Docs - Security: https://docs.openclaw.ai/gateway/security (Checked on 2026-06-03)
ClawReady.in is an independent educational resource and setup service. It is not affiliated with, endorsed by, or operated by OpenClaw.