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.

Difficulty
beginner
Duration
30-45 minutes
Tested On
Ubuntu 24.04 VPS
Access Mode
SSH tunnel or private network
verified
Status readiness check
Pre-Flight Approved
Risk rating medium
Gateway status Private
Proceed with caution Standard installation procedure using local bindings. Requires SSH access and a non-root user.

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 sudo privileges. 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

  1. Update your system packages

    Always start by making sure your VPS has the latest security updates.

    bash
    sudo apt update && sudo apt upgrade -y
  2. Verify Node.js installation

    OpenClaw requires a recent version of Node.js.

    bash
    node -v
    v24.x.x
  3. Install OpenClaw globally

    Now, install the OpenClaw CLI using npm. The -g flag installs it globally so you can run it from anywhere.

    bash
    npm install -g openclaw-cli
  4. Initialize 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 init
    Workspace initialized successfully in /home/user/openclaw-workspace
  5. Start the Gateway safely

    Start the OpenClaw Gateway. By default, it will listen on localhost:18789. Do not change this to 0.0.0.0 unless 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 -g without the right permissions. Never use sudo npm install -g. Instead, use nvm or 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 doctor to 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:

bash
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

ClawReady.in is an independent educational resource and setup service. It is not affiliated with, endorsed by, or operated by OpenClaw.