Independent Field Manual — Not affiliated with, endorsed by, or operated by OpenClaw
Navigation

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 Hinglish
Difficulty
intermediate
Duration
25 minutes
Tested On
Ubuntu 24.04 LTS
Access Mode
SSH Tunnel / Tailscale
Pre-flight status
Pre-Flight Approved
Risk medium
Gateway Private
On this page
Proceed with caution Safe if you follow the prerequisites. Do not install as root. Ensure you have a non-root user before beginning.
Recommended access: SSH Tunnel or Tailscale

Short answer

Installing OpenClaw on an Ubuntu VPS requires three main phases:

  1. Installing Node.js (via nvm)
  2. Initializing an OpenClaw workspace directory
  3. 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 sudo privileges (e.g., clawuser)

If you have not done this yet, stop and complete the Fresh Ubuntu VPS Setup guide first.

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:

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

To make nvm available immediately, reload your shell configuration:

bash
source ~/.bashrc

Now, install the latest LTS (Long Term Support) version of Node.js:

bash
nvm install --lts

Verify the installation:

bash
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:

bash
mkdir -p ~/openclaw-workspace && cd ~/openclaw-workspace

Initialize a new project:

bash
npm init -y

Step 3: Install the OpenClaw package

Install the OpenClaw core package locally in your workspace:

bash
npm install @openclaw/core

Verify that the CLI is available:

bash
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.

bash
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

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:

bash
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 sudo with npm. Change ownership of the folder back to your user (sudo chown -R $USER:$USER ~/openclaw-workspace) and run npm install without sudo.

Error: Node version too old

  • Cause: You installed Node.js via Ubuntu’s default apt repository, which often provides outdated versions.
  • Fix: Remove the apt version (sudo apt remove nodejs) and follow Step 1 to install via nvm.

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 .env file. 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:

bash
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.