install vps
Install OpenClaw on Ubuntu VPS
The complete, step-by-step field manual for installing OpenClaw Gateway on an Ubuntu VPS. Covers Node.js setup, workspace creation, and verifying your installation safely.
Read in HinglishOn this page
Short answer
Installing OpenClaw on an Ubuntu VPS requires three main phases:
- Installing Node.js (via
nvm) - Initializing an OpenClaw workspace directory
- Starting the Gateway process and accessing it safely via an SSH tunnel
This guide walks you through the entire process, assuming you are starting with a fresh Ubuntu server.
Who this is for
This guide is for Indian builders, freelancers, and small businesses who want to run OpenClaw 24/7 on a remote server (a VPS). You should use this guide if you are deploying to providers like DigitalOcean, Hetzner, AWS Lightsail, or Hostinger.
Prerequisites
Before running any commands in this guide, you must have:
- An Ubuntu VPS (22.04 or 24.04 LTS recommended)
- SSH access configured
- A non-root user with
sudoprivileges (e.g.,clawuser)
If you have not done this yet, stop and complete the Fresh Ubuntu VPS Setup guide first.
Never install or run OpenClaw using the root user. Doing so gives the application (and any tools you enable) complete control over your server. Always log in as your non-root user (e.g., clawuser).
Step 1: Install Node.js using nvm
OpenClaw is a Node.js application. We recommend installing Node.js using nvm (Node Version Manager) rather than apt, because it avoids permission issues and lets you easily switch versions.
First, install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash To make nvm available immediately, reload your shell configuration:
source ~/.bashrc Now, install the latest LTS (Long Term Support) version of Node.js:
nvm install --lts Verify the installation:
node -v && npm -v v20.x.x\n10.x.x Step 2: Create a workspace
OpenClaw requires a dedicated folder for its configuration, logs, and local SQLite database.
Create a folder and move into it:
mkdir -p ~/openclaw-workspace && cd ~/openclaw-workspace Initialize a new project:
npm init -y Step 3: Install the OpenClaw package
Install the OpenClaw core package locally in your workspace:
npm install @openclaw/core Verify that the CLI is available:
npx openclaw --version Step 4: Start the Gateway
It is time to start the Gateway for the first time. The Gateway will automatically generate a default configuration file (.env) if one does not exist.
npx openclaw start Keep this terminal window open. We will access the dashboard, then stop the Gateway later.
You should see logs indicating the Gateway has started:
[INFO] Gateway initialized\n[INFO] Listening on 127.0.0.1:18789 By default, the Gateway binds to 127.0.0.1 (localhost). This means it is invisible to the internet. Do not change this to 0.0.0.0 or run sudo ufw allow 18789 unless you are configuring a secure reverse proxy. Public exposure without authentication is highly dangerous.
Step 5: Access the Dashboard safely
Because the Gateway is running on 127.0.0.1 on your VPS, you cannot just type the VPS IP address into your browser. You must create an SSH Tunnel.
Open a new terminal window on your local laptop (do not close the terminal running OpenClaw) and run:
ssh -L 18789:localhost:18789 clawuser@your_server_ip Replace clawuser and your_server_ip with your actual details.
Now, open your web browser and go to:
http://localhost:18789
You should see the OpenClaw dashboard!
Step 6: Stop the Gateway
Go back to the terminal where npx openclaw start is running and press Ctrl+C to stop the Gateway.
Why stop it? Because running a server attached to your SSH session means it will die the moment you close your laptop. In a later guide, we will use a process manager (pm2) to keep it running 24/7.
Common install failures
Error: EACCES: permission denied, mkdir
- Cause: You probably used
sudo npm install. - Fix: Never use
sudowithnpm. Change ownership of the folder back to your user (sudo chown -R $USER:$USER ~/openclaw-workspace) and runnpm installwithout sudo.
Error: Node version too old
- Cause: You installed Node.js via Ubuntu’s default
aptrepository, which often provides outdated versions. - Fix: Remove the apt version (
sudo apt remove nodejs) and follow Step 1 to install vianvm.
Gateway starts, but dashboard won’t load
- Cause: The SSH tunnel is not running, or you bound the Gateway to an IP other than localhost.
- Fix: Verify the tunnel command in Step 5. See Dashboard Not Opening for detailed troubleshooting.
What not to do
- Do not share your
.envfile. It contains secret keys. - Do not run
ufw allow 18789. It exposes your Gateway to the internet. - Do not use
npm install -g. Install OpenClaw locally in a workspace folder so you have a self-contained environment.
Uninstall / Rollback
If you need to start completely fresh, simply delete the workspace folder and its contents:
cd ~ && rm -rf ~/openclaw-workspace Next steps
Now that OpenClaw is installed and you know how to access the dashboard safely, you need to secure your VPS before connecting channels or AI models.
Go to: OpenClaw VPS Security Checklist
When to ask for setup help
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.
Remember: Before sharing any logs with the community or support, redact your API keys, tokens, and IP addresses.
ClawReady.in is an independent educational resource and setup service. It is not affiliated with, endorsed by, or operated by OpenClaw.