GreenVPN

OpenClaw on WSL2: Run Your AI Lobster on Windows in 15 Minutes

February 26, 2026 · AI Tools

Windows users who want to run OpenClaw—the open-source personal AI assistant that talks to Claude, GPT-4o, or Gemini via Telegram, Discord, and WhatsApp—have one officially recommended path: WSL2. The Windows Subsystem for Linux gives you a real Linux environment inside Windows, so you can use the same one-line installer and commands that Mac and Linux users run. This guide walks you through installing OpenClaw on WSL2 in about 15 minutes, from enabling systemd to sending your first AI message.

1 Install WSL2 and Ubuntu

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

wsl --install -d Ubuntu-24.04

If WSL is not yet installed, this command installs it and downloads Ubuntu 24.04. You may be prompted to reboot. After reboot, Ubuntu will launch and ask you to create a username and password. Remember these—you will use them for sudo commands. Once the Ubuntu terminal is ready, you are inside a real Linux environment. All subsequent steps run inside this WSL2 Ubuntu shell.

2 Enable systemd (Required for OpenClaw Gateway)

OpenClaw runs a gateway service that needs systemd. By default, WSL2 does not start systemd. Enable it by creating a config file:

printf '[boot]\nsystemd=true\n' | sudo tee /etc/wsl.conf

Then, from PowerShell (or Windows Command Prompt), shut down WSL so the change takes effect:

wsl --shutdown

Reopen Ubuntu from the Start menu. Systemd should now be running. You can verify with systemctl --version.

3 Install OpenClaw via One-Line Installer

Inside your Ubuntu terminal, run the official OpenClaw installer:

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

The script installs Node.js 22 if needed, then installs OpenClaw globally. When it finishes, run openclaw --version to confirm. If the command is not found, the script may have installed to a path not in your PATH; check the output for instructions, or run npx openclaw as a fallback. Important: Work in your Linux home directory (~/), not in /mnt/c/. Accessing Windows filesystem from WSL is 10–50x slower and can cause timeouts during install or when OpenClaw reads files.

4 Run the Onboarding Wizard

Configure your AI provider and messaging channel:

openclaw onboard --install-daemon

The wizard will ask you to choose a model (Claude, OpenAI, Google Gemini, or local Ollama), enter your API key, and add a channel like Telegram or Discord. For Telegram: create a bot with @BotFather, copy the token, paste it when prompted, then open a chat with your bot and complete the pairing step. Use --install-daemon so OpenClaw installs a systemd user service that starts automatically when you log in. If your network blocks AI APIs, connect your Windows machine to a fast VPN before onboarding so the agent can reach Claude or OpenAI reliably.

5 Optional: Expose OpenClaw to Your LAN

By default, OpenClaw listens only inside WSL. To access it from another device on your network (e.g., your phone), use Windows port forwarding. In PowerShell as Administrator:

# Get WSL IP (replace Ubuntu-24.04 if you use a different distro)
$WslIp = (wsl -d Ubuntu-24.04 -- hostname -I).Trim().Split(" ")[0]
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=3000 connectaddress=$WslIp connectport=3000

Adjust the port if your OpenClaw gateway uses a different one. You may also need to allow the port in Windows Firewall.

WSL2 Performance Tips

Create C:\Users\YourUsername\.wslconfig to give WSL2 more RAM and CPUs (e.g., memory=8GB, processors=4, swap=2GB), then run wsl --shutdown and restart Ubuntu. Keep your OpenClaw data and config in ~/.openclaw inside WSL—never in /mnt/c/. If cron jobs or heartbeats skip, note that Windows sleep suspends WSL2; disable sleep or run OpenClaw on an always-on server. For stable API access from restricted regions, a VPN with gigabit bandwidth keeps your lobster responsive around the clock.

GreenVPN: Keep Your OpenClaw Connected From Anywhere

OpenClaw needs reliable access to Claude, OpenAI, and Telegram APIs. GreenVPN delivers 1000Mbps gigabit bandwidth, 70+ global server locations, and 10+ years of stable operation so your WSL2 AI agent stays fast whether you are at home, in the office, or traveling.

  • ✅ 1000Mbps — no lag for API calls or messaging
  • ✅ 70+ countries — low latency to AI providers worldwide
  • ✅ From $1.5/month — affordable for power users
  • ✅ 30-day money-back guarantee — try risk-free
  • ✅ Windows, Mac, Linux — one account everywhere
  • ✅ 10+ years stable — trusted by developers globally
Start Free Trial — From $1.5/mo

FAQ

Why WSL2 instead of native Windows?

OpenClaw is built for Unix-like environments. WSL2 gives you a full Linux kernel and the same install flow as Mac and Linux users. Native Windows support exists via npm, but WSL2 is the officially recommended path for the smoothest experience and systemd-based daemon.

Does OpenClaw keep running when I close the Ubuntu window?

With --install-daemon, OpenClaw runs as a background service. WSL2 stays alive as long as Windows is running. If Windows goes to sleep, WSL2 suspends too—consider disabling sleep for 24/7 use or running OpenClaw on a dedicated server.

70+ Global Nodes · 10 Years Stable
Try GreenVPN Free