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 Moonshot, OpenAI, or Anthropic

Don't have Node.js?

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

# Using Homebrew on Mac
brew install node

Step 1: Install OpenClaw

Open your terminal and run the installation command:

npm install -g openclaw

This installs the openclaw command globally. Verify it worked:

openclaw --version

You should see a version number. If you get "command not found", try restarting your terminal or check that npm global packages are in your PATH.

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 Moonshot/Kimi as your provider and local gateway mode. These are the easiest to get working and cheapest to run.

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. Or run: export PATH="$PATH:$(npm bin -g)"
  3. Or use: npx openclaw instead
"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: