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
| Method | Best For | Difficulty | 24/7 Ready | Main Value |
|---|---|---|---|---|
| CLI install | Beginners testing OpenClaw | Easy | No | Fast local setup |
| npm/pnpm install | Node users and developers | Medium | No | More control over packages |
| Docker install | Safer isolated setup | Medium | Yes, if hosted | Cleaner environment |
| VPS/cloud install | Production and always-on use | Hard | Yes | Full server control |
| Managed hosting | Fastest production setup | Easy | Yes | No 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.
Create your account on Ampere.sh.
Deploy your OpenClaw environment from the Ampere.sh dashboard.
Open the OpenClaw Control UI after deployment.
Complete the onboarding setup.
Connect your model provider or API key.
Create your first OpenClaw agent.
Connect one message channel, such as Telegram, WhatsApp, Slack, or Discord.
Add one simple workflow, such as reminders, task follow-ups, or meeting notes.
Test the workflow with a small task before adding more tools.
Keep your setup always online so OpenClaw can handle chats, tasks, and automations without running on your laptop.
- 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.
Run the official installer command:
curl -fsSL https://openclaw.ai/install.sh | bashThis is the recommended command for most macOS, Linux, and WSL2 installs.
For native Windows PowerShell, run:
iwr -useb https://openclaw.ai/install.ps1 | iexWindows is supported, but WSL2 is still recommended for the full OpenClaw experience.
After installation, run onboarding:
openclaw onboard --install-daemonThe onboarding wizard helps you choose a model provider, add your API key, and configure the OpenClaw Gateway.
Verify that the OpenClaw Gateway is running:
openclaw gateway statusYou should see the Gateway listening on port 18789.
Open the OpenClaw Control UI:
openclaw dashboardYou can also open it manually in your browser:
http://127.0.0.1:18789- 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
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.
OpenClaw documentation currently recommends Node 24 or Node 22.19+ for package-based installs.
node -vIf Node is missing or outdated, install Node first.
npm install -g openclaw@latestThen run onboarding:
openclaw onboardStart the gateway:
openclaw gatewaypnpm add -g openclaw@latestIf pnpm asks for build approval, approve required packages:
pnpm approve-builds -gThen run:
openclaw onboard
openclaw gatewaybun install -g openclaw@latestThen run:
openclaw onboard
openclaw gatewayCheck your global npm path:
npm prefix -gAdd the global bin path to your shell config.
For zsh:
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcFor bash:
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcThe official docs also mention adding $(npm prefix -g)/bin to your shell startup file if the command is not in your PATH.
- Node.js users
- Developers
- Users who want package-level control
- Local testing
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.
Create a project folder:
mkdir openclaw-docker
cd openclaw-dockerCreate an .env file:
nano .envAdd this:
OPENCLAW_GATEWAY_TOKEN=change-this-to-a-strong-random-token
OPENCLAW_GATEWAY_PORT=8080
OPENCLAW_STATE_DIR=/data/.openclaw
OPENCLAW_WORKSPACE_DIR=/data/workspaceCreate storage folders:
mkdir -p data/.openclaw data/workspaceCreate a docker-compose.yml file:
nano docker-compose.ymlAdd 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/workspaceStart OpenClaw:
docker compose up -dCheck running containers:
docker compose psView logs:
docker compose logs -f openclaw-gatewayRun 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"- Developers
- Self-hosters
- Users who want isolated setup
- Users who want persistent storage
- Server deployments
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.
For Ubuntu/Debian:
sudo apt update && sudo apt upgrade -yInstall basic tools:
sudo apt install -y curl git ufw nanocurl -fsSL https://get.docker.com | shAdd your user to the Docker group:
sudo usermod -aG docker $USERApply group changes:
newgrp dockerCheck Docker:
docker --version
docker compose versionmkdir -p ~/openclaw
cd ~/openclawCreate folders:
mkdir -p data/.openclaw data/workspacenano .envAdd:
OPENCLAW_GATEWAY_TOKEN=replace-with-a-strong-token
OPENCLAW_GATEWAY_PORT=8080
OPENCLAW_STATE_DIR=/data/.openclaw
OPENCLAW_WORKSPACE_DIR=/data/workspacenano docker-compose.ymlAdd:
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/workspacedocker compose up -dCheck logs:
docker compose logs -fAllow SSH:
sudo ufw allow OpenSSHAllow your OpenClaw port only if needed:
sudo ufw allow 8080/tcpEnable firewall:
sudo ufw enableCheck status:
sudo ufw statusUse your VPS IP:
http://YOUR_SERVER_IP:8080If you use a domain and reverse proxy, connect through your domain instead.
Restart:
docker compose restartUpdate image:
docker compose pull
docker compose up -dCheck logs after update:
docker compose logs -f openclaw-gateway- 24/7 OpenClaw hosting
- Full control
- Advanced users
- Production workflows
- Users comfortable with server maintenance
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 Goal | Best Install Method | Difficulty | Best For |
|---|---|---|---|
| Fastest way to run OpenClaw | Managed hosting | Easy | Beginners, teams, founders, non-technical users |
| Test OpenClaw on your laptop | Local install | Medium | Learning, testing, demos, small experiments |
| Manage OpenClaw with packages | npm, pnpm, or bun install | Medium | Node.js users and developers |
| Run OpenClaw in an isolated setup | Docker install | Medium | Developers, self-hosters, repeatable deployments |
| Run OpenClaw 24/7 with full control | VPS install | Hard | Technical 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.
| Problem | Why It Happens | Correct Solution |
|---|---|---|
| OpenClaw command not found | Your 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 configured | The model provider, API key, gateway, or workspace was not set up. | Run openclaw onboard --install-daemon and complete onboarding. |
| Dashboard not opening | The 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.js | Node.js is missing or too old. | Run node --version. Use Node 24, or Node 22.19+ if needed. |
| Docker setup loses data after restart | Persistent storage was not configured. | Set OPENCLAW_STATE_DIR=/data/.openclaw and OPENCLAW_WORKSPACE_DIR=/data/workspace. |
| Gateway token is weak or exposed | The 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 SSH | You 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?
How long does OpenClaw installation take?
Will updating OpenClaw delete my data?
Why is OpenClaw not working after installation?
What port does OpenClaw use?
Is managed hosting better than installing OpenClaw manually?
Which OpenClaw install method is best for beginners?
Which OpenClaw install method is best for advanced users?
Also Read
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

