Installing OpenClaw
Step-by-step guide to installing OpenClaw on macOS, Linux, or Windows WSL2 via npm or from source.
Installing OpenClaw
This tutorial gets OpenClaw installed and running on your machine. The whole process takes about 5 minutes.
System Requirements#
| Requirement | Minimum | Recommended | |-------------|---------|-------------| | Node.js | v22+ | v22 LTS | | OS | macOS, Linux, Windows (WSL2) | macOS or Linux | | RAM | 2 GB free | 4 GB+ free | | Disk | 500 MB | 2 GB+ (for logs and memory) |
Windows users: Native Windows is not supported. You must use WSL2 (Windows Subsystem for Linux). This is strongly recommended by the OpenClaw team.
The fastest path for most builders:
# Install globally npm install -g openclaw@latest # Run the onboarding wizard openclaw onboard --install-daemon
The --install-daemon flag installs the Gateway as a system service (launchd on macOS, systemd on Linux) so it stays running in the background.
You can also use pnpm or bun:
pnpm add -g openclaw@latest # or bun add -g openclaw@latest
Method 2: Clone from GitHub (For Contributors)#
If you want to hack on OpenClaw itself:
git clone https://github.com/openclaw/openclaw.git cd openclaw npm install npm link openclaw --version
Method 3: Docker (For VPS Deployment)#
For always-on deployments:
docker run -d \ --name openclaw \ --restart unless-stopped \ -v ~/.openclaw:/root/.openclaw \ -p 18789:18789 \ openclaw/openclaw:latest
If using Docker, do not expose port 18789 to the public internet without authentication. See the Security Guide for hardening steps.
After installation, openclaw onboard walks you through:
- Gateway setup — Configures the background service
- Workspace creation — Sets up your agent workspace at
~/.openclaw/ - Channel selection — Picks your first messaging platform
- Model selection — Chooses your LLM provider
- Skill installation — Installs recommended starter skills
The wizard is interactive and takes about 2-3 minutes. You can re-run it anytime.
Verify Installation#
# Check version openclaw --version # Check system health openclaw doctor # Run security audit openclaw security audit
Configuration File#
OpenClaw stores its config at ~/.openclaw/openclaw.json. The onboarding wizard creates this for you, but you can edit it directly:
{ "gateway": { "port": 18789, "token": "your-secret-token" }, "models": { "defaults": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" } } }
Never commit your config file to version control. It contains API keys and tokens. Add ~/.openclaw/ to your global gitignore.
OpenClaw moves fast. Update regularly, especially for security patches:
npm update -g openclaw openclaw security audit
As of March 2026, version 2026.2.26 or later is the minimum acceptable deployment version. Anything earlier is vulnerable to at least one critical CVE.
Troubleshooting#
Node.js version too old?
nvm install 22 nvm use 22
Daemon not starting?
openclaw doctor --repair
Permission errors on Linux?
mkdir -p ~/.npm-global npm config set prefix ~/.npm-global export PATH=~/.npm-global/bin:$PATH
Next Steps#
- Set up messaging — Connect Telegram, WhatsApp, or another platform
- Configure your LLM — Pick and connect your AI model
- Build your first agent — Create a real workflow