# How to Install OpenClaw on Windows: The Complete WSL2 Setup Guide

Canonical: https://clawdocx.com/blog/openclaw-windows-wsl2-setup-guide
Author: Sam Okafor
Published: 2026-03-09
Updated: 2026-03-09

> A step-by-step guide to installing OpenClaw on Windows using WSL2, from enabling WSL2 to your first agent conversation. No prior Linux experience required.

## OpenClaw on Windows: Yes, It Works

OpenClaw was built on macOS and Linux, and most of the community runs it there. But Windows is fully supported — you just need to know the right path.

That path is **WSL2** (Windows Subsystem for Linux). WSL2 gives you a real Linux environment running inside Windows, with full access to the Windows filesystem and near-native performance. OpenClaw runs inside WSL2 exactly the same way it runs on a native Linux machine.

This guide takes you from a fresh Windows installation to a working OpenClaw agent. No prior Linux experience needed.

## Why WSL2 (and Not Native Windows)?

OpenClaw technically has a PowerShell installer, but the official recommendation — and what actually works reliably — is WSL2. Here is why:

- **Shell compatibility**: OpenClaw's tools and skills assume a Unix-like shell (bash/zsh). Many commands, scripts, and skills simply do not work in PowerShell or CMD.
- **Node.js behavior**: Some Node.js packages that OpenClaw depends on behave differently on native Windows (path separators, file permissions, signal handling). WSL2 eliminates these issues.
- **Tool ecosystem**: Most OpenClaw skills expect Unix tools (curl, git, ssh, grep). WSL2 provides all of these natively.
- **Community support**: When you ask for help in the OpenClaw Discord, most answers assume a Unix environment. Running WSL2 means those answers work for you.

The good news: WSL2 is not a compromise. It is a full Linux system with excellent performance and seamless Windows integration. You can access your Windows files from WSL2 and vice versa.

## Step 1: Enable WSL2

Open PowerShell as Administrator (right-click the Start menu → Terminal (Admin)) and run:

```powershell
wsl --install
```

This command:
- Enables the required Windows features
- Installs the WSL2 kernel
- Downloads and installs Ubuntu (the default distribution)

When it finishes, **restart your computer**.

After restarting, Ubuntu will open automatically and ask you to create a username and password. These are for your Linux environment — they do not need to match your Windows credentials.

> **Already have WSL1?** Upgrade to WSL2 with `wsl --set-default-version 2`. WSL1 will work but is slower and has compatibility issues.

## Step 2: Update Your Linux Environment

Open your Ubuntu terminal (search for "Ubuntu" in the Start menu) and run:

```bash
sudo apt update && sudo apt upgrade -y
```

This ensures your Linux packages are current. It might take a minute or two.

## Step 3: Install Node.js 22+

OpenClaw requires Node.js 22 or newer. The easiest way to install it in WSL2:

```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
```

Verify the installation:

```bash
node --version  # Should show v22.x.x or higher
npm --version   # Should show 10.x.x or higher
```

> **Alternative**: If you prefer version management, install [nvm](https://github.com/nvm-sh/nvm) first, then run `nvm install 22`.

## Step 4: Install OpenClaw

Now the straightforward part. Run the official installer:

```bash
curl -fsSL https://openclaw.ai/install.sh | bash
```

This script will:
1. Detect your Node.js installation
2. Install the OpenClaw CLI globally via npm
3. Launch the onboarding wizard

### The Onboarding Wizard

The wizard walks you through:

1. **API key setup**: You need at least one AI model provider. The wizard supports:
   - **Anthropic** (Claude) — recommended for best agent performance
   - **OpenAI** (GPT models) — widely available
   - **Google** (Gemini) — good free tier
   - **Ollama** (local models) — free, runs on your hardware. See our [Ollama guide](/blog/openclaw-ollama-free-local-setup).

2. **Messaging channel**: How you will talk to your agent. Telegram is the most popular choice — see our [Telegram setup guide](/blog/connect-openclaw-telegram-setup). You can also skip this and use the terminal initially.

3. **Daemon installation**: The wizard can set up OpenClaw to run as a background service that starts automatically.

## Step 5: Start the Gateway

If the wizard set up the daemon, OpenClaw is already running. Check with:

```bash
openclaw status
```

If you need to start it manually:

```bash
openclaw gateway
```

You should see output confirming the gateway is running and any configured channels are connected.

## Step 6: Talk to Your Agent

If you configured a messaging channel (Telegram, Discord, etc.), message your agent there.

If you did not set up a channel yet, you can talk to your agent directly from the terminal:

```bash
openclaw chat
```

Try sending something like "Hello, what can you do?" to verify everything is working.

## Windows-Specific Configuration

### Accessing Windows Files from WSL2

Your Windows drives are mounted under `/mnt/` in WSL2:

```bash
ls /mnt/c/Users/YourName/Documents
```

If you want your agent to work with files on your Windows filesystem, you can either:
- Reference them directly via `/mnt/c/...` paths
- Create symbolic links in your workspace: `ln -s /mnt/c/Users/YourName/Documents ~/documents`

> **Performance note**: File operations on `/mnt/c/` are slower than operations within the WSL2 filesystem. For best performance, keep your OpenClaw workspace inside WSL2 (the default `~/.openclaw/workspace/`).

### Starting WSL2 Automatically at Boot

If you want OpenClaw to run 24/7, WSL2 needs to start when Windows boots. Create a scheduled task:

1. Open Task Scheduler (search in Start menu)
2. Click "Create Basic Task"
3. Name it "Start WSL2"
4. Trigger: "When the computer starts"
5. Action: "Start a program"
6. Program: `wsl`
7. Arguments: `-d Ubuntu -- bash -c "openclaw gateway &"`

Alternatively, add this to your Windows startup folder:

```bat
wsl -d Ubuntu -- bash -c "nohup openclaw gateway > /dev/null 2>&1 &"
```

### Windows Terminal Integration

Windows Terminal (the modern terminal app) is the best way to interact with WSL2. It supports multiple tabs, custom profiles, and good Unicode rendering.

To create a dedicated OpenClaw profile:
1. Open Windows Terminal Settings
2. Add a new profile
3. Set the command line to: `wsl -d Ubuntu`
4. Optional: set a custom icon and name

### Firewall Considerations

If your OpenClaw agent needs to receive incoming connections (for example, webhook-based channel integrations), you may need to add a Windows Firewall rule:

```powershell
# Run in PowerShell as Admin
New-NetFirewallRule -DisplayName "OpenClaw Gateway" -Direction Inbound -LocalPort 3456 -Protocol TCP -Action Allow
```

Most users do not need this — Telegram and Discord use outbound connections that work without firewall changes.

## Running Local Models on Windows

If you have an NVIDIA GPU, you can run local language models through Ollama inside WSL2 with GPU acceleration:

```bash
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2
```

NVIDIA's CUDA drivers pass through to WSL2 automatically on recent Windows versions. Verify GPU access with:

```bash
nvidia-smi
```

If this shows your GPU, Ollama will automatically use it for inference. For a complete local model setup, see our [Ollama guide](/blog/openclaw-ollama-free-local-setup).

> **NVIDIA published an [official guide](https://www.nvidia.com/en-us/geforce/news/open-claw-rtx-gpu-dgx-spark-guide/)** for running OpenClaw on RTX GPUs that covers WSL2 + Ollama in detail.

## Troubleshooting

**"WSL2 requires an update to its kernel component":**
Run `wsl --update` in PowerShell as Admin, then restart.

**Node.js installation fails:**
If the NodeSource script fails, try installing Node.js directly: `sudo apt install nodejs npm`, then verify the version is 22+. If your distribution ships an older version, use nvm.

**OpenClaw cannot connect to the internet:**
WSL2 networking occasionally has DNS issues. Try:
```bash
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
```

**Slow file access on /mnt/c/:**
This is expected. WSL2 file access to Windows drives goes through a translation layer. Keep your workspace inside the WSL2 filesystem for best performance.

**Agent cannot find tools (git, curl, etc.):**
Install them: `sudo apt install -y git curl wget jq`

**"Permission denied" errors:**
Make sure your OpenClaw workspace has correct permissions: `chmod -R 755 ~/.openclaw/`

## Next Steps

Your OpenClaw agent is running on Windows. From here:

- [Connect to Telegram](/blog/connect-openclaw-telegram-setup) to message your agent from your phone
- [Customize your agent's personality](/blog/customize-openclaw-agent-identity-memory) with SOUL.md and IDENTITY.md
- [Set up automated cron jobs](/blog/openclaw-cron-automations) for recurring tasks
- [Run it for free with Ollama](/blog/openclaw-ollama-free-local-setup) if you have a capable GPU
- [Explore the best skills](/docs/top-20-skills) to extend your agent's capabilities

---

*Windows users are a growing part of the OpenClaw community. If you run into issues not covered here, the [OpenClaw Discord](https://discord.com/invite/clawd) has an active support channel where Windows-specific questions get answered quickly.*