Getting Started with OpenClaw

A practical guide from the CSUSB OpenClaw community. We set this up ourselves, hit the walls, and wrote down what actually works.


What is OpenClaw?

OpenClaw is a self-hosted AI gateway. It connects chat platforms — Discord, Telegram, WhatsApp, iMessage, and others — to AI models and coding agents. You run a single process on your own machine, and it becomes a bridge between your messaging apps and an always-available AI assistant.

Why self-hosted? Your data stays on your hardware. You pick the AI provider. You control the rules.

What can it do?


Prerequisites

Before you start, you'll need:

RequirementDetails
A computerMac, Linux, or Windows (via WSL2). A laptop works fine — you don't need a server.
Node.js 24The installer handles this for you if you don't have it. Node 22 LTS (22.16+) also works.
An AI provider API keyYou need at least one: Anthropic, OpenAI, Google AI, etc.
A Discord accountFor connecting to the CSUSB OpenClaw server.
Terminal accessYou'll be running commands. If that's new to you, don't worry — we'll walk through everything.

A Note on Cost

AI API keys cost money per use. For learning and experimentation:

You won't burn through much while learning. A few dollars covers a lot of conversation.


Step 1: Install OpenClaw

Open your terminal and run the installer script:

macOS / Linux / WSL2:

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

Windows (PowerShell):

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

Windows users: We strongly recommend using WSL2 instead of running directly on Windows. It's a Linux environment inside Windows and makes everything smoother.

The installer will:

  1. Check for Node.js (and install it if needed)
  2. Install the OpenClaw CLI globally
  3. Launch the onboarding wizard

Step 2: Run the Onboarding Wizard

If the installer didn't launch it automatically, run:

openclaw onboard --install-daemon

The --install-daemon flag sets up OpenClaw as a background service that starts automatically.

The wizard will walk you through:

  1. QuickStart vs Advanced — Choose QuickStart for sane defaults. You can always reconfigure later.
  2. AI Provider — Paste your API key (Anthropic, OpenAI, Google, etc.)
  3. Gateway settings — The defaults are fine for a local setup.
  4. Channels — You can skip channels for now and add Discord later.
  5. Daemon install — Say yes to install the background service.

Verify It's Running

openclaw gateway status

You should see that the gateway is running. If not:

openclaw gateway start

Quick Test — The Control UI

Before setting up Discord or anything else, test that OpenClaw works:

openclaw dashboard

This opens a web-based chat UI in your browser. Type a message — if you get a response from the AI, you're in business. Everything else is just connecting channels.


Step 3: Connect Discord

This is where it gets fun. You'll create a Discord bot and connect it to OpenClaw.

3a. Create a Discord Application

  1. Go to the Discord Developer Portal
  2. Click New Application — name it whatever you want (e.g., "My Agent")
  3. Click Bot in the sidebar

3b. Enable Privileged Intents

On the Bot page, scroll down to Privileged Gateway Intents and enable:

3c. Get Your Bot Token

On the Bot page, click Reset Token (despite the name, this generates your first token). Copy and save the token — you'll need it in a moment.

⚠️ Never share your bot token publicly. Anyone with it can control your bot.

3d. Invite the Bot to Your Server

  1. Click OAuth2 in the sidebar
  2. Under OAuth2 URL Generator, check: bot and applications.commands
  3. Under Bot Permissions, enable: View Channels, Send Messages, Read Message History, Embed Links, Attach Files, Add Reactions
  4. Copy the generated URL, open it in your browser, and add the bot to your server

3e. Get Your Discord IDs

You'll need Developer Mode enabled in Discord:

  1. User SettingsAdvanced → toggle on Developer Mode
  2. Right-click your server nameCopy Server ID (this is your Guild ID)
  3. Right-click your usernameCopy User ID (this is your Owner ID)

3f. Connect to OpenClaw

Run the configuration command:

openclaw configure --section discord

You'll need to provide:

3g. Restart and Test

openclaw gateway restart

Send a DM to your bot in Discord. If it responds, you're connected! 🎉


Step 4: Basic Configuration

Change the AI Model

OpenClaw defaults to a model, but you can change it:

openclaw configure

Or check what's currently set:

openclaw status

Reconfigure Anytime

Made a mistake? Want to change something?

openclaw configure           # General settings
openclaw configure --section discord  # Discord-specific

Common Gotchas (Lessons We Learned)

These are real problems we hit. Save yourself the headache.

1. "The bot is online but not responding"

2. "I get an API error about authentication"

Your AI provider API key might be wrong or expired. Re-enter it:

openclaw configure

3. "The gateway won't start"

4. "I want to start fresh"

openclaw onboard

5. Node.js Version Issues


What's Next?

Once you're up and running, here are some things to explore:


Get Help


This guide is maintained by the CSUSB OpenClaw community. Found an error or want to add something? Let us know in the Discord.