GreenVPN

OpenClaw npm Install: One Command for Mac, Linux, and Windows

February 26, 2026 · AI Tools

If you already have Node.js 22+ installed, the fastest way to get OpenClaw is a single npm command. No curl scripts, no Homebrew, no Docker—just npm install -g openclaw@latest. This works on macOS, Linux, and Windows (via WSL2). The npm package is the same binary as the one-line installer produces; it is just a different delivery mechanism. This guide covers the install, platform-specific notes, and how to keep OpenClaw updated.

Why choose npm over the one-line installer? If you are a Node.js developer, you likely already have Node and npm configured. The npm method avoids downloading and executing a shell script, which some users prefer for security. It also integrates with your existing Node version management (nvm, fnm, volta)—you can pin OpenClaw to a specific Node version. The one-line installer is better if you do not have Node.js or want the script to install it for you. Both methods produce the same openclaw CLI and store config in ~/.openclaw. Choose based on your workflow.

1 When to Use npm Instead of Other Methods

The npm install is ideal if you already manage Node.js for development. You can use the same Node version across projects, and updates are as simple as npm update -g openclaw. If you prefer minimal tooling, the one-line curl installer is faster—it installs Node.js for you if needed. Homebrew users on Mac may prefer brew install openclaw-cli for integration with their package manager. Docker is best for servers and isolation. Choose npm when you want a clean, standard Node.js workflow without extra scripts or system packages.

2 Prerequisites: Node.js 22+

OpenClaw requires Node.js 22.0 or later. Check your version with node -v. If you are on an older version, upgrade using nvm, fnm, or your system package manager. On Ubuntu/Debian: curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt install -y nodejs. On macOS with Homebrew: brew install node@22. On Windows, use the official installer from nodejs.org or WSL2 with a Linux Node.js install.

If you use nvm (Node Version Manager), run nvm install 22 and nvm use 22 before installing OpenClaw. With fnm: fnm install 22 and fnm use 22. This keeps OpenClaw isolated from other projects that may require different Node versions. Ensure npm is available—it ships with Node.js. Verify with npm -v (you need npm 9+).

3 Install OpenClaw

Run:

npm install -g openclaw@latest

The -g flag installs OpenClaw globally so the openclaw command is available everywhere. If you get permission errors, use sudo npm install -g openclaw@latest (not ideal) or configure npm to use a user directory: npm config set prefix ~/.local and add ~/.local/bin to your PATH. Verify with openclaw --version.

The install typically takes 30–60 seconds depending on your connection. npm downloads the OpenClaw package from the registry and installs it to your global node_modules. The package includes the CLI binary and dependencies. After installation, the openclaw command should be in your PATH. If it is not found, ensure your npm global bin directory is in PATH. Run npm config get prefix to see where global packages are installed, then add $(npm config get prefix)/bin to your PATH if needed.

4 Run Onboarding

Configure your AI model and messaging channel:

openclaw onboard --install-daemon

The wizard asks for your AI provider (Claude, OpenAI, Gemini, or Ollama), API key, and a channel (Telegram, Discord, WhatsApp). Have your API key and bot token ready. Use --install-daemon to install a background service (launchd on macOS, systemd on Linux) so OpenClaw starts automatically. If your network blocks AI APIs, connect to a VPN first—a service with 1000Mbps bandwidth ensures fast, reliable API access.

The wizard is interactive: it will prompt you for each setting. For Claude, get an API key from console.anthropic.com; for OpenAI, from platform.openai.com. For Ollama, ensure it is running locally and use http://localhost:11434. For Telegram, create a bot with @BotFather, copy the token, and paste it when asked. After onboarding, send a test message to your bot to confirm everything works. If you see timeouts or connection errors, check that your machine can reach the AI API; a VPN may be required in restricted regions.

5 Platform Notes

macOS: Works on both Apple Silicon and Intel. If you use Homebrew for Node.js, ensure brew --prefix/bin is in your PATH so the global openclaw is found.

Linux: On Ubuntu/Debian, you may need sudo for global installs unless you use a user prefix. systemd service install works out of the box.

Windows: OpenClaw does not run natively on Windows. Use WSL2 (Ubuntu recommended), install Node.js there, then run the npm command. The same binary runs as on Linux.

For Windows users, enable WSL2 and install Ubuntu from the Microsoft Store. Open the Ubuntu terminal, install Node.js 22, then run the npm install. Your OpenClaw config will live in ~/.openclaw inside the WSL filesystem. You can access the Control UI from Windows by opening http://localhost:18789 in your browser. For the daemon, WSL2 supports systemd in recent versions; otherwise, start OpenClaw manually.

6 Updating

To update OpenClaw: npm update -g openclaw. Or reinstall: npm install -g openclaw@latest. If you use the daemon, restart it after updating. The npm package tracks the latest release, so you always get the newest features and fixes.

To pin a specific version, use npm install -g [email protected] (replace with the desired version). This is useful for production where you want to avoid unexpected changes. Check the OpenClaw GitHub releases for version numbers. After updating, run openclaw --version to confirm. Your config in ~/.openclaw is preserved across updates—only the binary changes. If you encounter issues after an update, you can downgrade with npm install -g openclaw@<previous-version>.

Troubleshooting Common Issues

If openclaw is not found after install, check your PATH: echo $PATH should include your npm global bin directory. On macOS with Homebrew Node, run brew link node if needed. For "EACCES" or permission errors, avoid sudo npm when possible—use npm config set prefix ~/.local instead. If the daemon fails to start, check system logs: journalctl -u openclaw on Linux or log show --predicate 'process == "openclaw"' on macOS. For API connection issues, verify your network can reach the AI provider; a VPN with 1000Mbps bandwidth resolves throttling in many regions. The npm package is published by the OpenClaw team and is updated with each release—you can check the changelog on GitHub to see what is new before updating. Many developers prefer npm because it fits into their existing workflow: they use npm for other tools (e.g., VS Code extensions, CLI utilities), and adding OpenClaw is consistent. If you use a monorepo or have multiple Node projects, you can also install OpenClaw as a dev dependency in a specific project, though global install is more common for a system-wide AI assistant. The key takeaway: npm is a first-class install method for OpenClaw, fully supported and recommended for Node.js users.

GreenVPN: Fast API Access for Your OpenClaw

OpenClaw needs reliable access to Claude, OpenAI, and messaging APIs. In regions where these are throttled or restricted, GreenVPN keeps your AI responsive. With 1000Mbps gigabit bandwidth, 70+ global server locations, and 10+ years of stable operation, GreenVPN ensures your npm-installed OpenClaw stays fast everywhere.

  • ✅ 1000Mbps — no lag for API calls or Telegram
  • ✅ 70+ countries — low latency to AI providers worldwide
  • ✅ From $1.5/month — affordable for developers
  • ✅ 30-day money-back guarantee — try risk-free
  • ✅ Mac, Windows, Linux — one account everywhere
  • ✅ 10+ years stable — trusted globally
Start Free Trial — From $1.5/mo

FAQ

npm vs. one-line installer: which should I use?

If you already have Node.js 22+, npm is simpler—one command, no curl. The one-line installer is better if you do not have Node.js or want the script to install it for you. Both produce the same OpenClaw binary and config in ~/.openclaw.

Can I use pnpm or yarn instead of npm?

Yes. pnpm add -g openclaw@latest or yarn global add openclaw@latest work the same way. The OpenClaw package is published to the npm registry and is compatible with all Node.js package managers.

Where does npm install OpenClaw?

Run npm root -g to see the global node_modules path. OpenClaw is installed there. The openclaw binary is in the bin/ subdirectory. Config and data go to ~/.openclaw regardless of install method.

npm install fails with network errors—what should I do?

Check your connection to registry.npmjs.org. If you are behind a firewall or in a region that restricts npm, try a different registry or use a VPN. GreenVPN's 1000Mbps bandwidth and 70+ server locations help bypass throttling and access npm and AI APIs reliably.

70+ Global Nodes · 10 Years Stable
Try GreenVPN Free