Installing OpenClaw

tutorialbeginner6 min readVerified Mar 8, 2026

Step-by-step guide to installing OpenClaw on macOS, Linux, or Windows WSL2 via npm or from source.

openclawinstallationsetupnpmdocker

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) |

Warning

Windows users: Native Windows is not supported. You must use WSL2 (Windows Subsystem for Linux). This is strongly recommended by the OpenClaw team.

## Method 1: npm Install (Recommended)

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
Warning

If using Docker, do not expose port 18789 to the public internet without authentication. See the Security Guide for hardening steps.

## The Onboarding Wizard

After installation, openclaw onboard walks you through:

  1. Gateway setup — Configures the background service
  2. Workspace creation — Sets up your agent workspace at ~/.openclaw/
  3. Channel selection — Picks your first messaging platform
  4. Model selection — Chooses your LLM provider
  5. 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" } } }
Tip

Never commit your config file to version control. It contains API keys and tokens. Add ~/.openclaw/ to your global gitignore.

## Updating OpenClaw

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#