Module 2: Setup Like a ProLesson 2 of 6

Recommended Setup for Beginners

Recommended Setup for Beginners

Let's get you running in 15 minutes.

Prerequisites

You need:

  • Node.js 20+ (check: node --version)
  • npm (comes with Node)
  • Git (check: git --version)
  • An API key from Anthropic or OpenAI

Step 1: Install OpenClaw

npm install -g openclaw

Verify installation:

openclaw --version

Step 2: Initialize Your Workspace

mkdir my-agent && cd my-agent openclaw init

This creates:

  • config.yaml — Main configuration
  • workspace/ — Where your agent files live

Step 3: Configure Your API Key

Edit config.yaml:

providers: anthropic: apiKey: "sk-ant-..." # Your Anthropic key # OR openai: apiKey: "sk-..." # Your OpenAI key models: default: anthropic/claude-sonnet-4 # Start with Sonnet

Step 4: Start the Gateway

openclaw gateway start

You should see:

✓ Gateway started on port 3000 ✓ Workspace: /path/to/my-agent/workspace

Step 5: Connect a Channel

For testing, use the CLI:

openclaw chat

Or connect Telegram:

# In config.yaml channels: telegram: botToken: "123456:ABC..." allowlist: - your_telegram_user_id

You're Running!

That's it. You have a working OpenClaw instance.

In the next lessons, we'll configure it properly.