M
MeshWorld.
OpenClaw Install Self-Hosted Ubuntu macOS Windows AI Node.js Tutorial 6 min read

How to Install OpenClaw on Ubuntu, macOS, and Windows (2026 Guide)

By Vishnu Damwala

I’d tried to install AutoGPT three times. Each time I got about halfway through before hitting a dependency conflict, a missing config key, or a cryptic Python error that Stack Overflow couldn’t solve. I gave up.

OpenClaw took me eight minutes.

This guide covers everything from a fresh machine to a running agent — on Ubuntu, macOS, and Windows. Pick your platform and follow the steps.


Prerequisites (All Platforms)

Before anything else, you need:

  1. Node.js 20 or higher — OpenClaw is built in TypeScript and runs on Node
  2. Git — to pull updates later
  3. An LLM API key — Claude (Anthropic) or GPT-4o (OpenAI) both work. Get one before you start.

That’s it. No Docker required, no Python environment, no virtual environments.


Ubuntu / Debian

Step 1 — Install Node.js via nvm

Using nvm (Node Version Manager) is the recommended approach — it lets you switch Node versions without affecting system packages.

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# Reload your shell
source ~/.bashrc

# Install Node 20 (LTS)
nvm install 20
nvm use 20

# Verify
node --version   # should print v20.x.x
npm --version

Step 2 — Install OpenClaw

npm install -g openclaw

This installs the openclaw CLI globally. Give it a minute — it pulls a few dependencies.

Step 3 — Run the setup wizard

openclaw init

You’ll be walked through a short wizard (more on what each prompt means in the Init Walkthrough section below).

Step 4 — Firewall note

If you’re running on a server or a machine with ufw active, OpenClaw uses a local port (default 3000) for its gateway. If you want to access it remotely:

sudo ufw allow 3000/tcp

For local-only use, no firewall changes are needed.


macOS

Step 1 — Install Node.js via Homebrew

# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node 20
brew install node@20

# Add to PATH (Apple Silicon)
echo 'export PATH="/opt/homebrew/opt/node@20/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# Verify
node --version

Step 2 — Install OpenClaw

npm install -g openclaw

Step 3 — Run the setup wizard

openclaw init

macOS-specific note (v2026.3.8): The onboarding wizard now includes a Remote Gateway Token field. This is for connecting to OpenClaw from mobile (iOS) or a remote interface. You can leave it blank during initial setup and add it later in the config.


Windows

  1. Download and install nvm-windows — grab the .exe installer
  2. Open a new PowerShell or Command Prompt window (important — nvm needs a fresh session)
  3. Install Node:
nvm install 20
nvm use 20
node --version
  1. Install OpenClaw:
npm install -g openclaw
openclaw init

Option B — WSL2 (for a Linux-like experience)

If you’re comfortable with WSL2, install Ubuntu via the Microsoft Store and follow the Ubuntu steps above. This is the path most developers prefer on Windows — you get the full Linux toolchain.


The Init Walkthrough

When you run openclaw init, you’ll see something like this:

? Agent name: myagent
? LLM provider: (Claude / OpenAI / DeepSeek / Grok)
? API key: sk-ant-...
? Messaging platform (optional): Telegram
? Enable heartbeat scheduler? Yes
? Heartbeat interval: 0 8 * * *  (daily at 8am)

Here’s what each prompt actually means:

PromptWhat it does
Agent nameNames the directory where memory is stored: ~/.openclaw/agents/yourname/
LLM providerWhich AI brain to use. Claude is recommended for reasoning tasks.
API keyYour API key for the chosen provider. Stored locally in your config.
Messaging platformWhich chat app your agent will live in. Telegram is the easiest to start with.
Heartbeat schedulerWhether the agent runs autonomously on a schedule (cron syntax).

After init completes, your config lives at ~/.openclaw/config.yaml.


Podman and SELinux Users (Fedora / RHEL)

If you’re running OpenClaw on Fedora, RHEL, or any system with SELinux enforcing, you may have previously hit EACCES errors with bind mounts.

v2026.3.8 fixes this automatically. OpenClaw now detects if SELinux is in enforcing mode and applies :Z relabeling to bind mounts without any manual configuration needed.

If you’re upgrading from an older version and had a workaround in place, you can remove it.


First Run

Once init is complete:

openclaw start

You’ll see the OpenClaw TUI (terminal UI) start up. If you connected Telegram, send your bot a message: Hello. You should get a response within a few seconds.

That response means:

  • OpenClaw is running
  • Your LLM API key is valid
  • The messaging integration is connected
  • Memory is being written to ~/.openclaw/agents/yourname/memory/

You’re up.


Troubleshooting: 5 Common First-Run Errors

1. command not found: openclaw npm’s global bin isn’t in your PATH. Fix:

export PATH="$(npm root -g)/../bin:$PATH"
# Add this line to your ~/.bashrc or ~/.zshrc

2. Error: API key invalid Double-check your key has no extra whitespace. If using Claude, make sure you’re using an API key from console.anthropic.com, not a Claude.ai subscription key (different thing).

3. EACCES: permission denied on install Don’t use sudo npm install -g. Instead, fix npm’s global directory:

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATH

4. Telegram: bot not responding Make sure you started a conversation with your bot first — Telegram bots can’t initiate contact. Send /start to your bot in Telegram, then try messaging.

5. Node version mismatch OpenClaw requires Node 20+. Check: node --version. If it shows v18 or lower, run nvm use 20.


What’s Next

You’re installed and running. Now build something:

OpenClaw Tutorial: Build Your First AI Agent in 15 Minutes

Or go back to understand what you just installed:

What Is OpenClaw? The Self-Hosted AI Agent Everyone Is Talking About