Step-by-Step OpenClaw Setup on Ubuntu LTS
Step-by-Step OpenClaw Setup on Ubuntu LTS
Comprehensive guide to installing OpenClaw on Ubuntu LTS, including environment setup, build instructions, and tips for optimal performance. Please take note that all commands are bolded.
Table of Contents
- Introduction
- OpenClaw Installation Guide (Ubuntu 22.04 / 24.04)
- Overview
- Prerequisites
- System Requirements
- Recommended Packages
- Install Node.js 22 (Required)
- Install OpenClaw (Git Method)
- First-Time Setup (Onboarding)
- Understanding the Gateway & Dashboard
- Key facts
- Accessing the Dashboard on a VPS (Correct Method)
- Create an SSH tunnel from your local machine
- Open the dashboard in your browser
- Handling the “Unauthorized: Gateway Token Missing” Message
- Gateway Service Management
- Common Issues & Fixes (Based on Real Troubleshooting)
- Gateway crashes immediately
- The gateway service shows “active,” but the port is not open
- Cannot find module … entry.js
- GitHub clone asks for username
- The dashboard is not opening on server IP
- Full Installation Summary (Copy/Paste Ready)
- Final Notes & Reference Link
Introduction
If you are interested in playing the classic game Captain Claw on Linux with optimal performance and stability, the OpenClaw engine is currently the most suitable open-source solution. This tutorial will teach you how to install OpenClaw on Ubuntu 22.04 and Ubuntu 24.04 with a clean, complete, and production-ready installation process.
This tutorial is suitable for Linux newcomers, classic gamers, and developers who want to master the installation of all dependencies to run OpenClaw on Linux with optimal performance and stability. By following this tutorial, you will be able to properly set up your environment to enjoy a seamless classic gaming experience on Ubuntu.
1. OpenClaw Installation Guide (Ubuntu 22.04 / 24.04)
A complete, battle‑tested installation manual based on real‑world troubleshooting and verified working steps.
2. Overview:
OpenClaw is a local-first AI automation framework that provides:
- A command‑line interface (CLI)
- A secure local gateway
- A web dashboard (localhost-only)
- Plugin and agent support
This guide walks you through: - Prerequisites
- Node.js installation
- OpenClaw installation (Git method)
- Onboarding
- Gateway setup
- Dashboard access (via SSH tunnel)
- Common pitfalls and fixes
This document applies to: - Ubuntu 22.04 LTS
- Ubuntu 24.04 LTS
- Both server and desktop editions
3. Prerequisites
System Requirements
- Ubuntu 22.04 or 24.04
- Root or sudo access
- Internet connectivity
- Git installed with HTTPS support
- Ability to SSH into the server (for dashboard tunneling)
Recommended Packages
sudo apt update
sudo apt install -y git ca-certificates curl build-essential
4. Install Node.js 22 (Required)
OpenClaw requires a modern Node.js runtime. Install Node 22 using NodeSource:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash –
sudo apt install -y nodejs
Verify:
node -v
npm -v
Expected:
v22.x.x
10.x.x or higher
5. Install OpenClaw (Git Method)
The Git method ensures you get the full source tree, including all workspace packages.
Run:
curl -fsSL https://openclaw.ai/install.sh | bash -s — –install-method git –no-prompt –no-onboard
This will:
- Clone the OpenClaw repository
- Install dependencies
- Build the workspace
- Install the CLI wrapper
- Install and start the gateway
Verify installation:
openclaw –version
You should see something like:
OpenClaw 2026.x.x
6. First-Time Setup (Onboarding)
Onboarding is mandatory. It configures:
- Your AI provider
- API keys
- Gateway token
- Local configuration files
Run: - openclaw onboard
- Follow the prompts.
7. Understanding the Gateway & Dashboard
Key facts:
- The dashboard always runs on localhost
- Default port: 18789
- It is not exposed publicly
- It requires HTTPS or localhost for security
- On a VPS, you must use SSH tunneling
This is by design.
8. Accessing the Dashboard on a VPS (Correct Method)
Create an SSH tunnel from your local machine
ssh -N -L 18789:127.0.0.1:18789 root@YOUR_SERVER_IP
Keep this terminal open.
Open the dashboard in your browser
http://localhost:18789/
9. Handling the “Unauthorized: Gateway Token Missing” Message
This is normal. The dashboard requires a secure token.
Generate a tokenized URL:
openclaw dashboard –no-open
Copy the URL and open it in your browser (still via localhost).
10. Gateway Service Management
Start the gateway
openclaw gateway start
Install as a systemd user service
openclaw gateway install
Restart
systemctl –user restart openclaw-gateway.service
Check status
systemctl –user status openclaw-gateway.service
Check if the port is open
ss -tulpen | grep 18789
11. Common Issues & Fixes (Based on Real Troubleshooting)
Gateway crashes immediately
Cause: Missing or incomplete source checkout.
Fix: Reinstall using the Git method (already covered).
The gateway service shows “active,” but the port is not open
Cause: Systemd is using the wrong Node version.
Fix: Ensure
which node
node -v
Matches:
usr/bin/node
v22.x.x
Cannot find module … entry.js
Cause: Gateway package missing or build incomplete.
Fix: Reinstall OpenClaw using:
curl -fsSL https://openclaw.ai/install.sh | bash -s — –install-method git –no-prompt –no-onboard
GitHub clone asks for username
Cause: Wrong repository URL or GitHub rate limiting.
Correct repo:
https://github.com/OpenClaw-AI/OpenClaw
The dashboard is not opening on server IP
This is expected. The dashboard is localhost-only.
Use SSH tunneling
12. Full Installation Summary (Copy/Paste Ready)
Update system
sudo apt update
sudo apt install -y git ca-certificates curl build-essential
# Install Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash –
sudo apt install -y nodejs
# Verify
node -v
npm -v
# Install OpenClaw (Git method)
curl -fsSL https://openclaw.ai/install.sh | bash -s — –install-method git –no-prompt –no-onboard
# Verify CLI
openclaw –version
# Run onboarding
openclaw onboard
# Install and start gateway
openclaw gateway install
openclaw gateway start
# Access dashboard (from your local machine)
ssh -N -L 18789:127.0.0.1:18789 root@YOUR_SERVER_IP
# Then open:
# http://localhost:18789/
# If token required
openclaw dashboard –no-open
Final Notes:
- This guide is valid for Ubuntu 22.04 and 24.04, server or desktop.
- The Git installation method ensures a complete workspace, including the gateway.
- SSH tunneling is the only correct way to access the dashboard on a VPS.
- The gateway runs as a systemd user service, not a system service.
- Node.js 22 is mandatory.
Reference links:
- How GenAI Is Revolutionizing Software Engineering
- Introducing OpenClaw
- OpenClaw, OpenAI and the Future
Written By Junaid Farooqui