OpenClaw Installer Scripts: Flags, Platforms, and Automation
This page explains the three OpenClaw installation scripts for macOS, Linux, and Windows, covering their flags, supported Node versions, and automation options. It is for users who need to install or deploy OpenClaw programmatically.
Read this when
- You want to understand `openclaw.ai/install.sh`
- You want to automate installs (CI / headless)
- You want to install from a GitHub checkout
OpenClaw provides three installation scripts, hosted at openclaw.ai.
| Script | Platform | What it does |
|---|---|---|
install.sh | macOS / Linux / WSL | Sets up Node when absent, then installs OpenClaw through npm (default) or git, optionally launching onboarding. |
install-cli.sh | macOS / Linux / WSL | Puts Node and OpenClaw into a local prefix (~/.openclaw) using npm or git, with no root access needed. |
install.ps1 | Windows (PowerShell) | Sets up Node when absent, then installs OpenClaw through npm (default) or git, optionally launching onboarding. |
Each script works with Node 22.22.3+, 24.15+, or 25.9+. For macOS and Linux, install.sh supplies Node 26 when required, whereas the rootless install-cli.sh fetches Node 24.15.0 (or Node 22.22.3 on ARMv7). On Windows, winget, Chocolatey, or Scoop handle the supported Node LTS line, with a portable fallback that downloads Node 26.
Before touching any packages, every installer checks the exact npm executable it plans to use. npm 11.15 and earlier proceed with a standard install; npm 11.16 and later, npm 12 included, gets --allow-scripts solely for the npm-resolved OpenClaw candidate identity. If the npm version cannot be read, the process halts before any package changes, and a lingering dist/openclaw-install-guard causes the install to fail rather than reporting a lifecycle-skipped package as successful.
Install-method switches confirm the replacement works before removing the current owner. Source wrappers rely on a same-directory atomic replacement; when an npm shim occupies that path, the installer moves aside only an identity-matched source wrapper and restores it if npm installation, lifecycle checks, or candidate verification fail. During upgrades, install.sh and install.ps1 execute openclaw doctor --fix; a nonzero exit follows repair or final verification failure, and the success banner appears only after those steps finish.
Quick commands
install.sh
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --help
install-cli.sh
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --help
install.ps1
iwr -useb https://openclaw.ai/install.ps1 | iex
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -Tag beta -NoOnboard -DryRun
Note
When installation completes but
openclawis missing from a fresh terminal, refer to Node.js troubleshooting.
install.sh
Tip
Best choice for most interactive installs on macOS/Linux/WSL.
Flow (install.sh)
Detect OS
Works on macOS and Linux, WSL included.
Ensure Node.js 26 by default
Verifies the Node version and installs Node 26 when needed (Homebrew node on macOS, NodeSource setup scripts for apt/dnf/yum on Linux). On macOS, Homebrew is added only when the installer requires it for Node or Git. Supported versions are Node 22.22.3+, Node 24.15+, and Node 25.9+; Node 23 is not supported.
On Alpine or musl Linux, apk packages replace NodeSource, and the actual linked SQLite version gets checked. Current stable Alpine package streams may deliver a sufficiently new Node paired with vulnerable system SQLite; in that case, use an official node:26-alpine container or a glibc-based host.
Ensure Git
Adds Git when missing via the detected package manager, covering Homebrew on macOS and apk on Alpine.
Install OpenClaw
npmmethod (default): npm install performed globallygitmethod: clone or update the repo, install dependencies with pnpm, build, then place the wrapper at~/.local/bin/openclaw
Post-install tasks
- Locates the freshly installed
openclawbinary for subsequent commands - For an unconfigured install, starts onboarding before doctor or gateway probes. With
--no-onboardor no TTY, it prints the command to complete setup later. - For a configured install, best-effort refreshes and restarts a loaded gateway service and runs repair Doctor. Upgrade repair failures are fatal; plugin update failures remain warnings.
- When
--verifyruns, it verifies the installed version and checks gateway health only after configuration exists.
Source checkout detection
Running inside an OpenClaw checkout (package.json + pnpm-workspace.yaml) makes the script offer:
- use checkout (
git), or - use global install (
npm)
Without a TTY and with no install method set, it falls back to npm and issues a warning.
Exit code 2 is returned for an invalid method selection or invalid --install-method values.
Examples (install.sh)
Default
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
Skip onboarding
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-onboard
Git install
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git
GitHub main checkout
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git --version main
Dry run
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --dry-run
Verify after install
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-onboard --verify
Flags reference
| Flag | Description |
|---|---|
--install-method | --method npm|git | Selects the installation approach (default: npm) |
--npm | Alias for the npm approach |
--git | --github | Alias for the git approach |
--version <version|dist-tag|spec> | npm release, dist-tag, or package spec (default: latest) |
--beta | Prefer the beta dist-tag when present, otherwise use latest |
--git-dir | --dir <path> | Location for the checkout (default: ~/openclaw) |
--no-git-update | Don't run git pull when the checkout already exists |
--no-prompt | Turn off all interactive prompts |
--no-onboard | Skip the onboarding step |
--onboard | Force the onboarding step to run |
--verify | Execute a smoke test after installation (--version, gateway health if loaded) |
--dry-run | Show what would happen without making any changes |
--verbose | Turn on verbose logging (set -x, npm notice-level output) |
--help | -h | Print the help text |
Environment variables reference
| Variable | Description |
|---|---|
OPENCLAW_INSTALL_METHOD=git|npm | Installation approach |
OPENCLAW_VERSION=latest|next|<semver>|<spec> | npm release, dist-tag, or package spec |
OPENCLAW_BETA=0|1 | Use the beta channel when it exists |
OPENCLAW_HOME=<path> | Root directory for OpenClaw state and default git/onboarding paths |
OPENCLAW_GIT_DIR=<path> | Checkout directory |
OPENCLAW_GIT_UPDATE=0|1 | Control git update behavior |
OPENCLAW_NO_PROMPT=1 | Disable prompts |
OPENCLAW_VERIFY_INSTALL=1 | Run the post-install smoke test |
OPENCLAW_NO_ONBOARD=1 | Skip onboarding |
OPENCLAW_DRY_RUN=1 | Dry run mode |
OPENCLAW_VERBOSE=1 | Debug mode |
OPENCLAW_NPM_LOGLEVEL=error|warn|notice | npm log verbosity (default: error, suppresses npm deprecation warnings) |
install-cli.sh
Info
Meant for setups that prefer a self-contained local prefix (default
~/.openclaw) without requiring a system-level Node. The npm installation path works out of the box, and git-checkout installs follow the same prefix structure.
Flow (install-cli.sh)
Install local Node runtime
A pinned, supported Node LTS tarball (the version is hardcoded in the script and updated separately, default 24.15.0) gets downloaded to <prefix>/tools/node-v<version> with SHA-256 verification.
For Linux ARMv7, Node 22.22.3 is used because official Node 24+ ARMv7 builds are not published.
On Alpine/musl Linux, where Node lacks compatible tarballs for the pinned runtime, nodejs and npm are installed via apk, followed by verification of both Node and the actual linked SQLite library. Current stable Alpine package streams can still ship a vulnerable SQLite even when Node is recent enough; run inside an official node:24-alpine container or on a glibc-based host if the safety check rejects the package.
Ensure Git
When Git is absent, the installer tries apt/dnf/yum/apk on Linux or Homebrew on macOS.
Install OpenClaw under prefix
npmapproach (default): installs beneath the prefix using npm, then places a wrapper at<prefix>/bin/openclawgitapproach: clones or refreshes a checkout (default~/openclaw) and still writes the wrapper to<prefix>/bin/openclaw
Verify the installed CLI
Executes <prefix>/bin/openclaw --version and aborts with an error unless the
installed wrapper exits successfully and returns a nonempty version.
Refresh loaded gateway service
If a gateway service from that same prefix is already active, the script invokes
openclaw gateway install --force, which swaps in the replacement service,
then checks gateway health on a best-effort basis.
Examples (install-cli.sh)
Default
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash
Custom prefix + version
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --prefix /opt/openclaw --version latest
Git install
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --install-method git --git-dir ~/openclaw
Automation JSON output
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --json --prefix /opt/openclaw
Run onboarding
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --onboard
Flags reference
| Flag | Description |
|---|---|
--prefix <path> | Installation prefix, defaults to ~/.openclaw |
--install-method | --method npm|git | Selects the installation approach, defaults to npm |
--npm | Shortcut that picks the npm approach |
--git | --github | Shortcut that picks the git approach |
--git-dir | --dir <path> | Where the git checkout is placed, defaults to ~/openclaw |
--no-git-update | Omits git pull when a git checkout already exists |
--version <ver> | OpenClaw version or dist-tag, defaults to latest |
--compatible-with <ver> | Rejects a CLI that cannot modify config generated by <ver> |
--node-version <ver> | Node version, defaults to 24.15.0; on Linux ARMv7 it is 22.22.3 |
--json | Outputs NDJSON events |
--onboard | Executes openclaw onboard once installation finishes |
--no-onboard | Turns off onboarding, which is the default |
--set-npm-prefix | On Linux, forces the npm prefix to ~/.npm-global when the active prefix is not writable |
--help | -h | Prints usage |
Environment variables reference
| Variable | Description |
|---|---|
OPENCLAW_PREFIX=<path> | Installation prefix |
OPENCLAW_INSTALL_METHOD=git|npm | Installation approach |
OPENCLAW_VERSION=<ver> | OpenClaw version or dist-tag |
OPENCLAW_NODE_VERSION=<ver> | Node version |
OPENCLAW_HOME=<path> | Root folder for OpenClaw state and the default git/onboarding locations |
OPENCLAW_GIT_DIR=<path> | Git checkout folder for git-based installs |
OPENCLAW_GIT_UPDATE=0|1 | Controls whether git updates apply to existing checkouts |
OPENCLAW_NO_ONBOARD=1 | Disables onboarding |
OPENCLAW_NPM_LOGLEVEL=error|warn|notice | npm log level, defaults to error |
Note
GitHub source specs like
openclaw@mainare not accepted as--versiontargets for npm installs. Use--install-method git --version maininstead.
install.ps1
Flow (install.ps1)
Ensure PowerShell + Windows environment
PowerShell 5 or newer is required.
Ensure a supported Node.js runtime
When it is absent, the script tries winget first, then Chocolatey, then Scoop. If none of those package managers exist, the official Node.js 26 Windows zip is downloaded into %LOCALAPPDATA%\OpenClaw\deps\portable-node and registered with both the current process and the user PATH. Supported Node versions are 22.22.3+, 24.15+, and 25.9+; Node 23 is not supported.
Install OpenClaw
npmapproach (default): a global npm install using the chosen-Tag, run from a writable installer temp directory so that shells opened in protected locations likeC:\continue to functiongitapproach: clone or update the repo, install and build with pnpm, then place the wrapper at%USERPROFILE%\.local\bin\openclaw.cmd. When Git is missing, the script sets up a user-local MinGit under%LOCALAPPDATA%\OpenClaw\deps\portable-gitand adds it to the current process and user PATH.
Post-install tasks
- Adds the required bin directory to the user PATH when feasible
- Makes a best-effort refresh of a loaded gateway service (via
openclaw gateway install --force, followed by a restart) - Runs
openclaw doctor --fix --non-interactivefor upgrades and git installs; if it fails, the upgrade cannot be reported as successful
Handle failures
iwr ... | iex and scriptblock installs throw a terminating error but leave the current PowerShell session open. Direct powershell -File / pwsh -File installs still return a non-zero exit code for automation purposes.
Examples (install.ps1)
Default
iwr -useb https://openclaw.ai/install.ps1 | iex
Git install
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -InstallMethod git
GitHub main checkout
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -InstallMethod git -Tag main
Custom git directory
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -InstallMethod git -GitDir "C:\openclaw"
Dry run
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -DryRun
Flags reference
| Flag | Description |
|---|---|
-InstallMethod npm|git | Installation approach (default: npm) |
-Tag <tag|version|spec> | npm dist-tag, version, or package spec (default: latest) |
-GitDir <path> | Directory for checkout (default: %USERPROFILE%\openclaw) |
-NoOnboard | Bypass onboarding |
-NoGitUpdate | Bypass git pull |
-DryRun | Show actions without executing |
-Help | Display usage for downloaded scriptblock invocation |
Environment variables reference
| Variable | Description |
|---|---|
OPENCLAW_INSTALL_METHOD=git|npm | Installation approach |
OPENCLAW_GIT_DIR=<path> | Directory for checkout |
OPENCLAW_NO_ONBOARD=1 | Bypass onboarding |
OPENCLAW_GIT_UPDATE=0 | Disable git pull |
OPENCLAW_DRY_RUN=1 | Dry run mode |
Note
Provide installer options by name. Unknown options and positional arguments are rejected before downloads, PATH changes, or installation begin. Use
-?with a savedinstall.ps1file, or-Helpwith the downloaded scriptblock form.
Note
If
-InstallMethod gitis used and Git is missing, the script attempts a user-local MinGit bootstrap before showing the Git for Windows link.
CI and automation
Use non-interactive flags/env vars for predictable runs.
install.sh (non-interactive npm)
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-prompt --no-onboard
install.sh (non-interactive git)
OPENCLAW_INSTALL_METHOD=git OPENCLAW_NO_PROMPT=1 \
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
install-cli.sh (JSON)
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --json --prefix /opt/openclaw
install.ps1 (skip onboarding)
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard
Troubleshooting
Why is Git required?
The git install method requires Git. For npm installs, Git is still checked and installed to prevent spawn git ENOENT failures when dependencies use git URLs.
Why does npm hit EACCES on Linux?
On some Linux systems, npm's global prefix points to root-owned paths. install.sh can shift the prefix to ~/.npm-global and append PATH exports to shell rc files (when those files exist).
Windows: "npm error spawn git / ENOENT"
Rerun the installer so it can bootstrap user-local MinGit, or install Git for Windows and reopen PowerShell.
Windows: "openclaw is not recognized"
Run npm config get prefix and add that directory to your user PATH (no \bin suffix needed on Windows), then reopen PowerShell.
Windows: how to get verbose installer output
install.ps1 relies on CmdletBinding, so it accepts PowerShell's common -Verbose parameter. The installer does not currently write a dedicated verbose stream. For script-level diagnostics, use PowerShell tracing:
Set-PSDebug -Trace 1
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard
Set-PSDebug -Trace 0
openclaw not found after install
Usually a PATH issue. See Node.js troubleshooting.