Installation
OpenClaw supports three deployment methods: one-line install script, manual npm install, and Docker.
One-Line Install Script (Recommended)
macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash
Windows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex
Install only (skip the setup wizard):
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
Manual npm Install
# Ensure Node.js 22+
node --version
# Global install
npm install -g openclaw@latest
# Run the setup wizard
openclaw onboard --install-daemon
Docker Deployment
docker pull openclaw/openclaw:latest
docker run -d \
--name openclaw \
-p 18789:18789 \
-v ~/.openclaw:/root/.openclaw \
-e ANTHROPIC_API_KEY=sk-ant-xxx \
openclaw/openclaw:latest
Verify Installation
openclaw --version
openclaw doctor
openclaw gateway status
openclaw dashboard
If openclaw dashboard opens successfully, your gateway is running.
Troubleshooting
Command Not Found (macOS / Linux)
The openclaw command isn't found because npm's global bin directory isn't in your PATH.
# Find your npm global bin directory
npm prefix -g
# Example output: /usr/local
# Temporary fix (current terminal only)
export PATH="$(npm prefix -g)/bin:$PATH"
# Permanent fix — pick your shell:
# zsh (macOS default)
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
# bash
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
# Fish
set -Ux fish_user_paths (npm prefix -g)/bin $fish_user_paths
Command Not Found (Windows)
- Run
npm prefix -gto get the global directory (e.g.C:\Users\YourName\AppData\Roaming\npm) - Open "System Properties → Advanced → Environment Variables"
- Under "User variables", find
Path, click "Edit", then "New", and paste the path above - Reopen PowerShell or CMD
pnpm: approve-builds Warning
When installing with pnpm, you may see:
WARN Some packages have executable scripts that were not run.
Run `pnpm approve-builds` to review and approve them.
Run these three steps:
pnpm approve-builds
pnpm install -g openclaw@latest
openclaw --version
Node.js Version Too Old
OpenClaw requires Node.js 22+. Use nvm to manage versions:
# Install nvm (if you don't have it)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Install and switch to Node 22
nvm install 22
nvm use 22
# Set as default (avoids reverting after terminal restart)
nvm alias default 22
# Verify
node --version # should output v22.x.x
sharp Build Failure
Option 1: Skip local libvips (fastest)
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
Option 2: Use prebuilt binaries
npm install -g openclaw@latest --prefer-offline
Option 3: pnpm fix
pnpm install -g openclaw@latest --ignore-scripts
macOS Arm (M1/M2/M3): If the above fails, install libvips first:
brew install vips
npm install -g openclaw@latest
postinstall Script Skipped
If you see a postinstall script skipped warning, run manually:
openclaw onboard
Port Conflict (18789 Already in Use)
# Check what's using the port
lsof -i :18789
# Start on a different port
openclaw gateway --port 19000
Gateway Won't Start
openclaw doctor # auto-diagnose
openclaw doctor --fix # attempt auto-repair
openclaw logs --follow # stream error logs in real time
Post-Install Checklist
After installation, verify each item:
-
openclaw --versionprints a version number -
node --versionshows v22 or higher -
openclaw doctorshows no errors (all green ✓) -
openclaw gateway statusshows Running -
openclaw dashboardopens normally in the browser - At least one channel configured (Telegram / Feishu / Discord)
- Sending a message in your channel gets a reply from the bot