Lesson 1 of 3
Install OpenClaw
Estimated time: 4 minutes
Install OpenClaw
In this lesson, you'll install OpenClaw, run the setup wizard, and start the Gateway — the background service that powers everything.
Install OpenClaw
Choose your preferred installation method:
Install OpenClaw globally with npm:
npm install -g openclaw@latestVerify the installation:
openclaw --versionSee the official install docs for more options.
Run the setup wizard
The onboard command walks you through first-time configuration:
openclaw onboard --install-daemonThe wizard will ask you to:
- Choose an LLM provider — Select from Anthropic, OpenAI, Google Gemini, or others
- Enter your API key — Paste the key from your provider's dashboard
- Install the daemon — Keeps the Gateway running in the background
Your config is saved to ~/.openclaw/openclaw.json. You can change the model anytime:
openclaw models set anthropic/claude-sonnet-4-6Which model to pick?
For most Moltiversity courses, any model works. The prompts are simple and outputs are short. Start with whatever provider you already have a key for — you can always switch later.
Start the Gateway
The Gateway is OpenClaw's core process — it connects chat platforms, runs the AI agent, and executes scheduled jobs:
openclaw gatewayYou should see:
[Gateway] Starting on port 18789...
[Gateway] Web UI available at http://127.0.0.1:18789/
[Gateway] Cron scheduler initialized
[Gateway] Ready.
If you installed the daemon in step 2, the Gateway starts automatically on boot. Check its status anytime:
openclaw gateway statusMake sure your npm global bin directory is in your PATH. Run npm config get prefix and add its bin subdirectory to your shell profile.
Add to your ~/.zshrc or ~/.bashrc:
export PATH="$(npm config get prefix)/bin:$PATH"
Then reload: source ~/.zshrc
Run diagnostics first:
openclaw doctorThe most common issues are:
- Missing or invalid API key — Re-run
openclaw onboardto reconfigure - Port already in use — Another process is using port 18789. Stop it or change the port in
~/.openclaw/openclaw.json - Node.js too old — OpenClaw requires Node.js 18+. Check with
node --version
Checkpoint
What command starts the OpenClaw background service?
You should now have:
- OpenClaw installed globally
- An LLM provider configured
- The Gateway running (or set to auto-start via daemon)
Next: connect a chat platform so OpenClaw has somewhere to talk to you.
Mastering Multi-Channel Connections with OpenClaw
# Connecting Your Channels with Confidence OpenClaw's versatility comes from its unified interface for diverse messaging platforms. While the `openclaw channel add` command handles the configuration,...