OpenClaw is one of the most powerful open-source AI agents available, but its setup is less documented than Hermes Agent, and the learning curve is steeper. This guide walks you through the complete installation, configuration, and first automation — clearly, step by step.


What You're Installing

OpenClaw is an AI agent with three capabilities that set it apart:

Computer and browser control: OpenClaw can literally see your screen, move the mouse, click buttons, and interact with any application or website. This is the feature most people come to OpenClaw for.

MCP (Model Context Protocol) support: Full integration with the growing MCP ecosystem. Any tool that exposes an MCP interface can be used by OpenClaw as a capability.

ACP (Agent Communication Protocol): OpenClaw can coordinate with other AI agents, either acting as an orchestrator sending tasks to specialized agents, or as a worker receiving instructions from a higher-level agent.


Prerequisites

Before installing, ensure you have:

  • A computer or VPS running Ubuntu 20.04+ or macOS (Windows via WSL2)
  • Python 3.11+
  • Node.js 18+ (for MCP server components)
  • An OpenRouter API key OR direct API key for your preferred model
  • A browser (Chromium or Chrome, for browser automation features)
  • 2GB+ RAM available

Installation

Step 1: System Dependencies

On Ubuntu:

sudo apt update
        sudo apt install -y python3.11 python3.11-venv python3-pip git curl
        sudo apt install -y chromium-browser xvfb  # For headless browser automation
        curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
        sudo apt install -y nodejs

On macOS:

brew install python@3.11 node git
        brew install --cask chromium

Step 2: Clone OpenClaw

git clone https://github.com/openclaw/openclaw
        cd openclaw

Step 3: Python Environment

python3.11 -m venv venv
        source venv/bin/activate  # Linux/Mac
        # or: venv\Scripts\activate  # Windows
        
        pip install -r requirements.txt

Step 4: Install MCP Dependencies

cd mcp-servers
        npm install
        cd ..

Configuration

Step 1: Environment Setup

cp config/config.example.yaml config/config.yaml
        nano config/config.yaml

The main configuration file:

# AI Model Configuration
        model:
          provider: openrouter  # or: anthropic, openai, local
          primary_model: anthropic/claude-3.5-sonnet
          api_key: ${OPENROUTER_API_KEY}
          
        # Browser Configuration
        browser:
          headless: true  # false to see the browser
          browser_type: chromium
          slow_mo: 0  # milliseconds between actions (increase for debugging)
          
        # Computer Control
        computer_use:
          enabled: true
          screenshot_interval: 1.0  # seconds between screenshots
          
        # MCP Configuration
        mcp:
          enabled: true
          servers:
            - name: filesystem
              command: node
              args: ["mcp-servers/filesystem/index.js"]
            - name: web-search
              command: node
              args: ["mcp-servers/web-search/index.js"]
              
        # ACP Configuration
        acp:
          enabled: false  # Enable when using multi-agent setups
          port: 8765
          
        # Logging
        logging:
          level: INFO
          file: logs/openclaw.log

Step 2: Create .env File

cat > .env << 'EOF'
        OPENROUTER_API_KEY=your_openrouter_key_here
        ANTHROPIC_API_KEY=your_anthropic_key_here  # optional direct access
        OPENAI_API_KEY=your_openai_key_here  # optional
        SEARCH_API_KEY=your_search_api_key  # for web search MCP
        EOF

Step 3: Virtual Display (VPS Only)

For headless browser operation on a VPS without a display:

# Install virtual framebuffer
        sudo apt install -y xvfb
        
        # Add to your startup script
        export DISPLAY=:99
        Xvfb :99 -screen 0 1280x1024x24 &

Or add to your systemd service file.


Running OpenClaw

Interactive Mode

source venv/bin/activate
        python openclaw.py

You'll see the OpenClaw prompt:

OpenClaw v0.x.x
        Type your task or 'help' for commands
        > 

Your First Task: Web Research

> Research the top 5 AI automation tools in 2025 and create a comparison table

OpenClaw will:

  1. Open a browser (headless)
  2. Search for information on multiple sites
  3. Navigate to relevant pages
  4. Extract content
  5. Compile and format a comparison table
  6. Return results to the terminal

Your First Browser Automation Task

> Go to news.ycombinator.com, find the top 3 AI-related stories today, and summarize each one

Watch the logs to see OpenClaw navigating the browser in real-time.


Key MCP Integrations

Filesystem MCP

Gives OpenClaw access to read and write files on your system. Enable in config.yaml and specify which directories to allow access to:

mcp:
          servers:
            - name: filesystem
              command: node
              args: ["mcp-servers/filesystem/index.js"]
              env:
                ALLOWED_PATHS: "/home/user/workspace,/tmp"

Now you can tell OpenClaw: "Read all the CSV files in my workspace folder and summarize the data."

Web Search MCP

Enables structured web search. Requires a search API key (Serper, Brave Search, or SerpAPI all work):

    - name: web-search
              command: node
              args: ["mcp-servers/web-search/index.js"]
              env:
                SEARCH_API_KEY: ${SEARCH_API_KEY}
                SEARCH_PROVIDER: serper

GitHub MCP

Gives OpenClaw access to GitHub repositories — reading code, creating issues, reviewing PRs:

    - name: github
              command: node
              args: ["mcp-servers/github/index.js"]
              env:
                GITHUB_TOKEN: ${GITHUB_TOKEN}

Building Your First Real Automation

Let's build a competitor price monitoring automation.

Task Description

Every morning, check three competitor websites for price changes on their main product tiers, and send a summary report.

Step 1: Create a Task File

cat > tasks/price_monitor.yaml << 'EOF'
        name: Competitor Price Monitor
        schedule: "0 8 * * *"  # Daily at 8 AM
        description: Monitor competitor pricing
        
        steps:
          - action: browse
            url: "https://competitor1.com/pricing"
            extract: 
              selector: ".pricing-table"
              save_as: competitor1_pricing
              
          - action: browse
            url: "https://competitor2.com/pricing"
            extract:
              selector: ".price"
              save_as: competitor2_pricing
              
          - action: analyze
            prompt: |
              Compare these pricing pages to yesterday's data.
              Identify any price changes, new plans, or removed plans.
              Format as a brief executive summary.
            inputs: [competitor1_pricing, competitor2_pricing]
            save_as: price_analysis
            
          - action: notify
            method: email
            to: "you@example.com"
            subject: "Daily Competitor Price Report"
            body: "{{ price_analysis }}"
        EOF

Step 2: Run the Task

python openclaw.py --task tasks/price_monitor.yaml

Step 3: Schedule It

Add to crontab:

crontab -e
        # Add:
        0 8 * * * cd /root/openclaw && source venv/bin/activate && python openclaw.py --task tasks/price_monitor.yaml

Multi-Agent Setup with ACP

For advanced use cases, OpenClaw can coordinate multiple agents. Here's a simple two-agent setup:

Orchestrator OpenClaw: Receives high-level tasks, breaks them down, delegates to worker agents.

Worker OpenClaw (or other ACP-compatible agents): Executes specific subtasks and returns results.

Enable ACP in the orchestrator's config:

acp:
          enabled: true
          role: orchestrator
          port: 8765
          workers:
            - name: research_agent
              endpoint: "http://localhost:8766"
            - name: writing_agent
              endpoint: "http://localhost:8767"

Each worker runs with:

acp:
          enabled: true
          role: worker
          port: 8766  # unique port per worker
          capabilities: ["web_research", "data_extraction"]

This architecture enables high-throughput automation where research, writing, and publishing happen in parallel rather than sequentially.


Troubleshooting Common Issues

Browser won't launch on VPS:

export DISPLAY=:99
        Xvfb :99 -screen 0 1280x1024x24 &
        # Then retry

MCP server connection errors:

cd mcp-servers
        npm install  # Reinstall dependencies
        node filesystem/index.js  # Test server manually

Model API errors:

  • Verify your API key is correct in .env
  • Check OpenRouter account has credits
  • Try switching to a different model in config.yaml

Slow browser automation:

  • Set slow_mo: 0 in config.yaml
  • Ensure headless: true for VPS operation
  • Consider reducing screenshot_interval

Next Steps

Once you have OpenClaw running:

  1. Explore browser automation: Try automating a daily task you currently do manually in a browser
  2. Add MCP servers: Each MCP integration adds new capabilities
  3. Build task files: Create YAML task definitions for repeatable workflows
  4. Connect to n8n: Use OpenClaw as a component in larger n8n workflows
  5. Try ACP: Experiment with multi-agent coordination for complex tasks

OpenClaw's power compounds as you learn its capabilities. The browser control feature alone justifies the setup time — it unlocks automation scenarios that simply don't exist with API-only agents.


Published on ai.quantummerlin.com — Your source for practical AI agent intelligence