OpenClaw Tutorial: Getting Started in 30 Minutes
Your first AI agent, from zero to automation in half an hour
This tutorial walks you through setting up OpenClaw and creating your first automation. By the end, you'll have an AI agent that can read emails and draft responses automatically.
What You'll Build
- ✓ OpenClaw instance running on your server
- ✓ Gmail integration for email processing
- ✓ AI agent that drafts email responses
- ✓ Slack notifications for important emails
Prerequisites
What You Need
- • A Linux server (Ubuntu 22.04 LTS recommended)
- • 4GB RAM, 2 CPU cores minimum
- • Basic command line familiarity
- • Node.js 18+ and NPM installed
- • SSH access to your server
Recommended Server Providers
| Provider | Plan | Cost |
|---|---|---|
| Hetzner | CPX11 (4GB RAM) | ~$6/month |
| DigitalOcean | Basic (4GB RAM) | $24/month |
| Linode | Shared (4GB RAM) | $24/month |
Step 1: Provision Your Server (5 minutes)
Option A: Hetzner Cloud (Recommended)
- Sign up at hetzner.com/cloud
- Create a new project
- Click "Add Server"
- Choose: Location closest to you, Image: Ubuntu 22.04, Type: CPX11 (2 vCPU, 4GB RAM)
- Add your SSH key
- Name it "openclaw-server" and create
Option B: DigitalOcean
- Sign up at digitalocean.com
- Create Droplet → Basic → Regular Intel with SSD
- $24/month plan (4GB RAM)
- Choose datacenter region
- Select Ubuntu 22.04
- Add SSH key and create
Step 2: Connect to Your Server (2 minutes)
Open your terminal and SSH into the server:
# Replace with your server's IP address
ssh root@YOUR_SERVER_IP
# Update the system
apt update && apt upgrade -yStep 3: Install Dependencies (3 minutes)
# Install Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
# Verify installation
node --version # Should show v20.x.x
npm --version # Should show 10.x.x
# Install Git
apt-get install -y git
# Install build tools
apt-get install -y build-essentialStep 4: Install OpenClaw (5 minutes)
# Create directory
mkdir -p /opt/openclaw && cd /opt/openclaw
# Clone OpenClaw
git clone https://github.com/openclaw/openclaw.git .
# Install dependencies
npm install
# Build the project
npm run build
# Create config directory
mkdir -p ~/.config/openclawStep 5: Configure OpenClaw (5 minutes)
Create your configuration file:
# Create config file
nano ~/.config/openclaw/config.yamlAdd this basic configuration:
# Basic OpenClaw Configuration
gateway:
port: 8080
host: 0.0.0.0
# AI Provider (choose one)
ai:
provider: anthropic
model: claude-3-sonnet-20240229
apiKey: YOUR_ANTHROPIC_API_KEY
# Or use OpenAI:
# ai:
# provider: openai
# model: gpt-4
# apiKey: YOUR_OPENAI_API_KEY
# Memory
memory:
enabled: true
path: ~/.config/openclaw/memory
# Logging
log:
level: info
file: ~/.config/openclaw/openclaw.logGet Your API Key
- Anthropic (Claude): Go to console.anthropic.com → Get API Key
- OpenAI: Go to platform.openai.com/api-keys → Create new key
Step 6: Start OpenClaw (2 minutes)
# Start OpenClaw
npm start
# You should see:
# [Gateway] Server listening on http://0.0.0.0:8080
# [AI] Connected to provider: anthropicPress Ctrl+C to stop for now. We'll set up a proper service next.
Step 7: Create a Systemd Service (3 minutes)
To keep OpenClaw running after you disconnect:
# Create service file
nano /etc/systemd/system/openclaw.serviceAdd this content:
[Unit]
Description=OpenClaw AI Agent
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/openclaw
ExecStart=/usr/bin/npm start
Restart=always
RestartSec=10
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.targetEnable and start the service:
# Reload systemd
systemctl daemon-reload
# Enable service (starts on boot)
systemctl enable openclaw
# Start service now
systemctl start openclaw
# Check status
systemctl status openclawStep 8: Connect Telegram (3 minutes)
Let's add your first integration—Telegram for easy control.
- Message @BotFather on Telegram
- Type
/newbot - Name your bot (e.g., "MyOpenClaw")
- Choose a username (e.g., "myopenclaw_bot")
- Copy the API token (looks like:
123456789:ABCdef...)
Add Telegram to your config:
# Edit config
nano ~/.config/openclaw/config.yaml
# Add at the bottom:
channels:
telegram:
enabled: true
botToken: YOUR_TELEGRAM_BOT_TOKEN
allowedUsers: [] # Leave empty to allow all, or add your Telegram ID
# Restart OpenClaw
systemctl restart openclawNow message your bot on Telegram—it should respond!
Troubleshooting
OpenClaw won't start
Check logs:
journalctl -u openclaw -fCommon issues:
- Missing API key
- Port 8080 already in use
- Permission issues on /opt/openclaw
Telegram bot not responding
- Verify bot token is correct
- Make sure you started a conversation with the bot
- Check OpenClaw logs for errors
What's Next?
You now have a working OpenClaw setup! Here are ways to expand:
- • Gmail integration: Add email processing skills
- • Slack integration: Connect to your team workspace
- • Calendar skills: Enable meeting prep and scheduling
- • Custom skills: Write your own for specific tasks
Need Help With Setup?
This tutorial gets you started, but production setups need more: security hardening, backup systems, SSL certificates, and custom skills.
Get Professional Setup ($25) →