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:
node --versionIf you don't have Node 22+, the installer script can install it for you automatically.
Installation Methods#
Method 1: Installer Script (Recommended)#
The fastest way to get started.
macOS / Linux / WSL2:
curl -fsSL https://openclaw.ai/install.sh | bashWindows (PowerShell):
iwr -useb https://openclaw.ai/install.ps1 | iexTo install without auto-running the onboarding wizard:
macOS / Linux / WSL2:
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboardWindows (PowerShell):
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboardMethod 2: npm / pnpm#
Using npm:
1npm install -g openclaw@latest
2openclaw onboard --install-daemonUsing pnpm:
1pnpm add -g openclaw@latest
2pnpm approve-builds -g
3openclaw onboard --install-daemonNote: If you get
sharpbuild errors, run:textSHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
Method 3: From Source#
Clone and build the project:
1git clone https://github.com/openclaw/openclaw.git
2cd openclaw
3pnpm install
4pnpm ui:build
5pnpm buildLink the CLI globally:
pnpm link --globalRun onboarding:
openclaw onboard --install-daemonMethod 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:
openclaw onboard --install-daemonThe wizard walks you through:
- Model/Auth | Choose your AI provider (API key, OAuth, etc.)
- Workspace | Location for agent files (default:
~/.openclaw/workspace) - Gateway | Port, bind address, and auth mode
- Channels | WhatsApp, Telegram, Discord, Google Chat, Signal, etc.
- Daemon | Installs a LaunchAgent (macOS) or systemd unit (Linux/WSL2)
- Health check | Verifies the gateway is running
- 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:
1# Check gateway status
2openclaw gateway status
3
4# Open the browser dashboard
5openclaw dashboardThe dashboard is available at:
http://127.0.0.1:18789/Useful Commands#
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:
| Variable | Description |
|---|---|
OPENCLAW_HOME | Sets the home directory for internal path resolution |
OPENCLAW_STATE_DIR | Overrides the state directory |
OPENCLAW_CONFIG_PATH | Overrides the config file path |
Troubleshooting: openclaw Not Found#
If the openclaw command is not found after installation:
- Check your paths:
1node -v
2npm -v
3npm prefix -g
4echo "$PATH"- Add the npm global bin to your PATH. Edit
~/.zshrcor~/.bashrc:
export PATH="$(npm prefix -g)/bin:$PATH"- Reload your shell:
1source ~/.zshrc
2# or
3hash -rUpdating OpenClaw#
Keep your installation up to date by reinstalling with the same method you used:
Installer script:
curl -fsSL https://openclaw.ai/install.sh | bashnpm:
npm install -g openclaw@latestpnpm:
pnpm add -g openclaw@latestComplete Uninstall Guide#
Easy Path (CLI Still Installed)#
Quick one-liner to remove everything:
openclaw uninstall --all --yes --non-interactiveOr step by step:
Step 1: Stop the gateway service
openclaw gateway stopStep 2: Uninstall the gateway service
openclaw gateway uninstallStep 3: Delete state and config
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"Step 4: Delete your workspace (optional)
rm -rf ~/.openclaw/workspaceStep 5: Remove the CLI
1# Pick the one you used to install:
2npm rm -g openclaw
3# or
4pnpm remove -g openclaw
5# or
6bun remove -g openclawStep 6: Remove macOS app (if installed)
rm -rf /Applications/OpenClaw.appManual Service Removal (CLI Not Installed)#
If you already removed the CLI, remove the background service manually:
macOS (launchd):
1launchctl bootout gui/$UID/ai.openclaw.gateway
2rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plistLinux (systemd user unit):
1systemctl --user disable --now openclaw-gateway.service
2rm -f ~/.config/systemd/user/openclaw-gateway.service
3systemctl --user daemon-reloadWindows (Scheduled Task):
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#
- DM safety and approvals: Pairing Guide (opens in a new tab)
- Connect more channels: Channels Documentation (opens in a new tab)
- Advanced workflows: Setup Guide (opens in a new tab)
- Full feature overview: Features (opens in a new tab)
For the complete official documentation, visit docs.openclaw.ai (opens in a new tab).



