Files
openclaw/docs/install/index.md
Seb Slight db137dd65d fix(paths): respect OPENCLAW_HOME for all internal path resolution (#12091)
* fix(paths): respect OPENCLAW_HOME for all internal path resolution (#11995)

Add home-dir module (src/infra/home-dir.ts) that centralizes home
directory resolution with precedence: OPENCLAW_HOME > HOME > USERPROFILE > os.homedir().

Migrate all path-sensitive callsites: config IO, agent dirs, session
transcripts, pairing store, cron store, doctor, CLI profiles.

Add envHomedir() helper in config/paths.ts to reduce lambda noise.
Document OPENCLAW_HOME in docs/help/environment.md.

* fix(paths): handle OPENCLAW_HOME '~' fallback (#12091) (thanks @sebslight)

* docs: mention OPENCLAW_HOME in install and getting started (#12091) (thanks @sebslight)

* fix(status): show OPENCLAW_HOME in shortened paths (#12091) (thanks @sebslight)

* docs(changelog): clarify OPENCLAW_HOME and HOME precedence (#12091) (thanks @sebslight)
2026-02-08 16:20:13 -05:00

6.0 KiB

summary, read_when, title
summary read_when title
Install OpenClaw — installer script, npm/pnpm, from source, Docker, and more
You need an install method other than the Getting Started quickstart
You want to deploy to a cloud platform
You need to update, migrate, or uninstall
Install

Install

Already followed Getting Started? You're all set — this page is for alternative install methods, platform-specific instructions, and maintenance.

System requirements

  • Node 22+ (the installer script will install it if missing)
  • macOS, Linux, or Windows
  • pnpm only if you build from source
On Windows, we strongly recommend running OpenClaw under [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install).

Install methods

The **installer script** is the recommended way to install OpenClaw. It handles Node detection, installation, and onboarding in one step. Downloads the CLI, installs it globally via npm, and launches the onboarding wizard.
<Tabs>
  <Tab title="macOS / Linux / WSL2">
    ```bash
    curl -fsSL https://openclaw.ai/install.sh | bash
    ```
  </Tab>
  <Tab title="Windows (PowerShell)">
    ```powershell
    iwr -useb https://openclaw.ai/install.ps1 | iex
    ```
  </Tab>
</Tabs>

That's it — the script handles Node detection, installation, and onboarding.

To skip onboarding and just install the binary:

<Tabs>
  <Tab title="macOS / Linux / WSL2">
    ```bash
    curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
    ```
  </Tab>
  <Tab title="Windows (PowerShell)">
    ```powershell
    & ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard
    ```
  </Tab>
</Tabs>

For all flags, env vars, and CI/automation options, see [Installer internals](/install/installer).
If you already have Node 22+ and prefer to manage the install yourself:
<Tabs>
  <Tab title="npm">
    ```bash
    npm install -g openclaw@latest
    openclaw onboard --install-daemon
    ```

    <Accordion title="sharp build errors?">
      If you have libvips installed globally (common on macOS via Homebrew) and `sharp` fails, force prebuilt binaries:

      ```bash
      SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
      ```

      If you see `sharp: Please add node-gyp to your dependencies`, either install build tooling (macOS: Xcode CLT + `npm install -g node-gyp`) or use the env var above.
    </Accordion>
  </Tab>
  <Tab title="pnpm">
    ```bash
    pnpm add -g openclaw@latest
    pnpm approve-builds -g        # approve openclaw, node-llama-cpp, sharp, etc.
    openclaw onboard --install-daemon
    ```

    <Note>
    pnpm requires explicit approval for packages with build scripts. After the first install shows the "Ignored build scripts" warning, run `pnpm approve-builds -g` and select the listed packages.
    </Note>
  </Tab>
</Tabs>
For contributors or anyone who wants to run from a local checkout.
<Steps>
  <Step title="Clone and build">
    Clone the [OpenClaw repo](https://github.com/openclaw/openclaw) and build:

    ```bash
    git clone https://github.com/openclaw/openclaw.git
    cd openclaw
    pnpm install
    pnpm ui:build
    pnpm build
    ```
  </Step>
  <Step title="Link the CLI">
    Make the `openclaw` command available globally:

    ```bash
    pnpm link --global
    ```

    Alternatively, skip the link and run commands via `pnpm openclaw ...` from inside the repo.
  </Step>
  <Step title="Run onboarding">
    ```bash
    openclaw onboard --install-daemon
    ```
  </Step>
</Steps>

For deeper development workflows, see [Setup](/start/setup).

Other install methods

Containerized or headless deployments. Declarative install via Nix. Automated fleet provisioning. CLI-only usage via the Bun runtime.

After install

Verify everything is working:

openclaw doctor         # check for config issues
openclaw status         # gateway status
openclaw dashboard      # open the browser UI

If you need custom runtime paths, use:

  • OPENCLAW_HOME for home-directory based internal paths
  • OPENCLAW_STATE_DIR for mutable state location
  • OPENCLAW_CONFIG_PATH for config file location

See Environment vars for precedence and full details.

Troubleshooting: openclaw not found

Quick diagnosis:
node -v
npm -v
npm prefix -g
echo "$PATH"

If $(npm prefix -g)/bin (macOS/Linux) or $(npm prefix -g) (Windows) is not in your $PATH, your shell can't find global npm binaries (including openclaw).

Fix — add it to your shell startup file (~/.zshrc or ~/.bashrc):

export PATH="$(npm prefix -g)/bin:$PATH"

On Windows, add the output of npm prefix -g to your PATH.

Then open a new terminal (or rehash in zsh / hash -r in bash).

Update / uninstall

Keep OpenClaw up to date. Move to a new machine. Remove OpenClaw completely.