Getting Started with OpenClaw
Learn how to install, configure, and start using OpenClaw AI gateway. From CLI installation to your first AI conversation in minutes.
What You'll Learn
- Install OpenClaw CLI using curl, npm, or pnpm
- Run the onboarding wizard to configure your environment
- Start the OpenClaw Gateway service
- Pair and connect WhatsApp, Telegram, or other channels
- Send your first AI message through OpenClaw
Table of Contents
0Prereqs
Before starting, make sure you have:
- Node >=22
- pnpm (optional; recommended if you build from source)
- Recommended: Brave Search API key for web search. Easiest path: openclaw configure --section web (stores tools.web.search.apiKey). See Web tools.
- macOS: if you plan to build the apps, install Xcode / CLT. For the CLI + gateway only, Node is enough.
- Windows: use WSL2 (Ubuntu recommended). WSL2 is strongly recommended; native Windows is untested, more problematic, and has poorer tool compatibility. Install WSL2 first, then run the Linux steps inside WSL. See Windows (WSL2).
1Install the CLI (Recommended)
Choose your preferred installation method:
Using curl (Linux/macOS)
Quick one-line installation:
curl -fsSL https://openclaw.ai/install.sh | bashUsing PowerShell (Windows)
Quick installation for Windows:
iwr -useb https://openclaw.ai/install.ps1 | iexUsing npm
Install via npm package manager:
npm install -g openclaw@latestUsing pnpm
Install via pnpm (faster alternative):
pnpm add -g openclaw@latest2Run the Onboarding Wizard (and Install the Service)
The onboarding wizard will guide you through initial configuration and daemon installation:
openclaw onboard --install-daemonWhat the wizard does:
- 1Local vs Remote gateway
- 2Auth: OpenAI Code (Codex) subscription (OAuth) or API keys. For Anthropic we recommend an API key; claude setup-token is also supported.
- 3Providers: WhatsApp QR login, Telegram/Discord bot tokens, Mattermost plugin tokens, etc.
- 4Daemon: background install (launchd/systemd; WSL2 uses systemd)
- 5Runtime: Node (recommended; required for WhatsApp/Telegram). Bun is not recommended.
- 6Gateway token: the wizard generates one by default (even on loopback) and stores it in gateway.auth.token.
Auth: Where It Lives (Important)
Recommended Anthropic path: set an API key (wizard can store it for service use). claude setup-token is also supported if you want to reuse Claude Code credentials. OAuth credentials (legacy import): ~/.openclaw/credentials/oauth.json. Auth profiles (OAuth + API keys): ~/.openclaw/agents/[agentId]/agent/auth-profiles.json. Headless/server tip: do OAuth on a normal machine first, then copy oauth.json to the gateway host.
3Start the Gateway
If you installed the service during onboarding, the Gateway should already be running:
Check Gateway Status
openclaw gateway statusManual Run (Foreground)
openclaw gateway --port 18789 --verboseQuick Verify (2 min)
Verify your OpenClaw installation is working correctly:
Check Status
openclaw statusShows overall system status and configuration
Run Health Check
openclaw healthVerifies all components are functioning
Security Audit
openclaw security audit --deepChecks for security vulnerabilities
4Pair + Connect Your First Chat Surface
Connect your preferred messaging platform to start chatting with AI:
📱WhatsApp (QR Login)
Scan via WhatsApp → Settings → Linked Devices.
openclaw channels login💬Telegram / Discord / Others
The wizard can write tokens/config for you. If you prefer manual config, start with: Telegram: Telegram; Discord: Discord; Mattermost (plugin): Mattermost. Telegram DM tip: your first DM returns a pairing code. Approve it (see next step) or the bot won't respond.
DM Safety (Pairing Approvals)
Default posture: unknown DMs get a short code and messages are not processed until approved. If your first DM gets no reply, approve the pairing:
List Pending Pairings
openclaw pairing list whatsappApprove a Pairing
openclaw pairing approve whatsapp \<code\>From Source (Development)
If you're hacking on OpenClaw itself, run from source:
Clone Repository
git clone https://github.com/openclaw/openclaw.git
cd openclawInstall Dependencies
pnpm installBuild UI
pnpm ui:build # auto-installs UI deps on first runBuild Project
pnpm buildRun Onboarding
openclaw onboard --install-daemonStart Gateway
node openclaw.mjs gateway --port 18789 --verboseVerify End-to-End
In a new terminal, send a test message:
openclaw message send --target +15555550123 --message "Hello from OpenClaw"💡 If openclaw health shows 'no auth configured', go back to the wizard and set OAuth/key auth — the agent won't be able to respond without it. Tip: openclaw status --all is the best pasteable, read-only debug report. Health probes: openclaw health (or openclaw status --deep) asks the running gateway for a health snapshot.
Next Steps (Optional, but Great)
- macOS menu bar app + voice wake: <a href="https://docs.openclaw.ai/platforms/macos" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">macOS app</a>
- iOS/Android nodes (Canvas/camera/voice): <a href="https://docs.openclaw.ai/nodes" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">Nodes</a>
- Remote access (SSH tunnel / Tailscale Serve): <a href="https://docs.openclaw.ai/remote" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">Remote access and Tailscale</a>
- Always-on / VPN setups: <a href="https://docs.openclaw.ai/remote" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">Remote access</a>, <a href="https://exe.dev" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">exe.dev</a>, <a href="https://docs.openclaw.ai/platforms/hetzner" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">Hetzner</a>, <a href="https://docs.openclaw.ai/platforms/macos-remote" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">macOS remote</a>
Troubleshooting
Installation script fails
Gateway won't start
Can't connect to WhatsApp
Messages not being delivered
Continue Learning
Now that OpenClaw is running, explore more features: