How to Install OpenClaw: Complete Setup, Usage, and Uninstall Guide

Written by FURI5 min read

How to Install OpenClaw: Complete Setup, Usage, and Uninstall Guide
On this page

OpenClaw is a powerful AI agent framework that lets you run a local gateway, connect messaging channels, and orchestrate AI agents from your own machine. This guide covers everything you need to know, from installation to uninstallation, so you can get started quickly and cleanly.


Prerequisites#

Before installing OpenClaw, make sure you have:

  • Node.js 22 or newer installed

Verify your Node version:

text
node --version

If you don't have Node 22+, the installer script can install it for you automatically.


Installation Methods#

The fastest way to get started.

macOS / Linux / WSL2:

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

Windows (PowerShell):

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

To install without auto-running the onboarding wizard:

macOS / Linux / WSL2:

text
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

Windows (PowerShell):

text
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard

Method 2: npm / pnpm#

Using npm:

text
1npm install -g openclaw@latest
2openclaw onboard --install-daemon

Using pnpm:

text
1pnpm add -g openclaw@latest
2pnpm approve-builds -g
3openclaw onboard --install-daemon

Note: If you get sharp build errors, run:

text
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest

Method 3: From Source#

Clone and build the project:

text
1git clone https://github.com/openclaw/openclaw.git
2cd openclaw
3pnpm install
4pnpm ui:build
5pnpm build

Link the CLI globally:

text
pnpm link --global

Run onboarding:

text
openclaw onboard --install-daemon

Method 4: Docker#

OpenClaw supports containerized deployments. See the Docker guide (opens in a new tab) for full instructions.


Onboarding Wizard#

After installation, run the onboarding wizard to configure your setup:

text
openclaw onboard --install-daemon

The wizard walks you through:

  1. Model/Auth | Choose your AI provider (API key, OAuth, etc.)
  2. Workspace | Location for agent files (default: ~/.openclaw/workspace)
  3. Gateway | Port, bind address, and auth mode
  4. Channels | WhatsApp, Telegram, Discord, Google Chat, Signal, etc.
  5. Daemon | Installs a LaunchAgent (macOS) or systemd unit (Linux/WSL2)
  6. Health check | Verifies the gateway is running
  7. Skills | Installs recommended skills

QuickStart vs Advanced#

  • QuickStart: Uses sensible defaults (loopback gateway on port 18789, auto-generated auth token)
  • Advanced: Full control over every step (mode, workspace, gateway, channels, daemon, skills)

Quick Setup Summary#

After installation and onboarding, verify everything works:

text
1# Check gateway status
2openclaw gateway status
3
4# Open the browser dashboard
5openclaw dashboard

The dashboard is available at:

text
http://127.0.0.1:18789/

Useful Commands#

text
1# Check for config issues
2openclaw doctor
3
4# Check gateway status
5openclaw status
6
7# Open browser UI
8openclaw dashboard
9
10# Run gateway in foreground
11openclaw gateway --port 18789
12
13# Send a test message
14openclaw message send --target +15555550123 --message "Hello from OpenClaw"
15
16# Add another agent
17openclaw agents add <name>

Environment Variables#

Customize OpenClaw's behavior with these environment variables:

VariableDescription
OPENCLAW_HOMESets the home directory for internal path resolution
OPENCLAW_STATE_DIROverrides the state directory
OPENCLAW_CONFIG_PATHOverrides the config file path

Troubleshooting: openclaw Not Found#

If the openclaw command is not found after installation:

  1. Check your paths:
text
1node -v
2npm -v
3npm prefix -g
4echo "$PATH"
  1. Add the npm global bin to your PATH. Edit ~/.zshrc or ~/.bashrc:
text
export PATH="$(npm prefix -g)/bin:$PATH"
  1. Reload your shell:
text
1source ~/.zshrc
2# or
3hash -r

Updating OpenClaw#

Keep your installation up to date by reinstalling with the same method you used:

Installer script:

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

npm:

text
npm install -g openclaw@latest

pnpm:

text
pnpm add -g openclaw@latest

Complete Uninstall Guide#

Easy Path (CLI Still Installed)#

Quick one-liner to remove everything:

text
openclaw uninstall --all --yes --non-interactive

Or step by step:

Step 1: Stop the gateway service

text
openclaw gateway stop

Step 2: Uninstall the gateway service

text
openclaw gateway uninstall

Step 3: Delete state and config

text
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"

Step 4: Delete your workspace (optional)

text
rm -rf ~/.openclaw/workspace

Step 5: Remove the CLI

text
1# Pick the one you used to install:
2npm rm -g openclaw
3# or
4pnpm remove -g openclaw
5# or
6bun remove -g openclaw

Step 6: Remove macOS app (if installed)

text
rm -rf /Applications/OpenClaw.app

Manual Service Removal (CLI Not Installed)#

If you already removed the CLI, remove the background service manually:

macOS (launchd):

text
1launchctl bootout gui/$UID/ai.openclaw.gateway
2rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Linux (systemd user unit):

text
1systemctl --user disable --now openclaw-gateway.service
2rm -f ~/.config/systemd/user/openclaw-gateway.service
3systemctl --user daemon-reload

Windows (Scheduled Task):

text
1schtasks /Delete /F /TN "OpenClaw Gateway"
2Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd"

What You Get After Setup#

After completing the installation and onboarding:

  • ✅ A running Gateway accessible at http://127.0.0.1:18789/
  • ✅ Auth configured for your chosen AI provider
  • ✅ Control UI access or a connected messaging channel
  • ✅ Background daemon running automatically

Next Steps#

For the complete official documentation, visit docs.openclaw.ai (opens in a new tab).

Keep reading

All articles