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?
- Chat with AI from any messaging app you already use
- Run autonomous coding agents that can read/write files, run commands, and build things
- Automate tasks with cron jobs, webhooks, and standing orders
- Manage multiple AI agents with different personalities and roles
Prerequisites
Before you start, you'll need:
| Requirement | Details |
|---|---|
| A computer | Mac, Linux, or Windows (via WSL2). A laptop works fine — you don't need a server. |
| Node.js 24 | The installer handles this for you if you don't have it. Node 22 LTS (22.16+) also works. |
| An AI provider API key | You need at least one: Anthropic, OpenAI, Google AI, etc. |
| A Discord account | For connecting to the CSUSB OpenClaw server. |
| Terminal access | You'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:
- Anthropic (Claude) — starts at ~$3/million input tokens for Haiku. Sonnet is the sweet spot for most use.
- Google AI (Gemini) — has a generous free tier.
- OpenAI (GPT) — similar pricing to Anthropic.
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:
- Check for Node.js (and install it if needed)
- Install the OpenClaw CLI globally
- 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:
- QuickStart vs Advanced — Choose QuickStart for sane defaults. You can always reconfigure later.
- AI Provider — Paste your API key (Anthropic, OpenAI, Google, etc.)
- Gateway settings — The defaults are fine for a local setup.
- Channels — You can skip channels for now and add Discord later.
- 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
- Go to the Discord Developer Portal
- Click New Application — name it whatever you want (e.g., "My Agent")
- Click Bot in the sidebar
3b. Enable Privileged Intents
On the Bot page, scroll down to Privileged Gateway Intents and enable:
- ✅ Message Content Intent (required)
- ✅ Server Members Intent (recommended)
- ✅ Presence Intent (optional)
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.
3d. Invite the Bot to Your Server
- Click OAuth2 in the sidebar
- Under OAuth2 URL Generator, check:
botandapplications.commands - Under Bot Permissions, enable: View Channels, Send Messages, Read Message History, Embed Links, Attach Files, Add Reactions
- 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:
- User Settings → Advanced → toggle on Developer Mode
- Right-click your server name → Copy Server ID (this is your Guild ID)
- Right-click your username → Copy User ID (this is your Owner ID)
3f. Connect to OpenClaw
Run the configuration command:
openclaw configure --section discord You'll need to provide:
- Bot Token — the token you copied earlier
- Guild ID — your server ID
- Owner ID — your user ID
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"
- Check Message Content Intent. This is the #1 issue. Go back to the Discord Developer Portal → Bot → make sure Message Content Intent is ON.
- Check pairing. Discord DMs default to pairing mode. You may need to pair first — the bot will tell you if so.
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"
- Check if something else is using port 18789:
lsof -i :18789 - Check the logs:
openclaw logs
4. "I want to start fresh"
openclaw onboard 5. Node.js Version Issues
- Check your version:
node --version - Need to update? Use nvm:
nvm install 24 nvm use 24
What's Next?
Once you're up and running, here are some things to explore:
- Multi-agent setups — Run multiple AI agents with different roles
- Workspace & memory — Give your agent persistent memory and file access
- Automation — Set up cron jobs and scheduled tasks
- Official docs — The full reference for everything OpenClaw can do
Get Help
- CSUSB OpenClaw Discord — Ask questions in our server
- Official OpenClaw Discord — discord.com/invite/clawd
- Docs — docs.openclaw.ai
- GitHub — github.com/openclaw/openclaw
This guide is maintained by the CSUSB OpenClaw community. Found an error or want to add something? Let us know in the Discord.