Installing Clawdbot on Windows via WSL2
Complete guide to running Clawdbot on Windows using Windows Subsystem for Linux (WSL2). Includes Ubuntu setup, Node.js installation, and solutions for USB/Serial hardware passthrough.
Requirements
- • Windows 10 version 2004+ or Windows 11
- • Administrator access
- • Stable internet connection
- • At least 10GB free disk space
Enable WSL2 and Install Ubuntu
First, enable WSL2 on your Windows machine and install Ubuntu as your Linux distribution.
Open PowerShell as Administrator
Right-click the Start button and select "PowerShell (Admin)" or "Windows Terminal (Admin)".
# Enable WSL2
wsl --installThis command enables WSL2, installs Ubuntu, and updates your kernel automatically.
Restart Your Computer
After the installation completes, restart your computer to finalize the WSL2 setup.
Restart-ComputerComplete Ubuntu Setup
After restarting, Ubuntu will open automatically. Create a username and password when prompted.
Important: Remember your username and password! You'll need them for sudo commands.
Update Ubuntu and Install Dependencies
Update your Ubuntu package manager and install essential build tools.
Update Package Lists
sudo apt updatesudo apt upgrade -yInstall Build Tools
sudo apt install -y build-essential curl gitThis installs compilers, curl, and git needed for Node.js and Clawdbot.
Install Node.js Using NVM
We recommend using Node Version Manager (NVM) for easy Node.js installation and version management.
Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bashLoad NVM and Install Node.js
export NVM_DIR="$HOME/.nvm"[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"nvm install 20nvm use 20✓ Verifies installation: node --version should show v20.x.x
Install Clawdbot
With Node.js installed, you can now install Clawdbot globally on your WSL2 Ubuntu instance.
Install Clawdbot CLI
npm install -g @clawdbot/cliclawdbot --versionInitialize Clawdbot
clawdbot initFollow the prompts to configure your Clawdbot instance.
Start the Clawdbot Service
clawdbot startUSB/Serial Hardware Passthrough
If you're connecting hardware devices (like Gateways, sensors, or Arduino) to Clawdbot, you need to configure USB passthrough from Windows to WSL2.
Why This is Necessary
WSL2 runs in a virtual machine. Windows doesn't automatically forward USB devices to Linux. You need a bridge tool to access hardware from Ubuntu.
Option 1: USBIPD-Win (Recommended)
Microsoft's official USB over IP tool for WSL2. Best for most users.
Step A: Install usbipd-win (Windows PowerShell - Admin)
winget install usbipdStep B: List attached USB devices (Windows PowerShell - Admin)
usbipd listStep C: Attach device to WSL2 (Windows PowerShell - Admin)
usbipd bind --busid 1-1usbipd attach --wsl --busid 1-1Step D: Verify in WSL2 (Ubuntu)
lsusbYour device should now appear in the list!
Option 2: Serial Port Forwarding
For simple serial devices, you can use TCP forwarding.
# In WSL2, access Windows serial ports via /dev/ttyS*ls /dev/ttyS*COM1 on Windows = /dev/ttyS0 in WSL2
Make USB Attachment Persistent
To automatically attach USB devices on WSL2 startup, create a startup script.
# Create PowerShell script: attach-usb.ps1usbipd attach --wsl --busid 1-1Add to Windows Task Scheduler to run at login.
Verify Your Installation
Run these commands to ensure everything is working correctly.
clawdbot statusShould show: "Clawdbot is running"
node --versionShould show: v20.x.x or higher
clawdbot --helpShould display all available commands
clawdbot config listShould show your configuration
Windows-Specific Troubleshooting
Issue: WSL2 Can't Access Internet
Windows Firewall or VPN software may block WSL2 network access.
# In PowerShell (Admin), restart WSL networkwsl --shutdownwslIssue: Node.js Commands Not Found
NVM may not be loaded in new terminal sessions.
# Add to ~/.bashrcecho 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrcecho '[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"' >> ~/.bashrcsource ~/.bashrcIssue: Slow File I/O Performance
Cross-platform file access (Windows/Linux) is slower in WSL2.
Solution: Keep project files inside WSL2 (~/) rather than /mnt/c/ for better performance.
Installation Complete!
Clawdbot is now running on your Windows machine via WSL2. Here's what to do next:
Need More Help?
If you encounter issues during installation, our community is here to help.
Join our Discord Server