OpenClaw is a self-hosted assistant gateway you run on your own machine (or server). Once itโs installed, you can finish onboarding, connect your preferred chat channels, and keep your personal customization in a workspace that wonโt break when you update.
This guide walks you through a clean install + first-time setup, plus the most common fixes when something doesnโt work.
What you need before you start
OpenClawโs official install path expects:
- Node.js 22+ (the installer can install it if missing)
- macOS / Linux / Windows
pnpmonly if you build from source- On Windows, WSL2 is strongly recommended for the smoothest experience.
Option A (recommended): Install OpenClaw using the installer script
This is the quickest and most reliable route because it handles Node detection, installs the CLI, and runs onboarding in one go.
macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash
Windows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex
Want to install without onboarding?
If you prefer to run onboarding later:
macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
Windows (PowerShell)
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard
Option B: Install via npm (if you already have Node 22+)
If you want full control (and you already manage Node yourself):
npm install -g openclaw@latest
openclaw onboard --install-daemon
If you hit โsharpโ build errors (common on macOS)
If sharp fails because of global libvips, you can force prebuilt binaries:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
Option C: Build OpenClaw from source (for contributors)
Use this if youโre planning to modify OpenClaw or run from a local repo checkout:
git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
pnpm ui:build
pnpm build
Then make the CLI available globally:
pnpm link --global
Finally, run onboarding:
openclaw onboard --install-daemon
Verify your install (do this before anything else)
After installation, confirm everything is healthy:
openclaw doctor
openclaw status
openclaw dashboard
doctorchecks for config issuesstatusshows gateway statusdashboardopens the browser UI
First-time setup: create your workspace + config the safe way
To keep updates painless, OpenClaw recommends keeping your personal customization outside the repo:
- Workspace:
~/.openclaw/workspace - Config:
~/.openclaw/openclaw.json
Bootstrap everything once:
openclaw setup
This is the โset it up once, customize foreverโ step.
Connect your channels (WhatsApp / Telegram / Discord / etc.)
After setup, connect the channels you want your assistant to respond on.
A common flow is:
openclaw channels login
openclaw health
channels loginlinks your messaging surfaceshealthis a quick sanity check that the gateway and connections work
If onboarding isnโt available in your build, the docs recommend doing: openclaw setup โ openclaw channels login โ start the gateway manually.
When you need to start the Gateway manually
In some setups (or dev workflows) you may want to run the gateway directly:
openclaw gateway
(Used as a manual โbring it upโ command when the app isnโt managing it.)
Dev workflow (hot reload gateway)
If youโre working from source, you can run the gateway in watch mode:
pnpm gateway:watch
Where OpenClaw stores data (so you know what to back up)
OpenClaw keeps user state under ~/.openclaw/ and calls out paths like:
- Credentials and channel auth under
~/.openclaw/credentials/โฆ - Session transcripts stored on disk under
~/.openclaw/agents/<agentId>/sessions/*.jsonl
If youโre migrating machines, backing up ~/.openclaw/ (carefully) is usually the โdonโt lose everythingโ folder.
Security setup you should do early (especially if you connect chat apps)
OpenClaw can execute tools that read/write files, run commands, and send messagesโso treat it like a powerful local agent, not a harmless chatbot.
Run the built-in security audit
OpenClaw includes an audit command that checks for common security foot-guns and can optionally apply fixes:
openclaw security audit
openclaw security audit --deep
openclaw security audit --fix
Consider sandboxing tool execution (recommended for safer experimentation)
OpenClaw can run tool execution inside Docker containers to reduce blast radius (optional, config-controlled).
Also: treat skill folders as trusted codeโrestrict who can modify them.
Troubleshooting (fast fixes)
โopenclaw: command not foundโ
Use the docsโ โAfter installโ checks first (openclaw doctor) and confirm your terminal session sees the installed global binary.
Windows issues
If youโre on Windows and things feel flaky, follow the recommendation to run OpenClaw under WSL2. Itโs the most consistent path.
Install succeeds but onboarding doesnโt appear
Run:
openclaw setup
openclaw channels login
openclaw gateway
Thatโs the documented fallback flow.
Recommended โclean setupโ checklist
If you want the shortest path that avoids 90% of future headaches:
- Install via the installer script (Option A)
- Verify with
openclaw doctor+openclaw status - Run
openclaw setupto generate workspace/config - Connect channels:
openclaw channels login - Sanity check:
openclaw health - Run
openclaw security auditand fix anything obvious