← Back to cheatsheet

🍎 Install OpenClaw on Mac

Go from zero to a working AI assistant on macOS in about 20 minutes. This guide covers everything — prerequisites, installation, the onboarding wizard, daemon setup, and verifying your first chat.

macOS 13+ (Ventura or later)Apple Silicon & IntelUpdated for v2026.3.23

1 Prerequisites

Before you start, make sure you have:

  • macOS 13 (Ventura) or later — older versions may work but aren't officially supported
  • Terminal access — found in Applications → Utilities → Terminal (or use iTerm2)
  • An AI API key — Anthropic (Claude) is recommended; OpenAI and Google also work
  • ~20 minutes of uninterrupted time

Apple Silicon vs Intel

OpenClaw works on both. To check which chip you have:

uname -m
  • arm64 = Apple Silicon (M1/M2/M3/M4) — you're on the latest architecture
  • x86_64 = Intel — everything works, just slightly different Homebrew paths

💡 Good to know: The installation commands are identical for both chips. Homebrew and Node.js handle all architecture differences automatically.

2 Install Homebrew

Homebrew is the standard package manager for macOS. If you already have it, skip to Step 3.

Check if Homebrew is installed:

brew --version

If you see a version number, skip ahead. If not, install it:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

The script will ask for your macOS password — this is normal. It needs admin access to install to the system directories.

⚠️ Apple Silicon users: After installation, Homebrew will tell you to add it to your PATH. Run the two commands it shows you (they start with echo and eval), then open a new Terminal window.

Verify:

brew --version
# Should output: Homebrew 4.x.x

3 Install Node.js 22+

OpenClaw requires Node.js 22.12.0 or higher. Check your current version:

node --version

If you see v22.x.x or higher, skip to Step 4.

Option A: Install via Homebrew (recommended)

brew install node@22

Option B: Install via nvm (if you manage multiple Node versions)

# Install nvm if you don't have it
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

# Close and reopen Terminal, then:
nvm install 22
nvm use 22
nvm alias default 22

Option C: Download from nodejs.org

Visit nodejs.org and download the macOS installer. It auto-detects your chip architecture.

Verify Node and npm:

node --version   # Should be v22.x.x or higher
npm --version    # Should be 10.x.x or higher

✅ Tip: If you're on Apple Silicon, confirm you're running native ARM64 Node (not Rosetta): node -e "console.log(process.arch)" — should output arm64. Native runs ~2x faster.

4 Install OpenClaw

You have two options. Pick one.

Option A: One-liner (fastest)

This script detects your OS, checks Node, installs the CLI, and launches the onboarding wizard automatically:

curl -fsSL https://openclaw.ai/install.sh | bash

💡 Security-conscious? Download first, inspect, then run:

curl -fsSL https://openclaw.ai/install.sh -o install.sh

cat install.sh (review it)

bash install.sh

Option B: Manual via npm (more control)

npm install -g openclaw@latest

Then launch the onboarding wizard manually:

openclaw onboard --install-daemon

Verify the installation:

which openclaw    # Should show a path
openclaw --version # Should show v2026.x.x

⚠️ "command not found"? The npm global bin directory isn't in your PATH. Fix it:

echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc

Then open a new Terminal window and try again.

💡 Sharp/libvips errors? If you see errors about sharp during install, run:

SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest

5 Run the onboarding wizard

If you used the one-liner, the wizard started automatically. If you used npm, run:

openclaw onboard --install-daemon

The wizard walks you through:

  1. Authentication — sets up a pairing code for secure DM access
  2. Gateway settings — configures the local server (default port: 18789)
  3. AI model — enter your API key (Anthropic recommended)
  4. Channel connection — optionally connect Telegram, WhatsApp, Discord, etc.
  5. Daemon installation — installs a macOS LaunchAgent so OpenClaw runs in the background

✅ Tip: Don't stress about getting everything perfect now. Every setting can be changed later in ~/.openclaw/openclaw.json. The wizard is just getting you to a working baseline.

When the wizard finishes, you'll see:

🔧 Loading configuration from ~/.openclaw/openclaw.json
🧠 Gateway starting on ws://127.0.0.1:18789
📡 WebChat available at http://localhost:18789
✅ OpenClaw is running

6 Set up your AI model

If you didn't configure this during the wizard, add your API key now. Open the config:

nano ~/.openclaw/openclaw.json

Find the model section and add your key:

{
  "model": {
    "provider": "anthropic",
    "name": "claude-sonnet-4-5-20250929",
    "apiKey": "sk-ant-your-key-here"
  }
}

Save with Ctrl+O, exit with Ctrl+X, then restart:

openclaw gateway restart

Which model should you pick?

ModelCostBest for
Claude Sonnet 4.5$3 / $15 per 1MBest value — recommended for most users
Claude Haiku 4.5$1 / $5 per 1MBudget-friendly, still very capable
Claude Opus 4.6$5 / $25 per 1MMaximum intelligence, complex tasks
GPT-5$1.25 / $10 per 1MAffordable flagship alternative
Gemini 2.5 Flash$0.30 / $2.50 per 1MVery cheap, good for heartbeat
Ollama (local)FreePrivacy, no API costs, needs 16GB+ RAM

💡 Don't have an API key yet? Sign up at console.anthropic.com. New accounts get $5 free credits. No credit card required to start.

Use our Cost Calculator to estimate your monthly bill before committing.

7 Start the daemon (always-on)

The daemon keeps OpenClaw running in the background — even after you close Terminal or restart your Mac.

If the wizard installed it, it's already running. Check:

openclaw daemon status

If it's not running, start it:

openclaw daemon start

Other daemon commands:

openclaw daemon stop      # Stop the background service
openclaw daemon restart   # Restart after config changes
openclaw daemon status    # Check if it's running
openclaw logs --follow    # Watch live logs

What the daemon does

It installs a macOS LaunchAgent at ~/Library/LaunchAgents/com.openclaw.gateway.plist. This means:

  • OpenClaw starts automatically when you log in
  • It restarts if it crashes
  • It survives Terminal being closed
  • It runs on login, not on boot (it's a user service, not a system service)

⚠️ Without the daemon: OpenClaw only runs while your Terminal is open. If you close Terminal or your Mac sleeps, the agent goes offline. Always install the daemon for daily use.

8 Verify it works

Open your browser and go to:

http://localhost:18789

You should see the WebChat interface. Type something like:

Hello! What can you do?

If you get a response from your AI model — congratulations, OpenClaw is running.

You can also test from the Terminal:

# Quick health check
openclaw doctor

# Send a test message
openclaw agent --message "Hello, what's the time?"

# Check gateway status
openclaw gateway status

✅ All working? The WebChat is great for testing, but the real power comes from connecting a messaging channel (Telegram, WhatsApp, Discord, iMessage). Head to Your First 24 Hours to set that up.

9 Key files & paths

Know where everything lives:

PathWhat it is
~/.openclaw/openclaw.jsonMain config — model, channels, security, heartbeat
~/.openclaw/workspace/Your agent's brain — SOUL.md, MEMORY.md, USER.md, skills
~/.openclaw/credentials/Channel tokens and secrets
~/.openclaw/agents/Per-agent session data
/tmp/openclaw/Logs (rotate automatically)
~/Library/LaunchAgents/com.openclaw.gateway.plistDaemon config (auto-start on login)

🔐 Security: Never commit ~/.openclaw/ to version control. It contains your API keys and credentials. Add it to your global .gitignore.

10 Troubleshooting

"command not found: openclaw"

Your PATH is missing the npm global bin. Fix:

echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Port 18789 already in use

# Find what's using the port
lsof -i :18789

# Kill it
kill -9 <PID>

# Or change the port in config
openclaw config set port 18790

Node version too old

node --version  # Need 22.12.0+

# Upgrade via Homebrew
brew upgrade node@22

# Or via nvm
nvm install 22 && nvm use 22

Gateway won't start / crashes immediately

# Check the logs
openclaw logs --follow

# Run diagnostics
openclaw doctor --fix

# Reset gateway state (keeps config)
openclaw gateway restart --verbose

Slow on Apple Silicon (running under Rosetta)

# Check architecture
node -e "console.log(process.arch)"
# If it says "x64" — you're under Rosetta

# Reinstall Node natively
brew uninstall node
brew install node@22
# Verify: should say "arm64" now

Sharp / native module build errors

# Force prebuilt binaries
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest

# Or install build tools
xcode-select --install
npm install -g node-gyp

macOS security prompts (Gatekeeper)

If macOS blocks OpenClaw from running: go to System Settings → Privacy & Security and click "Allow Anyway" for the blocked item. This is normal for CLI tools installed outside the App Store.