OpenClaw Complete Setup Guide: Build Your Own AI Agent Team in 2026
OpenClaw Complete Setup Guide: Build Your Own AI Agent Team in 2026
OpenClaw is the open-source gateway that lets you build AI agents and deploy them across 30+ messaging platforms ā Discord, WhatsApp, Telegram, Slack, Signal, iMessage, and more. One gateway, unlimited agents, running 24/7.
This is the complete guide. By the end, you'll have a working agent team that can serve customers, generate content, or run your business while you sleep.
What You'll Build
By following this guide, you will:
- ā Install OpenClaw on your machine (Mac, Linux, Windows, or VPS)
- ā Create your first AI agent with a custom personality
- ā Write a SOUL file that defines exactly how your agent thinks and communicates
- ā Connect your agent to Discord, Telegram, or WhatsApp
- ā Give your agent tools (web browsing, file access, APIs)
- ā Secure everything with Docker or direct deployment
- ā Scale to multiple agents working together
Time required: 30-60 minutes for basic setup. 2-4 hours for a full production deployment.
Prerequisites
- A computer (Mac, Linux, or Windows with WSL)
- Node.js v18+ installed
- A Discord, Telegram, or WhatsApp account for testing
- An AI model API key (Anthropic Claude or OpenAI GPT recommended)
Step 1: Install OpenClaw
On macOS (Homebrew)
# Install via npm (recommended)
npm install -g openclaw
# Or via Homebrew
brew install openclaw
On Linux (Ubuntu/Debian)
# Install Node.js 20+ if needed
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Install OpenClaw globally
npm install -g openclaw
On a VPS (Recommended for 24/7 operation)
# On a fresh Ubuntu 22.04 VPS ($5-10/month on DigitalOcean or Hostinger)
sudo apt update && sudo apt upgrade -y
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs git
npm install -g openclaw
Verify Installation
openclaw --version
# Should output: OpenClaw 2026.4.21 or similar
Step 2: Initial Configuration
Run the onboarding wizard:
openclaw onboard
This walks you through:
- Choosing your AI model ā Claude (recommended), GPT, or Gemini
- Setting your API key ā paste your Anthropic/OpenAI/Google key
- Configuring your first channel ā Discord, Telegram, etc.
- Creating your first agent ā basic personality and name
Manual Configuration
If you prefer manual setup, edit ~/.openclaw/openclaw.json:
{
"models": {
"default": "anthropic/claude-sonnet-4-5",
"providers": {
"anthropic": {
"apiKey": "sk-ant-your-key-here"
},
"openai": {
"apiKey": "sk-your-openai-key-here"
}
}
}
}
Step 3: Start the Gateway
openclaw gateway start
Your gateway is now running. It's the bridge between your messaging platforms and your AI agents.
Access the Web UI
OpenClaw includes a web dashboard:
http://localhost:3210
From here you can chat with your agents, manage settings, and monitor activity.
Step 4: Write Your First SOUL File
The SOUL file is what makes your agent unique. It defines personality, expertise, tone, rules, and behavior. This is the secret sauce.
Create ~/.openclaw/workspace/agents/my-agent/SOUL.md:
# SOUL.md ā Customer Service Agent
## Identity
- **Name:** Alex
- **Role:** Customer Support Specialist
- **Tone:** Friendly, professional, efficient
- **Emoji:** š¤
## Core Mission
Help customers with product questions, order issues,
and general inquiries. Resolve issues quickly and
leave customers feeling valued.
## Personality
- Warm but professional ā not robotic, not overly casual
- Always acknowledge the customer's frustration before solving
- Use their name when possible
- Keep responses concise but thorough
- Never say "I'm just an AI" ā you ARE the support team
## Knowledge
- Product catalog: [link to your product docs]
- Shipping policies: Standard 3-5 days, Express 1-2 days
- Return policy: 30 days, no questions asked
- Pricing: See products page
## Rules
- Never share customer data with other customers
- Escalate billing disputes to human team
- Don't make promises about features not yet released
- Always end with "Is there anything else I can help with?"
SOUL File Best Practices
- Be specific about tone ā "professional but warm" is better than "nice"
- Include example responses ā show the agent what good looks like
- Set clear boundaries ā what should the agent NOT do?
- Add domain knowledge ā the more context, the better the responses
- Include escalation rules ā when should it hand off to a human?
Step 5: Create an IDENTITY File
The IDENTITY file is a quick reference for the agent's persona:
# IDENTITY.md ā Alex
- **Name:** Alex
- **Creature:** Customer support specialist who genuinely
cares about helping people
- **Vibe:** Warm, efficient, solution-oriented
- **Emoji:** š¤
Step 6: Connect to Discord
Create a Discord Bot
- Go to Discord Developer Portal
- Click "New Application" ā name it
- Go to "Bot" ā "Add Bot"
- Copy the bot token
- Enable "Message Content Intent" under Privileged Intents
- Use the OAuth2 URL Generator to invite the bot to your server
Configure OpenClaw for Discord
# Add Discord channel
openclaw channel add discord --token YOUR_BOT_TOKEN
Or manually in openclaw.json:
{
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_BOT_TOKEN"
}
}
}
Restart the gateway:
openclaw gateway restart
Your agent is now live on Discord! Message it and watch it respond with the personality you defined in the SOUL file.
Step 7: Connect to Telegram
# Create a bot via @BotFather on Telegram
# Get your bot token
openclaw channel add telegram --token YOUR_BOT_TOKEN
openclaw gateway restart
Step 8: Connect to WhatsApp
WhatsApp requires a bit more setup (Meta Business API):
- Create a Meta Business account
- Set up WhatsApp Business API
- Get your phone number ID and access token
- Configure in OpenClaw
{
"channels": {
"whatsapp": {
"enabled": true,
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"accessToken": "YOUR_ACCESS_TOKEN"
}
}
}
Step 9: Give Your Agent Tools
Agents become powerful when they can DO things, not just talk:
Web Browsing
{
"agents": {
"my-agent": {
"tools": ["web_fetch", "browser"]
}
}
}
File Access
{
"agents": {
"my-agent": {
"tools": ["read", "write", "exec"]
}
}
}
Custom Skills
OpenClaw has 65+ skills (53 bundled + custom):
- weather ā get forecasts
- github ā manage repos, PRs, issues
- apple-reminders ā manage tasks
- coding-agent ā delegate coding to Codex/Claude Code
- video-frames ā extract clips from videos
- And dozens more
Step 10: Secure Your Deployment
Option A: Docker (Recommended for Production)
# Dockerfile
FROM node:20-slim
RUN npm install -g openclaw
COPY openclaw.json /root/.openclaw/openclaw.json
COPY workspace /root/.openclaw/workspace
EXPOSE 3210
CMD ["openclaw", "gateway", "start"]
docker build -t my-agent .
docker run -d --name my-agent -p 3210:3210 my-agent
Option B: systemd Service (Linux VPS)
# Create service file
sudo tee /etc/systemd/system/openclaw.service << 'EOF'
[Unit]
Description=OpenClaw AI Gateway
After=network.target
[Service]
Type=simple
User=openclaw
ExecStart=/usr/bin/openclaw gateway start
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable openclaw
sudo systemctl start openclaw
Security Best Practices
- API keys ā store in
.envfiles, never in git - Firewall ā only expose port 3210 if needed, use nginx reverse proxy
- HTTPS ā always use SSL in production (Let's Encrypt is free)
- Updates ā run
npm update -g openclawregularly - Monitoring ā check logs with
openclaw gateway logs - Credentials ā use
chmod 600on all credential files
Step 11: Scale to Multiple Agents
The real power is running multiple specialized agents:
~/.openclaw/workspace/agents/
āāā customer-support/ # Handles customer inquiries
ā āāā SOUL.md
ā āāā IDENTITY.md
āāā sales-agent/ # Qualifies leads
ā āāā SOUL.md
ā āāā IDENTITY.md
āāā content-writer/ # Generates blog posts
ā āāā SOUL.md
ā āāā IDENTITY.md
āāā social-media/ # Manages social accounts
āāā SOUL.md
āāā IDENTITY.md
Each agent gets its own SOUL file, personality, and tools. They can even communicate with each other for complex workflows.
Choosing Your AI Model: The Complete Comparison
Claude Sonnet 4.5 (Recommended for most agents)
- Cost: ~$3/$15 per million tokens (input/output)
- Context: 200K tokens
- Best for: Customer service, content, general tasks
- Why: Fast, affordable, great at following SOUL file instructions
- When to upgrade: Complex reasoning tasks
Claude Opus 4.7 (Premium)
- Cost: ~$15/$75 per million tokens
- Context: 200K tokens
- Best for: CEO-level agents, complex analysis, coding
- Why: Strongest reasoning, best at nuanced tasks
- When to use: High-value agents where quality justifies cost
GPT-5.4 (Alternative)
- Cost: ~$10/$30 per million tokens
- Context: 128K tokens
- Best for: Multimodal tasks (image + text), conversational
- Why: Great at understanding images, audio, mixed content
GPT-4o (Budget-friendly)
- Cost: ~$5/$15 per million tokens
- Context: 128K tokens
- Best for: High-volume, cost-sensitive agents
Gemini 2.5 Pro (Research)
- Cost: ~$1.25/$5 per million tokens
- Context: 1M tokens (!)
- Best for: Processing massive documents, research tasks
- Why: 5x the context window of Claude/GPT
Local Models via Ollama (Free)
- Cost: $0 (after hardware)
- Best for: Privacy-sensitive, high-volume, offline
- Setup: Install Ollama, run
ollama run llama3.1 - Configure OpenClaw: Point to
http://localhost:11434
Revenue Models for Agent Businesses
| Model | Setup Time | Monthly Revenue | Your Cost | |---|---|---|---| | Customer support SaaS | 2-4 weeks | $200-1,000/client | $20-50/mo | | Sales qualification | 3-6 weeks | $300-1,500/client | $30-100/mo | | Content production | 1-2 weeks | $500-5,000/client | $50-200/mo | | Chatbot agency | 2-4 weeks | $500-2,000/client | $20-50/mo | | AI consulting + agents | Ongoing | $2,000-10,000/client | Varies |
Next Steps
- Install OpenClaw ā 5 minutes
- Create your first agent ā 15 minutes
- Connect to Discord ā 10 minutes
- Write a killer SOUL file ā 30 minutes
- Deploy to production ā 1 hour
- Start selling agent services ā this week
The tools are free. The infrastructure is open-source. The market is wide open. Build something incredible.
Want the complete agent business toolkit with SOUL file templates, pricing calculators, and client outreach scripts? Check our AI Entrepreneur Toolkit ā everything you need to go from setup to revenue.
š§ Free: 50 Ways to Make Money with AI
Join 10,000+ readers getting weekly AI money-making strategies. Unsubscribe anytime.