AI & Agents Mar 4, 2026 · 7 min read

How to Set Up OpenClaw on Your Local Machine

OpenClaw is the fastest-growing open-source AI agent framework with 247,000+ GitHub stars. This guide walks you through installing it on macOS, Linux, or Windows — from zero to a running agent in under 15 minutes.

What is OpenClaw?

OpenClaw (originally ClawdBot, then Moltbot) is an open-source autonomous AI agent platform created by Peter Steinberger. It's part of the broader agentic AI revolution transforming how businesses operate. Unlike chatbots that only answer questions, OpenClaw agents run locally on your machine, connect to LLMs like Claude, GPT, or Gemini, and execute real tasks through messaging apps like Telegram, WhatsApp, Discord, Slack, and 20+ others.

Think of it as a team of AI employees that live on your computer, connected to your tools, working 24/7.

System Requirements

Before installing, make sure your machine meets these requirements:

Requirement Details
Operating System macOS 13+, any modern Linux, or Windows 10+ via WSL2
Node.js v22.12.0 or newer (required)
RAM 4 GB minimum recommended
Disk Space At least 5 GB free
Ports 18789 (Web UI) and 18790 (Bridge API) must be available
Network Internet connection required for installation and LLM APIs

Step 1: Install OpenClaw

OpenClaw offers three installation methods. The automated installer is recommended for most users.

Method A: Automated Installer (Recommended)

For macOS, Linux, or WSL2, run this single command:

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

For Windows (PowerShell):

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

The installer automatically detects your OS, checks Node.js compatibility, installs Node if missing, and launches the onboarding wizard.

Method B: Manual npm Install

If you already have Node.js 22+ installed:

npm install -g openclaw@latest
openclaw onboard --install-daemon

The --install-daemon flag registers OpenClaw as a background system service so it starts automatically on boot.

Method C: Build from Source

For contributors or those who want the absolute latest code from the official GitHub repository:

git clone https://github.com/openclaw/openclaw
cd openclaw
pnpm install
pnpm ui:build
pnpm build

Step 2: The Onboarding Wizard

After installation, the onboarding wizard walks you through initial configuration:

1. Choose Installation Mode

Select "QuickStart" for the fastest setup experience

2. Select Your LLM Provider

Anthropic Claude (best for complex tasks), OpenAI, Google Gemini, OpenRouter (multi-provider), or Ollama (fully local, no cloud)

3. Enter Your API Key

Create an API key from your chosen provider's dashboard and paste it into the terminal

4. Connect a Messaging Channel

Telegram, WhatsApp, Discord, Signal, Slack, iMessage, and 20+ more are supported

Step 3: Set Up a Telegram Bot (Example)

Telegram is the most popular channel for OpenClaw. Here's how to connect one:

  • Open Telegram and message @BotFather
  • Send /newbot and follow the prompts to name your bot
  • Copy the bot token BotFather gives you
  • Paste the token into the OpenClaw onboarding wizard when prompted

For Discord, enable the "Message Content" intent in the Discord Developer Portal and paste the bot token.

Step 4: Verify Your Installation

Run these commands to confirm everything is working:

openclaw doctor # Identifies configuration issues
openclaw status # Checks gateway functionality
openclaw dashboard # Opens the web UI in your browser
openclaw logs --follow # Real-time log streaming

The web dashboard is accessible at http://localhost:18789 by default.

Step 5: Configuration File

OpenClaw stores its configuration at ~/.openclaw/openclaw.json. A minimal working config looks like this:

{
  "agent": {
    "model": "anthropic/claude-opus-4-6"
  }
}

Key environment variables you can customize:

Variable Purpose
OPENCLAW_HOME Internal directory paths
OPENCLAW_STATE_DIR Mutable state location
OPENCLAW_CONFIG_PATH Configuration file path

Troubleshooting Common Issues

Problem Fix
openclaw: command not found Add npm global bin directory to your PATH
Gateway unresponsive Run openclaw gateway restart and verify API keys
Port 18789 in use Run sudo lsof -i :18789 to find the conflicting process
OOM during build (exit code 137) Create a 4 GB swap file or set NODE_OPTIONS="--max-old-space-size=4096"
Access denied errors Run openclaw pairing approve <channel> <code>

What's next?

Now that OpenClaw is running, you should secure your installation before connecting it to production tools. Read our OpenClaw Security Checklist to harden your setup, or go straight to our Docker isolation guide for maximum security.

Need Help Setting Up AI Agents?

At Codeloop, we deploy production-grade OpenClaw installations for businesses — configured, secured, and integrated with your existing tools. Want to manage multiple agents at scale? Learn how Paperclip orchestrates teams of OpenClaw agents with budgets and governance. To keep costs under control, check our guide on reducing AI token costs. We handle the technical setup so you can focus on what your agents should do.

Book a Free Consultation

Frequently Asked Questions

What are the minimum system requirements to run OpenClaw locally? +

You need macOS 13+, any modern Linux, or Windows 10+ via WSL2, along with Node.js v22.12.0 or newer, at least 4 GB of RAM, 5 GB of free disk space, and ports 18789 and 18790 available. An internet connection is required for installation and LLM API calls.

How long does it take to set up OpenClaw on a local machine? +

Using the automated installer, most users can go from zero to a running agent in under 15 minutes. The manual npm install is slightly faster if you already have Node.js 22+ installed. Building from source takes longer due to the compilation step.

What are the most common installation errors and how do I fix them? +

The most common issues are: "openclaw: command not found" (add npm global bin to your PATH), port 18789 already in use (run sudo lsof -i :18789 to find the conflict), gateway unresponsive (restart with openclaw gateway restart and verify API keys), and OOM exit code 137 during build (create a 4 GB swap file or set NODE_OPTIONS="--max-old-space-size=4096").

Should I run OpenClaw locally or in the cloud? +

Running locally keeps your data on your machine and gives you full control over the agent. Cloud deployments are better for always-on availability and team access. For production use, many teams run OpenClaw in a Docker container on a VPS for the best balance of control and uptime.

How do I update OpenClaw to the latest version? +

If you installed via npm, run npm install -g openclaw@latest to update. For source builds, pull the latest changes with git pull, then rebuild with pnpm install and pnpm build. Always check the release notes for breaking changes before updating, and back up your ~/.openclaw directory first.