How to Run OpenClaw on Windows with WSL2: The Complete Setup Guide
|6 min read
Table of Contents
Haven't installed OpenClaw yet?
curl -fsSL https://openclaw.ai/install.sh | bash
iwr -useb https://openclaw.ai/install.ps1 | iex
curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Worried it'll affect your machine? ClawTank — cloud deploy in 60s, zero risk to your files.
How to Run OpenClaw on Windows with WSL2: The Complete Setup Guide
OpenClaw is a local-first AI agent runtime built on Node.js and Unix tooling that does not exist natively on Windows. The Windows Subsystem for Linux (WSL2) bridges that gap, giving you a real Linux kernel inside Windows with near-native performance. This guide walks through every step from a fresh Windows installation to a fully working OpenClaw instance.
Why WSL2 and Not Native Windows?
OpenClaw depends on several components that assume a POSIX environment:
File system watchers use inotify, a Linux kernel feature[1]
Shell scripts in skills and plugins expect /bin/bash
Unix sockets are used for inter-process communication
Process management relies on signals like SIGTERM and SIGHUP
WSL2 solves this by running a genuine Linux kernel in a lightweight Hyper-V virtual machine. Unlike WSL1 (which used a translation layer), WSL2 eliminates compatibility issues with Node.js native modules and file watching entirely.
Prerequisites
Windows 10 version 2004+ (Build 19041) or Windows 11
At least 8 GB of RAM (16 GB recommended)
Virtualization enabled in BIOS/UEFI (Intel VT-x or AMD-V)
An API key for at least one LLM provider (OpenAI, Anthropic, etc.)
Step 1: Install WSL2
Open PowerShell as Administrator:
wsl --install
This enables the necessary features, sets WSL2 as default, and installs Ubuntu[2]. Restart your computer when prompted. After reboot, Ubuntu will ask you to create a username and password.
Verify you are running WSL2:
wsl --list --verbose
The VERSION column must show 2. If it shows 1, convert with wsl --set-version Ubuntu 2.
The onboarding wizard creates ~/.openclaw/, generates a default openclaw.json, prompts for your LLM API key, and starts the gateway. Your configuration lives at:
Deploy your own AI assistant
ClawTank deploys OpenClaw for you — no servers, no Docker, no SSH. Free 14-day trial included.
Modern WSL2 builds share the network namespace with Windows. When OpenClaw starts on localhost:19090 inside WSL, open your Windows browser and navigate to:
http://localhost:19090
If localhost forwarding does not work (older WSL2 builds), find your WSL IP with hostname -I | awk '{print $1}' and use that IP directly.
Step 7: LAN Access with Port Proxy
To access OpenClaw from other devices on your network, forward the port in PowerShell as Administrator:
Some OpenClaw skills require Docker. You have two options.
Option A: Docker Desktop -- Install Docker Desktop for Windows[4], ensure "Use the WSL 2 based engine" is checked, and enable WSL integration for Ubuntu in Settings > Resources.
Option B: Docker Engine in WSL (no licensing restrictions):
Keep files on the Linux file system. File I/O on /home/ is 5-10x faster than on /mnt/c/[5]. Always keep OpenClaw's working directories on the Linux side.
Tune memory. Create %UserProfile%\.wslconfig on the Windows side:
In Task Scheduler (taskschd.msc), create a task that runs at startup with a 30-second delay, set to run whether or not the user is logged on. Alternatively, use a systemd service inside WSL (see our systemd guide).
Common WSL2 Issues
DNS failures: If apt or curl cannot resolve hosts:
sudo rm /etc/resolv.conf
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
Clock skew after sleep: TLS failures caused by drifted time:
sudo hwclock -s
High Vmmem memory: Configure limits in .wslconfig as shown above, or drop caches:
sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
Networking broken after Windows update:
wsl --shutdown
netsh winsock reset
netsh int ip reset
Managed Alternative
If you prefer to skip WSL setup entirely, ClawTank provides hosted OpenClaw instances with a web dashboard, isolated containers, auto-TLS, and persistent storage.
Summary
Install WSL2 with wsl --install
Enable systemd for service management
Install Node.js 22 via NodeSource or nvm
Run openclaw onboard to configure your instance
Access the dashboard at localhost:19090 from Windows
Optionally configure LAN access with port proxy
Set up auto-start with Task Scheduler or systemd
WSL2 gives you the full Linux-native OpenClaw experience on Windows without dual-booting or virtual machine overhead.