One-click OpenClaw installer for WSL Ubuntu. Skips the common pitfalls.
Installing OpenClaw on WSL Ubuntu should be a single npm install -g. In practice, you hit Node.js version mismatches, npm registry timeouts, WSL memory exhaustion, and missing PATH entries. If you're in China, you also get to debug mirror selection.
I wrote m78setup.sh because I've stepped in every one of these holes more than once.
| Step | Action |
|---|---|
| Environment detection | Verifies you're in WSL Ubuntu with apt available. Node.js version check (minimum 22.14.0, Node 24 recommended). |
| Memory protection | Checks for .wslconfig. If missing, prompts you to create one with sensible limits (4 GB RAM, 2 cores) to prevent Windows from freezing. |
| Memory headroom | Verifies at least 500 MB free before npm install to avoid mid-install OOM kills. |
| Registry selection | Probes the official npm registry. If unreachable, automatically switches to npmmirror (China mirror). |
| Cache cleanup | Clears npm cache to prevent corrupted artifacts from blocking installation. |
| Global install | Runs npm install -g openclaw@latest. Uses sudo automatically if permissions are insufficient. |
| Five‑way verification | Checks binary existence, version output, npm list entry, package.json metadata, and bin symlink. |
| PATH configuration | Adds the npm global bin directory to your PATH. |
The script logs everything. If something fails, you'll know exactly where to look.
- Windows 11 with WSL2
- Ubuntu 20.04 / 22.04 / 24.04
- Node.js 22.14.0 or later (Node 24 recommended)
If you're not on WSL Ubuntu, this script is not for you. Native Linux or Docker users should follow the official OpenClaw installation docs.
wget https://raw.githubusercontent.com/m78armor/m78setup/main/m78setup.sh
chmod +x m78setup.sh
./m78setup.shOr using curl:
curl -O https://raw.githubusercontent.com/m78armor/m78setup/main/m78setup.sh
chmod +x m78setup.sh
./m78setup.shgit clone https://github.com/m78armor/m78setup.git
cd m78setup
chmod +x m78setup.sh
./m78setup.shFollow the prompts. When asked about .wslconfig, choose Y. Without memory limits, WSL can consume all available RAM and freeze your entire Windows machine.
After installation completes, you'll see:
==================================================
OpenClaw installation complete
==================================================
Next steps:
1. Run first-time setup:
$ openclaw onboard
2. Change settings later:
$ openclaw configure
3. Get the free hardening checklist:
Visit: https://m78armor.com
==================================================
The script verifies it's running under WSL + Ubuntu + apt. If you see this message, you're not in a supported environment. The script refuses to run rather than give you a broken install.
The script probes both npmjs and npmmirror. If both are unreachable, it exits with an error. If it's just slow, the script retries up to 15 times with 30‑second intervals.
If you're stuck, manually set the mirror:
npm config set registry https://registry.npmmirror.comThe script adds the npm global bin directory to PATH. If your shell configuration is non‑standard, add it manually:
export PATH="$(npm config get prefix)/bin:$PATH"To make it permanent, add that line to ~/.bashrc.
The global install needs sudo. Make sure your user has sudo privileges and enter your password when prompted.
This script only installs OpenClaw. It does not touch security configuration. Your fresh install runs with default settings—gateway may be exposed, authentication may be off, and host exec may be in YOLO mode (v2026.4.2+).
Spend 60–90 minutes locking it down.
I've published a free 18‑step hardening checklist covering CVE patches, gateway lockdown, credential protection, skill auditing, and browser isolation. Each step includes commands and verification.
👉 CSDN Article (Chinese): OpenClaw 还在裸奔?18 步加固清单,别等出事再补
👉 PDF Checklist (Bilingual): Download from m78armor.com
If manually running 18 steps isn't your idea of a good time, M78Armor automation scripts compress the process to under 10 minutes. Includes ClawHavoc malicious‑skill signature detection. Runs locally—no data leaves your machine.
- Starter (¥88): Automated scan + hardening, ClawHavoc signatures, docs.
- Professional (¥188): Everything in Starter plus deployment inventory workbook, secure baseline manual, incident response cheatsheets, and compliance trigger map.
👉 Afdian Store: https://ifdian.net/a/m78armor
This script is provided as‑is, without warranty of any kind. The maintainer assumes no liability for network exposure, misconfiguration, or data loss resulting from the use of this script or OpenClaw. Review your security configuration after installation.
MIT License — see LICENSE file for details.
Questions? Open an issue or email support@m78armor.com.