How to Run OpenClaw on WSL2 (Windows)
Running OpenClaw on Windows requires WSL2 for optimal performance and compatibility. This comprehensive guide walks you through enabling WSL2, installing Ubuntu, configuring resource limits, and optimizing filesystem performance. You'll avoid common pitfalls like slow filesystem access and network bridging issues that plague most WSL2 setups.
Why This Is Hard to Do Yourself
These are the common pitfalls that trip people up.
WSL2 installation hurdles
Windows version requirements, BIOS virtualization, distro management
Network bridging issues
WSL2's NAT networking makes OpenClaw inaccessible from LAN without port forwarding
Filesystem performance
Running Node.js on Windows filesystem from WSL2 is 10x slower
Resource management
WSL2 can consume all available RAM without .wslconfig limits
Step-by-Step Guide
Enable WSL2 on Windows
# Run in PowerShell as Administrator:
wsl --install
# Restart your computerInstall Ubuntu on WSL2
wsl --install -d Ubuntu-22.04
# Set up your Linux username and passwordConfigure WSL2 resources
Create .wslconfig to limit RAM/CPU.
# Create C:\Users\YourUser\.wslconfig
[wsl2]
memory=8GB
processors=4
swap=2GBWarning: Without .wslconfig, WSL2 will use up to 80% of your system RAM, which can make Windows unresponsive.
Install Node.js in WSL2
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
node --versionClone and install OpenClaw (inside WSL2 filesystem)
# IMPORTANT: Work in the Linux filesystem, not /mnt/c/
cd ~
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm installWarning: Always clone into the Linux filesystem (~/), not the Windows mount (/mnt/c/). Running from the Windows filesystem is 10-50x slower.
Configure and start OpenClaw
cp .env.example .env
nano .env # Add your API keys
npm startAccess from Windows browser
# OpenClaw runs at localhost:3000 by default
# Access from Windows browser: http://localhost:3000
# For LAN access, set up port forwarding:
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=$(wsl hostname -I)WSL2 Setup Getting Complicated?
Windows + WSL2 + OpenClaw has a lot of moving parts. Our experts configure everything โ WSL2 resources, networking, filesystem optimization, and auto-start โ so you can focus on using OpenClaw, not debugging Windows.
Get matched with a specialist who can help.
Sign Up for Expert Help โ