< Return_To_Databank()
OPENCLAW
Mar 02, 2026

Deploy WSL + OpenClaw on Windows: A Complete Beginner's Guide

Author: YAER_SYSID: b84qd1xe

Who this is for: Windows users with no Linux experience.
What you'll have at the end: OpenClaw running in the background, a Telegram bot you can chat with using Claude AI, and everything auto-starting on boot.
Time required: 30–45 minutes


Table of Contents

  1. What Is WSL and Why Do We Need It?
  2. Enable WSL2 and Install Ubuntu
  3. Update the System and Install Node.js
  4. Install OpenClaw
  5. Configure OpenClaw (Onboarding Wizard)
  6. Connect Telegram and Start Chatting
  7. Bonus: Auto-Start on Windows Boot
  8. Quick Reference

1. What Is WSL and Why Do We Need It?

WSL2 (Windows Subsystem for Linux 2) lets you run a real Linux environment directly inside Windows — no virtual machine, no dual boot. It's fast, lightweight, and deeply integrated with the OS.

OpenClaw is an AI assistant platform designed primarily for Linux and macOS. While a native Windows version exists, the official documentation explicitly recommends WSL2:

"On Windows, we strongly recommend running OpenClaw under WSL2."

The reasons are simple: better stability, better compatibility, and an experience nearly identical to running it on a Mac or Linux machine.


2. Enable WSL2 and Install Ubuntu

Open PowerShell as Administrator

  1. Press Win + S and search for PowerShell
  2. Right-click the result and select Run as administrator

Run the Install Command

wsl --install

This single command will:

  • Enable the WSL feature
  • Enable the Virtual Machine Platform
  • Download and install Ubuntu (the default Linux distribution)

If you see an error saying the command isn't found, your Windows version may be too old. You need Windows 10 Build 19041 or newer. Check by pressing Win + R, typing winver, and pressing Enter.

Restart your computer when prompted.

Set Up Your Ubuntu Account

After the reboot, Ubuntu will launch automatically. It will ask you to create a user account:

Enter new UNIX username: neil
New password:
Retype new password:

Note: When typing your password, nothing will appear on screen. This is normal — just type it and press Enter.

Once you see a prompt like neil@DESKTOP:~$, you're inside Linux. ✅

To open Ubuntu in the future: Search for "Ubuntu" in the Start menu, or press Win + R and type wsl ~.


3. Update the System and Install Node.js

OpenClaw requires Node.js 22 or newer. The version bundled with Ubuntu is usually outdated, so we'll install it properly using nvm (Node Version Manager).

Run the following commands one by one in the Ubuntu terminal:

Update System Packages

sudo apt update && sudo apt upgrade -y

This will ask for your password. Type it and press Enter (nothing shows on screen).

Install nvm

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

Reload Your Shell Config

source ~/.bashrc

Install Node.js 22

nvm install 22 && nvm use 22 && nvm alias default 22

Verify the Installation

node --version

You should see something like v22.x.x. ✅


4. Install OpenClaw

Run the official installer. The --no-onboard flag skips the automatic wizard so we can walk through it step by step in the next section.

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

Reload your environment after installation:

source ~/.bashrc

Verify that OpenClaw is installed:

openclaw --version

5. Configure OpenClaw (Onboarding Wizard)

Now we'll run the setup wizard. This is where you connect your Claude API key and configure your Telegram bot.

openclaw onboard --install-daemon

Work through each step below.


Step 5-1 — Choose Setup Mode

? Setup mode
  ❯ QuickStart (recommended defaults)
    Advanced (full control)

Select QuickStart and press Enter.


Step 5-2 — Set Up Your AI Provider (Claude)

? AI Provider
  ❯ Anthropic (Claude)
    OpenAI (GPT)
    Google (Gemini)
    Custom / Other

Select Anthropic (Claude) and press Enter.

The wizard will then ask for your API key:

? Anthropic API Key: ›

How to get your Claude API key:

  1. Go to https://console.anthropic.com/
  2. Sign up or log in
  3. Click API Keys in the left sidebar
  4. Click Create Key and copy the key (it starts with sk-ant-api03-...)

Paste the key into the terminal and press Enter.

The key may appear as *** or invisible — that's intentional. It was registered correctly.

Next, choose your default model:

? Default model
  ❯ claude-sonnet-4-6    (recommended — best balance of speed and cost)
    claude-opus-4-6      (most capable, higher cost)
    claude-haiku-4-5     (fastest, lowest cost)

Select claude-sonnet-4-6 unless you have a specific reason to choose otherwise.


Step 5-3 — Workspace Directory

? Workspace directory › ~/.openclaw/workspace

Press Enter to accept the default path.


Step 5-4 — Gateway Port

? Gateway port › 18789

Press Enter to keep the default.


Step 5-5 — Configure Telegram

The wizard will ask which channels you want to set up:

? Channels to configure (space = toggle, enter = confirm)
  ❯ ◯ Telegram
    ◯ WhatsApp
    ◯ Discord
    ...

Press Space to select Telegram, then press Enter.

Create a Telegram Bot

Before continuing, you need to create a bot in Telegram:

  1. Open Telegram and search for @BotFather (verify the blue checkmark)
  2. Start a chat and send /newbot
  3. Enter a display name for your bot (e.g. My AI Assistant)
  4. Enter a username — it must end in bot (e.g. myneil_ai_bot)
  5. BotFather will reply with a token that looks like this:
1234567890:ABCDEFabcdefGHIJKLMNOPQRSTUVWXYZ

Copy this token and paste it into the wizard:

? Telegram Bot Token: › 1234567890:ABCDEFabcdef...

Choose a DM Policy

? DM Policy
  ❯ pairing    (recommended — new users must be approved before chatting)
    allowlist  (only specific users can message the bot)
    open       (anyone can chat — not recommended)

Select pairing. This means if a stranger finds your bot, they can't use it without your approval.


Step 5-6 — Install as a System Service

? Install as system service (starts automatically)
  ❯ Yes
    No

Select Yes. This installs OpenClaw as a systemd background service so it starts automatically whenever WSL is running.


Step 5-7 — Wizard Complete

When the wizard finishes, you should see something like:

✓ Gateway is running at http://127.0.0.1:18789
✓ Telegram channel configured
✓ Daemon installed

Verify the gateway is running:

openclaw gateway status

You can also open the web dashboard in your browser:

openclaw dashboard

This opens http://127.0.0.1:18789 — a control panel where you can chat, manage settings, and monitor the service.


6. Connect Telegram and Start Chatting

The gateway is running and the bot is configured. Now let's link your Telegram account to it.

Send a Message to Your Bot

Open Telegram, search for your bot by the username you created (e.g. @myneil_ai_bot), and send any message — just say hi.

The bot will reply with a pairing code:

🔑 Pairing request received.
Your code: ABCD1234
This code expires in 1 hour.

Approve the Request in the Terminal

Back in your Ubuntu terminal, run:

# See pending requests
openclaw pairing list telegram

# Approve your request (replace ABCD1234 with your actual code)
openclaw pairing approve telegram ABCD1234

The bot will send a confirmation message in Telegram.

Test the Connection

Send your bot a message:

Hello! Who are you?

If Claude replies, you're all set. 🎉


7. Bonus: Auto-Start on Windows Boot

By default, you have to open an Ubuntu window for OpenClaw to start. This section configures Windows to launch WSL and start the OpenClaw service automatically every time you boot.

Option A — Task Scheduler (All Windows Versions)

Step 1: Create a startup script

Create a file at C:\openclaw-startup.bat with the following content:

@echo off
wsl -e bash -c "source ~/.bashrc && openclaw gateway start" > "%TEMP%\openclaw-startup.log" 2>&1

Step 2: Add it to Task Scheduler

  1. Press Win + R, type taskschd.msc, press Enter
  2. In the right panel, click Create Basic Task
  3. Name: OpenClaw Startup → click Next
  4. Trigger: When the computer starts → click Next
  5. Action: Start a program → click Next
  6. Program/script: C:\openclaw-startup.bat
  7. Click Finish
  8. Find the task in the list, right-click → Properties
  9. On the General tab, check Run with highest privileges
  10. Click OK

Step 3: Test it

Right-click the task → Run. Wait 10 seconds, then in Ubuntu:

openclaw gateway status

If it shows running, the setup is working. ✅


Option B — Startup Folder with Silent VBScript (Simpler)

Create a file named openclaw.vbs in your Startup folder:

C:\Users\YourName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\

Paste the following content:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "wsl -e bash -c ""source ~/.bashrc && openclaw gateway start""", 0, False
Set WshShell = Nothing

The 0 hides the terminal window. False means Windows won't wait for it to finish. The service starts silently in the background on every boot.


Security Checklist

Before you go, a few important reminders:

| ✅ Do | ❌ Don't |

| Keep your API key private | Share it in screenshots or chats | | Use pairing DM policy (default) | Set DM policy to open unless you know the risks | | Run openclaw update regularly | Let the version go stale | | Keep OpenClaw on localhost only | Expose port 18789 to the internet via your router |


8. Quick Reference

# Service management
openclaw gateway status       # Check if the service is running
openclaw gateway start        # Start the service
openclaw gateway stop         # Stop the service
openclaw gateway restart      # Restart the service

# Telegram pairing
openclaw pairing list telegram          # View pending approval requests
openclaw pairing approve telegram CODE  # Approve a pairing request

# Configuration & maintenance
openclaw dashboard            # Open the browser control panel
openclaw configure            # Change settings without re-running the wizard
openclaw update               # Update OpenClaw to the latest version

Appendix: One-Click Setup Script (Steps 2–4)

Save the script below as setup-openclaw.sh and run it in your Ubuntu terminal:

bash setup-openclaw.sh
#!/usr/bin/env bash
# ============================================================
# OpenClaw WSL Setup Script
# Covers: system update → Node.js 22 → OpenClaw install
# Does NOT run the onboarding wizard (do that manually after)
# ============================================================

set -e

CYAN='\033[0;36m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'

step() { echo -e "\n${CYAN}▶  $1${NC}"; }
ok()   { echo -e "${GREEN}✓  $1${NC}"; }
warn() { echo -e "${YELLOW}⚠  $1${NC}"; }
fail() { echo -e "${RED}✗  $1${NC}"; exit 1; }

echo -e "${CYAN}"
cat << 'BANNER'
╔══════════════════════════════════════════════╗
║       OpenClaw WSL Setup Script             ║
║       System → Node.js 22 → OpenClaw        ║
╚══════════════════════════════════════════════╝
BANNER
echo -e "${NC}"

# ── 1. Check environment ──────────────────────
step "Checking environment"
grep -qi microsoft /proc/version 2>/dev/null \
  && ok "WSL environment detected" \
  || warn "WSL not detected — continuing anyway (native Linux is fine)"

# ── 2. Update system packages ─────────────────
step "Updating system packages (requires your sudo password)"
sudo apt-get update -qq && sudo apt-get upgrade -y -qq
sudo apt-get install -y -qq curl git build-essential
ok "System packages updated"

# ── 3. Install nvm ────────────────────────────
step "Installing nvm (Node Version Manager)"
export NVM_DIR="$HOME/.nvm"

if [ ! -d "$NVM_DIR" ]; then
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  ok "nvm installed"
else
  ok "nvm already installed — skipping"
fi

[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"

# Persist nvm in .bashrc if not already there
if ! grep -q 'NVM_DIR' "$HOME/.bashrc"; then
  cat >> "$HOME/.bashrc" << 'BASHRC'

# nvm — added by setup-openclaw.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
BASHRC
  ok ".bashrc updated with nvm config"
fi

# ── 4. Install Node.js 22 ─────────────────────
step "Installing Node.js 22 LTS"
nvm install 22 --silent
nvm use 22
nvm alias default 22

NODE_VER=$(node --version)
NODE_MAJOR=$(echo "$NODE_VER" | tr -d 'v' | cut -d. -f1)
[ "$NODE_MAJOR" -lt 22 ] && fail "Node.js version too old — need 22+, got $NODE_VER"
ok "Node.js installed: $NODE_VER"

# ── 5. Install OpenClaw ───────────────────────
step "Installing OpenClaw"

if command -v openclaw &>/dev/null; then
  warn "OpenClaw already installed — running update"
  npm update -g openclaw --silent
else
  curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
fi

source "$HOME/.bashrc"
ok "OpenClaw installed"

# ── Done ──────────────────────────────────────
echo ""
echo -e "${GREEN}╔══════════════════════════════════════════════╗"
echo -e "║          🎉  Installation complete!         ║"
echo -e "╚══════════════════════════════════════════════╝${NC}"
echo ""
echo "Next: run the onboarding wizard to configure Claude and Telegram."
echo ""
echo -e "  ${CYAN}openclaw onboard --install-daemon${NC}"
echo ""
echo "You will need:"
echo "  1. A Claude API key  →  https://console.anthropic.com/"
echo "  2. A Telegram Bot token  →  get one from @BotFather in Telegram"
echo ""
warn "Keep your API key private — never share it or commit it to Git."
echo ""

END OF TRANSMISSION.[< />]