/ AI Agent / Getting Started with OpenClaw: From Zero to Production
AI Agent 4 min read

Getting Started with OpenClaw: From Zero to Production

Step-by-step guide to installing and configuring OpenClaw. Covers macOS, Windows, Docker installation, Telegram/Discord/Slack integration, and production deployment checklist. Perfect for beginners getting started with OpenClaw.

Getting Started with OpenClaw: From Zero to Production - Complete AI Agent guide and tutorial

You've decided to try OpenClaw. Maybe you're convinced by its data sovereignty, or you need deep integration with Slack and Telegram. Whatever your reason, this guide walks you through getting OpenClaw from "just installed" to "actually useful" — without the headache.

We'll cover:

  • Installation (all major platforms)
  • Initial configuration
  • Connecting your first messaging platform
  • Running your first agent task
  • Production hardening checklist

1. Installation: Choosing Your Path

OpenClaw provides a one-line installer for Unix-like systems:

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

This script:

  • Installs Node.js dependencies
  • Sets up the Gateway service
  • Creates default configuration files
  • Starts the Gateway automatically

Verification:

openclaw status

You should see the Gateway running on ws://127.0.0.1:18789.

Option B: Windows (PowerShell)

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

Or via CMD:

curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Option C: Docker (For Advanced Users)

# docker-compose.yml
services:
  openclaw:
    image: openclaw/openclaw:latest
    ports:
      - "18789:18789"
    volumes:
      - ./data:/data
    environment:
      - API_KEY=your-api-key

2. Initial Configuration

The Essential Config File

After installation, you'll find openclaw.json in your data directory. Here's a production-ready starting point:

{
  "gateway": {
    "host": "0.0.0.0",
    "port": 18789,
    "auth": {
      "enabled": true,
      "token": "generate-a-secure-token-here"
    }
  },
  "model": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-20250514",
    "apiKey": "${ANTHROPIC_API_KEY}"
  },
  "memory": {
    "type": "supermemory",
    "path": "./memory"
  },
  "channels": {
    "enabled": []
  }
}

Setting Up Environment Variables

Create a .env file (add to .gitignore!):

# Required
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...

# Optional
DISCORD_BOT_TOKEN=your-token
TELEGRAM_BOT_TOKEN=your-token
SLACK_BOT_TOKEN=your-token

3. Connecting Messaging Platforms

Telegram (Easiest to Start)

  1. Create a bot via @BotFather on Telegram
  2. Copy your bot token
  3. Add to config:
{
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "${TELEGRAM_BOT_TOKEN}",
      "admins": ["your-user-id"]
    }
  }
 }
}
  1. Restart Gateway:
openclaw gateway restart
  1. Message your bot — you should get a welcome response!

Discord

  1. Create an application at discord.com/developers
  2. Add a bot to your server
  3. Enable Message Content Intent
  4. Configure:
{
  "channels": {
    "discord": {
      "enabled": true,
      "botToken": "${DISCORD_BOT_TOKEN}",
      "serverIds": ["your-server-id"],
      "channelIds": ["your-channel-id"]
    }
  }
}

Slack

  1. Create a Slack app at api.slack.com/apps
  2. Enable Bot Token and Event Subscriptions
  3. Install to workspace
  4. Configure:
{
  "channels": {
    "slack": {
      "enabled": true,
      "botToken": "xoxb-...",
      "signingSecret": "your-secret",
      "appToken": "xapp-..."
    }
  }
}

4. Running Your First Agent Task

Basic Interaction

Once connected, just message your agent:

You: What's the weather in Shanghai?

The agent should respond after a brief think cycle.

More Complex Tasks

You: Research the top 5 AI coding assistants and create a comparison table with pricing, features, and pros/cons

OpenClaw will:

  1. Break down the task
  2. Search the web
  3. Compile results
  4. Format as a table

Multi-Step Automation

Create a skill for recurring tasks:

# skills/daily-standup.md
name: Daily Standup
trigger: /standup
actions:
  - type: github
    action: get-issues
    filters:
      assignee: me
      updated: today
  - type: format
    template: "## Yesterday\n{{issues}}\n## Today\n"

5. Agent Teams: Beyond Single Agents

For complex workflows, OpenClaw supports multiple agents working together:

{
  "agents": {
    "researcher": {
      "role": "researcher",
      "model": "claude-sonnet-4-20250514",
      "skills": ["web-search", "read", "summarize"]
    },
    "coder": {
      "role": "coder",
      "model": "claude-sonnet-4-20250514",
      "skills": ["write", "edit", "bash"]
    },
    "reporter": {
      "role": "reporter",
      "model": "claude-sonnet-4-20250514",
      "skills": ["format", "markdown"]
    }
  },
  "teams": {
    "default": {
      "members": ["researcher", "coder", "reporter"],
      "workflow": "sequential"
    }
  }
}

6. Production Hardening Checklist

Before going live, ensure you've addressed:

Security

  • Authentication token enabled
  • Gateway behind firewall (or reverse proxy with SSL)
  • No sensitive data in config files (use env vars)
  • Regular security updates scheduled

Reliability

  • Log rotation configured
  • Health check endpoint tested
  • Restart scripts tested
  • Backup strategy for memory files

Monitoring

  • Gateway logs accessible
  • Error alerts configured
  • Resource usage tracked

Performance

  • Model latency acceptable
  • Channel response times tested
  • Concurrent session limits set

7. Troubleshooting Common Issues

"Connection refused" Errors

Check:

openclaw gateway status
netstat -an | grep 18789

Fix: Ensure Gateway is running and port isn't blocked.

Model API Failures

Check:

echo $ANTHROPIC_API_KEY

Fix: Verify API key is set correctly and has credits.

Channel Not Responding

Check:

openclaw channels list
openclaw channels test telegram

Fix: Verify bot tokens and permissions.

Stay tuned for advanced guides that will help you unlock OpenClaw's full potential.