Introduction
Before you can start using OpenClaw, you need to get it installed on your machine. There are several installation methods available depending on your operating system and preferences. This lesson covers the prerequisites and walks you through each approach so you can pick the one that fits your workflow.
Key Concepts
- Node.js 22+ is the minimum runtime requirement for OpenClaw
- Installer script provides the fastest one-command setup for macOS, Linux, and Windows
- Package managers like npm and pnpm offer familiar installation workflows for JavaScript developers
- Source builds give you full control and access to the latest development features
- Container runtimes such as Docker and Podman provide isolated, reproducible environments
Real World Context
Development teams often standardize on a single installation method across their organization. Startups might prefer the quick installer script for rapid onboarding, while enterprises may choose Docker or Ansible for reproducible, auditable deployments. Choosing the right method upfront saves time and avoids configuration drift across team members.
Deep Dive
OpenClaw requires Node.js version 22 or higher. Verify your Node version before proceeding:
bashnode --version
This prints your current Node.js version. If it reports anything below v22, you need to upgrade before installing OpenClaw.
Installer Script (Recommended)
The fastest way to install OpenClaw is the official installer script. On macOS or Linux, run:
bashcurl -fsSL https://openclaw.ai/install.sh | bash
This downloads the install script from the official OpenClaw site and pipes it directly to bash, which handles downloading the binary, placing it on your PATH, and setting correct permissions.
On Windows PowerShell, the equivalent command is:
powershelliwr -useb https://openclaw.ai/install.ps1 | iex
This uses PowerShell's Invoke-WebRequest to fetch the Windows installer script and Invoke-Expression to execute it.
npm Installation
If you prefer using npm as your package manager:
bashnpm install -g openclaw@latest && openclaw onboard --install-daemon
The first part installs OpenClaw globally so the openclaw command is available everywhere. The second part runs the onboarding wizard which configures authentication and starts the background daemon.
pnpm Installation
For pnpm users, there is an extra step to approve build scripts:
bashpnpm add -g openclaw@latest && pnpm approve-builds -g && openclaw onboard --install-daemon
The pnpm approve-builds -g command is necessary because pnpm blocks postinstall scripts by default for security. This explicitly approves the OpenClaw build scripts before running the onboard wizard.
Building from Source
For contributors or those who want the bleeding edge:
bashgit clone https://github.com/openclaw/openclaw.git cd openclaw pnpm install pnpm ui:build pnpm build pnpm link --global
This clones the repository, installs dependencies, builds the UI and core packages, then links the openclaw command globally so you can use it from any directory.
Other Methods
OpenClaw also supports installation via Docker, Podman, Nix, and Ansible. These are ideal for CI/CD pipelines, containerized workflows, or infrastructure-as-code setups. Refer to the official docs for detailed instructions on each.
Common Pitfalls
- Using Node.js below version 22: OpenClaw will fail to start or exhibit unexpected behavior on older Node versions. Always verify with
node --versionfirst. - Forgetting
pnpm approve-builds: pnpm silently skips postinstall scripts without approval, leading to a broken installation that appears successful but lacks necessary compiled assets. - Not running
openclaw onboard --install-daemonafter npm/pnpm install: The global install alone does not configure authentication or start the daemon, leaving OpenClaw non-functional.
Best Practices
- Use the installer script for personal machines to get started in under a minute with minimal configuration.
- Use Docker or Ansible for team environments to ensure every developer has an identical setup.
- Pin a specific version in CI pipelines (e.g.,
npm install -g openclaw@1.2.3) rather than using@latestto avoid unexpected breaking changes.
Summary
- OpenClaw requires Node.js 22+ as a prerequisite
- The installer script (
curl | bashoriwr | iex) is the fastest installation method - npm and pnpm provide familiar package manager workflows with global installs
- Building from source requires cloning the repo, installing deps, and running build steps
- Docker, Podman, Nix, and Ansible offer additional installation paths for specialized environments