OpenClaw LogoOpenClaw

Installing OpenClaw on Windows via WSL2

Complete guide to installing OpenClaw on Windows using WSL2. Step-by-step instructions for Ubuntu setup, Node.js, and hardware passthrough.

Complete guide to running OpenClaw on Windows using Windows Subsystem for Linux (WSL2). Includes Ubuntu setup, Node.js installation, and solutions for USB/Serial hardware passthrough.

Requirements

Prerequisites

  • Windows 10 version 2004+ or Windows 11
  • Administrator access
  • Stable internet connection
  • At least 10GB free disk space

Step 1: Enable WSL2 and Install Ubuntu

First, enable WSL2 on your Windows machine and install Ubuntu as your Linux distribution.

Open PowerShell as Administrator

Right-click the Start button and select "PowerShell (Admin)" or "Windows Terminal (Admin)".

# Enable WSL2
wsl --install

This command enables WSL2, installs Ubuntu, and updates your kernel automatically.

Restart Your Computer

After the installation completes, restart your computer to finalize the WSL2 setup.

Restart-Computer

Complete Ubuntu Setup

After restarting, Ubuntu will open automatically. Create a username and password when prompted.

Important: Remember your username and password! You'll need them for sudo commands.

Step 2: Update Ubuntu and Install Dependencies

Update your Ubuntu package manager and install essential build tools.

Update Package Lists

sudo apt update
sudo apt upgrade -y

Install Build Tools

sudo apt install -y build-essential curl git

This installs compilers, curl, and git needed for Node.js and OpenClaw.

Step 3: Install Node.js Using NVM

We recommend using Node Version Manager (NVM) for easy Node.js installation and version management.

Install NVM

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

Load NVM and Install Node.js

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 20
nvm use 20

✅ Verifies installation: node --version should show v20.x.x

Step 4: Install OpenClaw

With Node.js installed, you can now install OpenClaw globally on your WSL2 Ubuntu instance.

Install OpenClaw CLI

npm install -g @clawdbot/cli
clawdbot --version

Initialize OpenClaw

clawdbot init

Follow the prompts to configure your OpenClaw instance.

Start the OpenClaw Service

clawdbot start

✅ OpenClaw is now running on Windows!

USB/Serial Hardware Passthrough

If you're connecting hardware devices (like Gateways, sensors, or Arduino) to OpenClaw, you need to configure USB passthrough from Windows to WSL2.

Why This is Necessary

WSL2 runs in a virtual machine. Windows doesn't automatically forward USB devices to Linux. You need a bridge tool to access hardware from Ubuntu.

Microsoft's official USB over IP tool for WSL2. Best for most users.

Step A: Install usbipd-win (Windows PowerShell - Admin)

winget install usbipd

Step B: List attached USB devices (Windows PowerShell - Admin)

usbipd list

Step C: Attach device to WSL2 (Windows PowerShell - Admin)

usbipd bind --busid 1-1
usbipd attach --wsl --busid 1-1

Step D: Verify in WSL2 (Ubuntu)

lsusb

Your device should now appear in the list!

Option 2: Serial Port Forwarding

For simple serial devices, you can use TCP forwarding.

# In WSL2, access Windows serial ports via /dev/ttyS*
ls /dev/ttyS*

COM1 on Windows = /dev/ttyS0 in WSL2

Make USB Attachment Persistent

To automatically attach USB devices on WSL2 startup, create a startup script.

# Create PowerShell script: attach-usb.ps1
usbipd attach --wsl --busid 1-1

Add to Windows Task Scheduler to run at login.

Verify Your Installation

Run these commands to ensure everything is working correctly.

# Check if OpenClaw is running
clawdbot status
# Should show: "OpenClaw is running"

# Verify Node.js version
node --version
# Should show: v20.x.x or higher

# List available commands
clawdbot --help
# Should display all available commands

# Show configuration
clawdbot config list
# Should show your configuration

Windows-Specific Troubleshooting

Issue: WSL2 Can't Access Internet

Windows Firewall or VPN software may block WSL2 network access.

# In PowerShell (Admin), restart WSL network
wsl --shutdown
wsl

Issue: Node.js Commands Not Found

NVM may not be loaded in new terminal sessions.

# Add to ~/.bashrc
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"' >> ~/.bashrc
source ~/.bashrc

Issue: Slow File I/O Performance

Cross-platform file access (Windows/Linux) is slower in WSL2.

Solution: Keep project files inside WSL2 (~/) rather than /mnt/c/ for better performance.

Next Steps

Installation Complete!

OpenClaw is now running on your Windows machine via WSL2. Here's what to do next:

Need More Help?

If you encounter issues during installation, our community is here to help:

Join our Discord Server