How to Install OpenClaw

This guide explains the best OpenClaw installation methods so you can choose the right setup, avoid common mistakes, and start running real AI agent workflows faster.

What Is OpenClaw?

OpenClaw helps you create AI agents that can handle tasks, tools, chat channels, and automation workflows. It can help with reminders, research, file organization, meeting notes, calendar tasks, and messaging automation.

It is not just a chatbot that only replies to prompts. It connects with your setup and helps you get work done.

Before You Install OpenClaw

Decide where you want to run OpenClaw: local machine, VPS, source setup, or managed hosting.

  • Use local setup if you only want to test OpenClaw before using it seriously.
  • Use a VPS if you want more control and a 24/7 self-hosted setup.
  • Use managed hosting if you want the easiest way to keep OpenClaw online without server work.
  • Make sure you have a stable internet connection before starting the setup.
  • Keep your model provider or API key ready, because OpenClaw needs a model to power the agent.
  • Prepare secure access details like gateway token, login credentials, or environment variables.
  • Plan where OpenClaw will store state, workspace files, and connected tool data.
  • Start with one simple workflow first, then add more tools and channels after the setup works.

Best Methods to Install OpenClaw

MethodBest ForDifficulty24/7 ReadyMain Value
CLI installBeginners testing OpenClawEasyNoFast local setup
npm/pnpm installNode users and developersMediumNoMore control over packages
Docker installSafer isolated setupMediumYes, if hostedCleaner environment
VPS/cloud installProduction and always-on useHardYesFull server control
Managed hostingFastest production setupEasyYesNo server maintenance

Method 1: Install OpenClaw With Managed Hosting

Managed hosting is the easiest way to run OpenClaw if you want to avoid server setup, Docker configuration, ports, SSL, logs, updates, and uptime monitoring.


1
Create Your Account

Create your account on Ampere.sh.

2
Deploy OpenClaw

Deploy your OpenClaw environment from the Ampere.sh dashboard.

3
Open the Control UI

Open the OpenClaw Control UI after deployment.

4
Complete Onboarding

Complete the onboarding setup.

5
Connect Your Model Provider

Connect your model provider or API key.

6
Create Your First Agent

Create your first OpenClaw agent.

7
Connect a Message Channel

Connect one message channel, such as Telegram, WhatsApp, Slack, or Discord.

8
Add a Simple Workflow

Add one simple workflow, such as reminders, task follow-ups, or meeting notes.

9
Test the Workflow

Test the workflow with a small task before adding more tools.

10
Keep OpenClaw Online

Keep your setup always online so OpenClaw can handle chats, tasks, and automations without running on your laptop.


Best For
  • Beginners
  • Founders
  • Marketers
  • Teams
  • Non-technical users
  • Anyone who wants OpenClaw running faster

Method 2: Install OpenClaw With the Official Installer Script

The official installer script is the recommended way to install OpenClaw on macOS, Linux, WSL2, or Windows PowerShell. It detects your system, installs Node if needed, installs OpenClaw, and can launch onboarding.


1
Install OpenClaw on macOS, Linux, or WSL2

Run the official installer command:

curl -fsSL https://openclaw.ai/install.sh | bash

This is the recommended command for most macOS, Linux, and WSL2 installs.

2
Install OpenClaw on Windows PowerShell

For native Windows PowerShell, run:

iwr -useb https://openclaw.ai/install.ps1 | iex

Windows is supported, but WSL2 is still recommended for the full OpenClaw experience.

3
Run Onboarding

After installation, run onboarding:

openclaw onboard --install-daemon

The onboarding wizard helps you choose a model provider, add your API key, and configure the OpenClaw Gateway.

4
Check Gateway Status

Verify that the OpenClaw Gateway is running:

openclaw gateway status

You should see the Gateway listening on port 18789.

5
Open the Dashboard

Open the OpenClaw Control UI:

openclaw dashboard

You can also open it manually in your browser:

http://127.0.0.1:18789
Best For
  • Local OpenClaw setup
  • Beginners who want the official install path
  • Testing OpenClaw before hosting it
  • Users who want the fastest local setup
  • macOS, Linux, WSL2, and Windows PowerShell users
Important Note

Local install is good for testing, but it is not ideal for 24/7 automation. If your laptop sleeps, shuts down, or loses internet, OpenClaw stops running. Computers remain deeply committed to betraying automation at the worst possible time.

Method 3: Install OpenClaw With npm, pnpm, or bun

This method is useful if you already manage JavaScript tools manually. OpenClaw’s install docs mention npm, pnpm, and bun as package-manager install options.


1
Check Node Version

OpenClaw documentation currently recommends Node 24 or Node 22.19+ for package-based installs.

node -v

If Node is missing or outdated, install Node first.

2
Install With npm
npm install -g openclaw@latest

Then run onboarding:

openclaw onboard

Start the gateway:

openclaw gateway
3
Install With pnpm
pnpm add -g openclaw@latest

If pnpm asks for build approval, approve required packages:

pnpm approve-builds -g

Then run:

openclaw onboard
openclaw gateway
4
Install With bun
bun install -g openclaw@latest

Then run:

openclaw onboard
openclaw gateway
5
If openclaw Command Is Not Found

Check your global npm path:

npm prefix -g

Add the global bin path to your shell config.

For zsh:

echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

For bash:

echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

The official docs also mention adding $(npm prefix -g)/bin to your shell startup file if the command is not in your PATH.

Best For
  • Node.js users
  • Developers
  • Users who want package-level control
  • Local testing
Not Best For

Avoid this method if you are not comfortable fixing Node, PATH, or package-manager errors. Tiny package issues can waste entire afternoons, because modern tooling was apparently designed by people who enjoy riddles.

Method 4: Install OpenClaw With Docker

Docker is useful if you want a cleaner, isolated OpenClaw setup.


1
Create a Project Folder

Create a project folder:

mkdir openclaw-docker
cd openclaw-docker
2
Create an Environment File

Create an .env file:

nano .env

Add this:

OPENCLAW_GATEWAY_TOKEN=change-this-to-a-strong-random-token
OPENCLAW_GATEWAY_PORT=8080
OPENCLAW_STATE_DIR=/data/.openclaw
OPENCLAW_WORKSPACE_DIR=/data/workspace
3
Create Storage Folders

Create storage folders:

mkdir -p data/.openclaw data/workspace
4
Create a Docker Compose File

Create a docker-compose.yml file:

nano docker-compose.yml

Add a basic Compose structure:

services:
 openclaw-gateway:
   image: ghcr.io/openclaw/openclaw:latest
   container_name: openclaw-gateway
   restart: unless-stopped
   env_file:
     - .env
   ports:
     - "8080:8080"
   volumes:
     - ./data/.openclaw:/data/.openclaw
     - ./data/workspace:/data/workspace
5
Start OpenClaw

Start OpenClaw:

docker compose up -d
6
Check Running Containers

Check running containers:

docker compose ps

View logs:

docker compose logs -f openclaw-gateway
7
Run a Health Check

Run a health check if your Docker image exposes the gateway command:

docker compose exec openclaw-gateway node dist/index.js health --token "$OPENCLAW_GATEWAY_TOKEN"
8
Connect a Channel From Docker

For example, to add Telegram:

docker compose run --rm openclaw-cli channels add --channel telegram --token "<TELEGRAM_BOT_TOKEN>"

OpenClaw Docker docs show this pattern for running channel commands through the openclaw-cli service.

Best For
  • Developers
  • Self-hosters
  • Users who want isolated setup
  • Users who want persistent storage
  • Server deployments
Important Docker Warning

Do not skip persistent volumes. If you rebuild containers without proper mounts, your setup data can disappear like it got a better job.

Method 5: Install OpenClaw on a VPS or Cloud Server

A VPS install is best when you want OpenClaw running 24/7 with full control. OpenClaw docs list VPS/cloud deployment as an install path, and Docker is commonly used for server-based deployments.


1
Update the Server

For Ubuntu/Debian:

sudo apt update && sudo apt upgrade -y

Install basic tools:

sudo apt install -y curl git ufw nano
2
Install Docker
curl -fsSL https://get.docker.com | sh

Add your user to the Docker group:

sudo usermod -aG docker $USER

Apply group changes:

newgrp docker

Check Docker:

docker --version
docker compose version
3
Create OpenClaw Directory
mkdir -p ~/openclaw
cd ~/openclaw

Create folders:

mkdir -p data/.openclaw data/workspace
4
Create Environment File
nano .env

Add:

OPENCLAW_GATEWAY_TOKEN=replace-with-a-strong-token
OPENCLAW_GATEWAY_PORT=8080
OPENCLAW_STATE_DIR=/data/.openclaw
OPENCLAW_WORKSPACE_DIR=/data/workspace
5
Create Docker Compose File
nano docker-compose.yml

Add:

services:
 openclaw-gateway:
   image: ghcr.io/openclaw/openclaw:latest
   container_name: openclaw-gateway
   restart: unless-stopped
   env_file:
     - .env
   ports:
     - "8080:8080"
   volumes:
     - ./data/.openclaw:/data/.openclaw
     - ./data/workspace:/data/workspace
6
Start OpenClaw
docker compose up -d

Check logs:

docker compose logs -f
7
Configure Firewall

Allow SSH:

sudo ufw allow OpenSSH

Allow your OpenClaw port only if needed:

sudo ufw allow 8080/tcp

Enable firewall:

sudo ufw enable

Check status:

sudo ufw status
8
Open the Control UI

Use your VPS IP:

http://YOUR_SERVER_IP:8080

If you use a domain and reverse proxy, connect through your domain instead.

9
Restart or Update OpenClaw

Restart:

docker compose restart

Update image:

docker compose pull
docker compose up -d

Check logs after update:

docker compose logs -f openclaw-gateway
Best For
  • 24/7 OpenClaw hosting
  • Full control
  • Advanced users
  • Production workflows
  • Users comfortable with server maintenance
Not Best For

Avoid VPS if you do not want to manage firewalls, logs, updates, SSL, backups, and random server nonsense. The cloud is just someone else’s computer, plus your invoice.

Which OpenClaw Install Method Should You Choose?

User GoalBest Install MethodDifficultyBest For
Fastest way to run OpenClawManaged hostingEasyBeginners, teams, founders, non-technical users
Test OpenClaw on your laptopLocal installMediumLearning, testing, demos, small experiments
Manage OpenClaw with packagesnpm, pnpm, or bun installMediumNode.js users and developers
Run OpenClaw in an isolated setupDocker installMediumDevelopers, self-hosters, repeatable deployments
Run OpenClaw 24/7 with full controlVPS installHardTechnical users, self-hosters, production control

Common OpenClaw Installation Problems and Fixes

These are the most common OpenClaw setup problems and the simple way to fix each one.

ProblemWhy It HappensCorrect Solution
OpenClaw command not foundYour system cannot find the OpenClaw command after install.Run openclaw --version. If it fails after npm install, fix your system PATH.
OpenClaw installed but not configuredThe model provider, API key, gateway, or workspace was not set up.Run openclaw onboard --install-daemon and complete onboarding.
Dashboard not openingThe gateway is not running, or you are opening the wrong URL.Run openclaw gateway status, then open http://127.0.0.1:18789.
Install fails because of Node.jsNode.js is missing or too old.Run node --version. Use Node 24, or Node 22.19+ if needed.
Docker setup loses data after restartPersistent storage was not configured.Set OPENCLAW_STATE_DIR=/data/.openclaw and OPENCLAW_WORKSPACE_DIR=/data/workspace.
Gateway token is weak or exposedThe gateway token is too simple, shared, or visible publicly.Use a strong OPENCLAW_GATEWAY_TOKEN and keep it private.
OpenClaw stops after closing terminal or SSHYou started OpenClaw in a normal terminal session.Use openclaw onboard --install-daemon. For Docker, use docker compose up -d.

Frequently Asked Questions

Is OpenClaw free to install?
Yes, OpenClaw can be installed as an open-source AI agent framework. However, you may still need to pay for hosting, managed hosting, a VPS, or model/API usage depending on how you run it.
How long does OpenClaw installation take?
OpenClaw installation time depends on the setup method. A managed setup with Ampere.sh is usually faster because you skip manual server work. Local setup can take a few minutes if your system is ready, while Docker or VPS setup can take longer because you need to configure storage, ports, tokens, and security.
Will updating OpenClaw delete my data?
Updating OpenClaw should not delete your data if persistent storage is configured correctly. Before updating, back up your state files, workspace files, environment variables, and important configuration. Tiny ritual, huge regret prevention.
Why is OpenClaw not working after installation?
OpenClaw may fail because of missing onboarding, wrong Node version, broken PATH, missing API key, gateway not running, blocked firewall, wrong port, or no persistent storage. Start by checking onboarding, gateway status, and logs.
What port does OpenClaw use?
OpenClaw commonly uses the Gateway and Control UI through the same gateway port. 18789 is often used locally, while Docker or VPS setups may use a configured port like 8080. Always check your environment settings.
Is managed hosting better than installing OpenClaw manually?
Managed hosting is better if you want the easiest setup without servers, Docker, ports, logs, updates, or uptime work. Manual install is better for full control. For beginners and teams, Ampere.sh keeps the focus on workflows, not setup maintenance.
Which OpenClaw install method is best for beginners?
Managed hosting is usually best for beginners because it removes most of the technical setup. Local install is fine for testing, but managed hosting is better if you want OpenClaw running online and available for real workflows.
Which OpenClaw install method is best for advanced users?
Advanced users can choose Docker, VPS, or source install. Docker is good for isolated deployment, VPS is best for full server control, and source install is best for developers who want to customize or contribute to OpenClaw.

Also Read

How to Set Up OpenClaw for Beginners
Guide

How to Set Up OpenClaw for Beginners

9 min·May 21, 2026
Openclaw On Docker
Integration

Openclaw On Docker

·
How to Install OpenClaw on a VPS (Step-by-Step Guide)
Installation

How to Install OpenClaw on a VPS (Step-by-Step Guide)

·
Michael Park

Written by

Michael Park

Senior Technical Writer & DevRel

Michael creates comprehensive installation and setup guides for developers and system administrators. With experience across Linux, macOS, Windows, and embedded systems, he has written over 200 technical tutorials used by millions of developers. He focuses on clear, step-by-step instructions that work the first time, covering everything from Raspberry Pi to enterprise servers.

Run OpenClaw Without Server Setup

Deploy OpenClaw on managed hosting platform like ampere.sh, then connect your model, channels, tools, and first useful workflow.

Run OpenClaw Now