OpenClaw Setup Guide: Install, Configure, and Run Your Gateway

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
  • pnpm only 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
  • doctor checks for config issues
  • status shows gateway status
  • dashboard opens 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 login links your messaging surfaces
  • health is 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:

  1. Install via the installer script (Option A)
  2. Verify with openclaw doctor + openclaw status
  3. Run openclaw setup to generate workspace/config
  4. Connect channels: openclaw channels login
  5. Sanity check: openclaw health
  6. Run openclaw security audit and fix anything obvious