India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Türkiye Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Canada English
Canada Français
Somalia English
Netherlands Nederlands

How to Set Up and Run OpenClaw on WSL

Buy domains, business emails, hosting, VPS and more: Get Started

OpenClaw has become one of the most talked-about AI agent platforms since it launched as Clawdbot in late 2025, before rebranding.

It lets you run an AI agent on your own hardware, connect it to your preferred AI model, and interact with it through messaging apps like WhatsApp, Telegram, Discord, and Slack.

So, OpenClaw was built for Linux. You can try running it directly on Windows through PowerShell, but you’ll run into frustrating differences in file paths, shell behavior, and service management.

That’s why the OpenClaw community and official documentation point to WSL2 as the most reliable way to run OpenClaw on Windows.

WSL2 gives you a real Linux kernel running inside Windows, so systemd, Linux file paths, and background services behave exactly as they should.

This guide is for Windows users who are comfortable with basic terminal commands and want to set up OpenClaw properly on their machine.

You’ll learn how to install WSL2, set up Ubuntu, deploy OpenClaw, and get it running in the background so your agent stays online even after you close the terminal.

What You Need to Get Started

  • Operating System: Windows 10 Build 19041, or any version of Windows 11. Check by pressing Win + R, typing winver, and pressing Enter.
  • RAM: 4 GB is the technical minimum, and 8 GB is the comfortable baseline for everyday use. If you plan to run a local model through Ollama alongside OpenClaw, 16 GB is the practical floor.
  • Storage: WSL2, Ubuntu, Node.js, and OpenClaw’s dependencies together consume roughly 3-4 GB. Reserve at least 4 GB before you begin, and 10 GB if you expect to expand your setup later.
  • Virtualization: WSL2 requires hardware virtualization to be enabled in the BIOS. Look for Intel VT-x, AMD-V, or SVM Mode. Most modern machines have it on by default, but it’s the one setting that consistently trips up first-time users.
  • Internet connection: OpenClaw pulls several large AI-related dependencies during install. A stable connection counts more at this step than any other.
  • API key: You’ll need one from Anthropic, OpenAI, Google, or MiniMax before starting. The onboarding wizard will ask for it and cannot complete without one.
  • Windows Terminal (optional but recommended): Install it from the Microsoft Store for a tabbed interface, proper Unicode rendering, and easy switching between PowerShell and Ubuntu.

Set Up and Run OpenClaw on WSL in 6 Steps

openclaw on wsl - openclaw

Step 1: Install WSL2 and Ubuntu

Open PowerShell as Administrator. Right-click the Start menu and select Terminal (Admin) or Windows PowerShell (Admin). Then run:

powershell
wsl --install

That command enables the necessary Windows features, installs the WSL2 Linux kernel, and downloads Ubuntu.

When it finishes, restart your PC. The kernel components genuinely do not load until after a reboot, so don’t skip it.

After restarting, Ubuntu will launch on its own and ask you to create a username and password.

Your UNIX username has nothing to do with your Windows login, so pick whatever you like.

Choose a password you’ll remember. Ubuntu asks for it every time you use sudo, and recovering it means reinstalling the whole distribution.

Once setup is done, confirm you’re on WSL2 and not WSL1 by running:

powershell
wsl --list --verbose

You should see VERSION 2 next to Ubuntu. If it says 1, run:

powershell
wsl --set-default-version 2
wsl --set-version Ubuntu 2

Then reopen Ubuntu. This distinction counts: WSL1 translates Linux system calls rather than running a real kernel, and several of OpenClaw’s dependencies won’t behave correctly under it.

Step 2: Configure WSL (Enable systemd, Set Resource Limits)

The OpenClaw Gateway relies on systemd to run as a background service. Since WSL doesn’t enable systemd by default, you need to turn it on before installing OpenClaw.

Inside your Ubuntu terminal, run:

bash
sudo tee /etc/wsl.conf >/dev/null <<'EOF'
[boot]
systemd=true
EOF

Next, return to PowerShell and restart WSL so the new setting applies:

powershell
wsl --shutdown

Open Ubuntu again. From this point forward, WSL will start with systemd enabled, giving the OpenClaw Gateway the Linux service management it needs to run reliably in the background.

Resource limits: A default WSL2 installation can quietly consume up to 80% of your system RAM if left unchecked.

Create a .wslconfig file in your Windows user folder (C:\Users\YourName) and set a memory cap; half your total RAM is a good rule of thumb.

For a 16 GB machine, that would be memory=8GB, with processors=2 and swap=2GB alongside it. Run wsl --shutdown in PowerShell to apply, then reopen Ubuntu.

Step 3: Install Node.js and OpenClaw

This step is where a lot of installations quietly go wrong.

Ubuntu’s built-in package repositories ship an outdated version of Node.js, sometimes as old as v12, and installing it without specifying a version will leave you with a runtime OpenClaw simply cannot use.

You need at least v22.19; v24 is recommended.

The cleanest approach is NVM, which lets you install the right version and switch between versions easily if you ever need to. In your Ubuntu terminal:

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

Close and reopen your terminal to activate NVM, then run:

bash
nvm install 24
nvm alias default 24

After that, node -v should confirm you’re on v24.

Now install OpenClaw. Run the official install script:

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

Or install it as a global npm package:

bash
npm install -g openclaw@latest

Both work. The install script is slightly more guided; the npm method will feel familiar if you’ve worked with Node.js before.

When the installer shows a security advisory, read it; it explains what the agent can do and what permissions it needs. Select QuickStart for safe, recommended defaults.

Step 4: Run Onboarding and Configure OpenClaw (model provider, API key, gateway)

Run the onboarding wizard to get OpenClaw configured:

bash
openclaw onboard

The wizard will ask which AI model to use.

Claude (Anthropic) is the strongest all-around choice for agent tasks; Gemini Flash is a good option if you want a free tier to experiment with first.

openclaw on wsl - Gemini

It’s better not to start with the most powerful model available. Claude Sonnet and Gemini Flash handle the vast majority of everyday tasks well, at a fraction of the cost of top-tier models.

You can always upgrade later.

Enter your API key when prompted. The wizard takes about two minutes from start to finish.

When it’s done, check that the Gateway is actually running:

bash
openclaw gateway status

If it reports as running, open http://localhost:18789 in your browser. Important: don’t just type localhost:18789 directly, you’ll get an “Unauthorized” message. Instead, run:

bash
openclaw dashboard

This opens the Control UI with a proper authentication token attached.

Step 5: Configure Windows Firewall

In the default NAT mode, WSL2 has its own IP address, and external network traffic can’t directly reach your WSL2 applications.

But if you switch to mirrored mode, WSL2 shares your Windows host’s network interface, and your OpenClaw service becomes directly accessible.

To use mirrored mode, create or edit .wslconfig in your Windows user folder (C:\Users\YourName):

ini
[wsl2]
networkingMode=mirrored
dnsTunneling=true
autoProxy=true
firewall=true

[experimental]
autoMemoryReclaim=gradual
hostAddressLoopback=true

Then run wsl --shutdown in PowerShell and reopen Ubuntu.

With mirrored mode, you need to configure Windows Firewall to allow traffic to OpenClaw’s port. Open PowerShell as Administrator and run:

powershell
New-NetFirewallRule -DisplayName "OpenClaw-Service" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 18789

Verify the rule was created:

powershell
Get-NetFirewallRule -DisplayName "OpenClaw-Service" | Format-Table

Test that the port is open:

powershell
Test-NetConnection -ComputerName localhost -Port 18789

Step 6: Set Up Browser Automation

OpenClaw uses Playwright for browser automation tasks. The installation script should have handled the browser dependencies, but you can verify and install them manually if needed.

Inside your Ubuntu terminal, run:

bash
npx playwright install
npx playwright install-deps

If you run into a Chrome sandbox error, the issue is typically related to how WSL handles the browser’s sandboxing mechanisms.

One common fix is to disable the sandbox by launching Chromium with the --no-sandbox flag.

However, be aware that this reduces security. The more robust approach is to ensure your WSL kernel supports the required user namespace features.

Test that browser automation works:

bash
npx playwright test

If the test fails, run openclaw doctor to diagnose configuration issues.

How to Troubleshoot Common Issues During Set Up

IssueFix
Network or DNS IssuesIf WSL can’t resolve hostnames, configure DNS tunneling in .wslconfig with dnsTunneling=true. After making changes, run wsl --shutdown and reopen Ubuntu. For VPN compatibility issues, mirrored networking mode helps.
Installation FailsRun the installer again with verbose output to monitor progress: curl -fsSL https://openclaw.ai/install.sh | bash -x. Also run openclaw doctor to diagnose configuration issues 
Systemd Not WorkingVerify /etc/wsl.conf contains systemd=true under the [boot] section. Run wsl --shutdown in PowerShell, then reopen Ubuntu. Check systemd status with systemctl status
Headless/Auto-Start IssuesRun sudo loginctl enable-linger "$(whoami)" to keep user services running even when no one is logged into Windows. Then install the gateway service with openclaw gateway install . For Windows startup automation, create a scheduled task: schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu --exec /bin/true" /sc onstart /ru SYSTEM
Browser Fails to Launch (Chrome Sandbox Error)Verify Playwright is installed: npx playwright install. If the sandbox error persists, you may need to disable the sandbox as a temporary workaround or ensure your WSL kernel supports user namespaces. Run openclaw doctor to check the browser configuration.
Web UI Shows “Gateway Disconnected”Check if the Gateway is running: openclaw gateway status. If it’s stopped, restart it: openclaw gateway start. View service logs: journalctl -u openclaw -n 50 . Also ensure you’re accessing the dashboard via openclaw dashboard rather than browsing to localhost:18789 directly.

OpenClaw on WSL FAQs

Can I run OpenClaw on Windows?

Can I run OpenClaw without a GPU?

Which Linux is best for OpenClaw?

What browser is best for OpenClaw?

Get Started with OpenClaw on Truehost

Running OpenClaw on your Windows machine through WSL is great for development, testing, and personal projects.

But if your agent needs to stay online 24/7, serving users around the clock, responding to messages while you’re asleep, keeping it on your personal PC has one big limitation: your computer has to be on.

With Truehost’s OpenClaw VPS Hosting, you get the same Linux-based environment OpenClaw was built for, but without relying on your personal machine.

We deliver dedicated virtual cores designed specifically to prevent headless browser slowness and script drops.

Our preconfigured OpenClaw environments come with Playwright browser frameworks, Python stack runtimes, and the OpenClaw orchestration engine ready out of the box.

Deployment takes under 45 seconds; you select your plan, the system spins up your VPS automatically, and you connect via SSH.

Plus, every plan comes with isolated vCPU time allocations, guaranteed physical memory segments, and built-in software firewalls with DDoS protection.

Carolyne Ndumia
Author

Carolyne Ndumia

SEO Content Writer Kenya

Carolyne Ndumia has always believed that the best content feels like a conversation. For the past four years, she has built a career around that idea as an SEO Content Writer and Marketer, helping blogs and brands communicate with warmth, clarity, and purpose. Her approach blends creative storytelling with practical strategy. Writing a blog post, editing a newsletter, or optimizing a web page for SEO, Carolyne's goal remains the same: to create content that connects with people and makes sense for search engines. She relies on trusted tools like SEMrush for keyword research and draws on years of editorial experience to craft copy that resonates. Carolyne is here to support your team with structured, creative content operations so you can relax knowing the details are taken care of.

View All Posts