# How to Set Up OpenClaw on Windows with WSL2 (Complete Guide)
*The easiest way to run OpenClaw on Windows is through WSL2. This step-by-step guide will have you up and running in under 30 minutes.*
## Why WSL2?
OpenClaw runs best on Linux/macOS, but Windows users aren’t left out. WSL2 (Windows Subsystem for Linux 2) gives you a full Linux environment inside Windows — no dual-booting required. It’s Microsoft’s official solution, and it works beautifully with OpenClaw.
## Prerequisites
Before we start, make sure you have:
– Windows 10 (version 2004 or higher) or Windows 11
– At least 8GB RAM (16GB recommended)
– Administrator access to your PC
## Step 1: Enable WSL2
Open PowerShell as Administrator and run:
“`powershell
wsl –install
“`
This single command:
– Enables the WSL feature
– Enables the Virtual Machine Platform
– Downloads and installs Ubuntu (default)
– Sets WSL2 as your default version
**Restart your computer** when prompted.
## Step 2: Set Up Ubuntu
After restarting, Ubuntu will launch automatically. You’ll be asked to:
1. Create a username (lowercase, no spaces)
2. Create a password (you’ll need this for sudo commands)
Once done, update your system:
“`bash
sudo apt update && sudo apt upgrade -y
“`
## Step 3: Install Node.js
OpenClaw requires Node.js 18 or higher. Install it using NodeSource:
“`bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash –
sudo apt install -y nodejs
“`
Verify the installation:
“`bash
node –version # Should show v20.x.x
npm –version # Should show 10.x.x
“`
## Step 4: Install OpenClaw
Now for the main event:
“`bash
npm install -g openclaw
“`
Verify it’s installed:
“`bash
openclaw –version
“`
## Step 5: Configure OpenClaw
Run the setup wizard:
“`bash
openclaw setup
“`
This will walk you through:
– Adding your Anthropic API key
– Configuring your default model
– Setting up any integrations (Discord, Telegram, etc.)
## Step 6: Start OpenClaw
Launch OpenClaw:
“`bash
openclaw
“`
Or start the gateway for always-on operation:
“`bash
openclaw gateway start
“`
## Pro Tips for Windows Users
### Access Windows Files from WSL
Your Windows drives are mounted under `/mnt/`:
– C: drive → `/mnt/c/`
– D: drive → `/mnt/d/`
Example:
“`bash
cd /mnt/c/Users/YourName/Documents
“`
### Use Windows Terminal
Windows Terminal is way better than the default console. Install it from the Microsoft Store for:
– Multiple tabs
– Better fonts and colors
– Easy switching between PowerShell, CMD, and WSL
### Set WSL as Default in VS Code
If you use VS Code, install the “WSL” extension. Then you can:
1. Open VS Code
2. Press `Ctrl+Shift+P`
3. Type “WSL: New Window”
4. Work directly in your Linux environment
### Increase WSL Memory (If Needed)
By default, WSL2 can use up to 50% of your RAM. To adjust this, create a file at `C:\Users\YourName\.wslconfig`:
“`ini
[wsl2]
memory=8GB
processors=4
“`
Then restart WSL:
“`powershell
wsl –shutdown
“`
## Troubleshooting
### “WSL 2 requires an update to its kernel component”
Download and install the WSL2 kernel update from Microsoft:
https://aka.ms/wsl2kernel
### “The virtual machine could not be started”
Enable virtualization in your BIOS:
1. Restart and enter BIOS (usually F2, F12, or Del)
2. Find “Virtualization Technology” or “Intel VT-x” / “AMD-V”
3. Enable it and save
### Permission Denied Errors
Make sure you’re not running OpenClaw from a Windows directory. Stay in your Linux home folder:
“`bash
cd ~
openclaw
“`
## What’s Next?
Now that OpenClaw is running, check out:
– [How to Connect OpenClaw to Discord](/discord-setup)
– [Setting Up Voice with ElevenLabs](/voice-setup)
– [Your First OpenClaw Automation](/first-automation)
—
*Need more help? Grab our complete ebook “How to Open Claw for Dummies” — it covers everything from basic setup to advanced automations.*
**[Get the Ebook →](https://howtoopenclawfordummies.com)**