How to Install WSL2, Ubuntu, Node.js, and OpenClaw on Windows
This guide walks you through installing WSL2 on Windows, adding the Ubuntu distribution, updating packages, installing Node.js, enabling systemd, and deploying OpenClaw with its gateway configuration for LAN access, providing all necessary commands and options for a fully functional development environment.
Install WSL2 and Ubuntu
Open a Command Prompt or PowerShell with administrator rights and run wsl --install. After the installation finishes, restart the machine. Then install the Ubuntu distribution with wsl --install -d Ubuntu. The Ubuntu shortcut appears in the Start menu.
Other useful commands: wsl --list --online to view available Linux distros and wsl --status to check the WSL installation state. Launch Ubuntu with wsl -d Ubuntu or via the Start menu.
Configure Ubuntu Environment
Once inside Ubuntu, update the package index and upgrade existing packages: sudo apt update && sudo apt upgrade -y Install Node.js 22:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejsEnable systemd support for WSL2 by creating /etc/wsl.conf with the following content:
sudo tee /etc/wsl.conf > /dev/null << 'EOF'
[boot]
systemd=true
EOFInstall and Configure OpenClaw
Run the OpenClaw installer script: curl -fsSL https://openclaw.ai/install.sh | bash The installer asks several yes/no questions; accept the defaults (gateway token, permission tightening, session directory, bash completion, gateway service). After installation, set the gateway to LAN mode so Windows browsers can reach the WSL2 gateway:
openclaw config set gateway.mode local openclaw config set gateway.bind lan openclaw gateway restartAI Software Product Manager
Daily updates of Xiaomi's latest AI internal materials
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
