Step 3 of 9

Installing OpenClaw

Let's get OpenClaw installed and running. This should take about 10-15 minutes if you have everything ready. We'll go step by step.

Prerequisites Check

Before we start, make sure you have:

Node.js 18+

Check: node --version

AI API Key

From OpenAI (OAuth/Codex), Moonshot, or Anthropic

Don't have Node.js?

Install it from nodejs.org or use a version manager:

# Using Homebrew on Mac
brew install node

📋 Official Installation Methods

Choose your operating system below. For the latest installation options, visit openclaw.ai

Step 1: Install OpenClaw

🍎 macOS / 🐧 Linux

Quick install via curl:

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

🪟 Windows (PowerShell)

Run in PowerShell:

iwr -useb https://openclaw.ai/install.ps1 | iex

🪟 Windows (CMD)

Run in Command Prompt:

curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

📦 NPM (All Platforms)

If you have Node.js installed:

npm i -g openclaw

Then run the onboard wizard:

openclaw onboard

✅ Verify Installation

Check that OpenClaw is installed correctly:

openclaw --version

You should see a version number. If you get "command not found", try restarting your terminal or check that the installation completed successfully.

Step 2: Run the Setup Wizard

The wizard will walk you through initial configuration:

openclaw

What the Wizard Asks

Workspace Path

Where your AI's memory and files live. Default is fine: ~/.openclaw/workspace

AI Model

Choose your provider (Moonshot/Kimi, OpenAI, Anthropic, etc.)

API Key

Paste your API key from your chosen provider

Gateway Mode

Choose "local" for beginners (easiest option)

💡 Recommendation

For your first setup, choose OpenAI (OAuth for Codex) and local gateway mode. It's the smoothest setup and strong value for coding workflows.

Step 3: Start the Gateway

The gateway is the service that runs in the background, handling all requests:

openclaw gateway start

You should see something like:

Starting OpenClaw gateway...
Gateway running on http://localhost:18789
Status: OK

Step 4: Your First Conversation

Open your browser and go to:

http://localhost:18789

You'll see the OpenClaw interface. Try your first command:

Type this and press Enter:

Create a file called hello.txt that says "Hello from OpenClaw!"

Your AI should create the file and confirm. Check your workspace folder ~/.openclaw/workspace to see it.

Troubleshooting

"openclaw: command not found"

Your shell can't find the command. Try:

  1. Restart your terminal
  2. Re-run the installation command for your OS
  3. Check if the binary is in your PATH
  4. For NPM installs: npx openclaw
"Gateway failed to start"

Check what's wrong:

  1. Run: openclaw doctor --fix
  2. Check if port 18789 is already in use
  3. Try: openclaw gateway restart
"API key error"

Your API key might be wrong. Fix it:

openclaw config set models.providers.[provider].apiKey 'your-key'

What's Next?

OpenClaw is now running! But it's pretty basic. Let's add some power-ups:

For the latest installation instructions and updates, visit openclaw.ai