Skip to content
HUIAHUB

TutorialAgents & automation

How to install OpenClaw on Windows, macOS and Linux, sandbox first

How to install OpenClaw on macOS, Linux, Windows or Docker with the official commands, then run onboarding and turn on the sandbox before channels.

Edited by Published 7 min read19 sourcesAI-assisted research and drafting

The official answer to how to install OpenClaw is one installer script: curl -fsSL https://openclaw.ai/install.sh | bash on macOS, Linux and WSL2, or iwr -useb https://openclaw.ai/install.ps1 | iex in Windows PowerShell. If you already manage Node.js, npm install -g openclaw@latest --allow-scripts=openclaw installs the published package instead. Then run onboarding, turn on the sandbox, and only after that connect chat channels.

Every command below is copied from OpenClaw's installation guide (opens in a new tab), its platform pages and the openclaw/openclaw README, all read on 2026-11-19. The newest GitHub release on that date was openclaw 2026.11.5 (opens in a new tab), published 2026-11-17. OpenClaw changes often, so check the docs again if you read this months later.

Install commands by operating system

Your machineDocumented pathCommand or download
macOS (CLI and Gateway)Installer scriptcurl -fsSL https://openclaw.ai/install.sh | bash
Linux desktop or serverInstaller script, or npm if you manage Nodecurl -fsSL https://openclaw.ai/install.sh | bash
Windows desktopWindows Hub app (the docs' recommendation)OpenClawCompanion-Setup-x64.exe or -arm64.exe from the install page
Windows terminalPowerShell installeriwr -useb https://openclaw.ai/install.ps1 | iex
Windows with a Linux runtimeWSL2, then the Linux script inside itwsl --install, then the curl command
Any host with DockerSetup script from a repository checkout./scripts/docker/setup.sh
Node.js already installedGlobal npm packagenpm install -g openclaw@latest --allow-scripts=openclaw

What you need before you install OpenClaw

OpenClaw's install page lists macOS, Linux and Windows as supported systems. The Node.js requirement is Node 24.16.0 or later on the 24.x line, or 26.1.0 or later. The docs strongly recommend 24.22.1+ or 26.12.1+ for security fixes, and the getting started page recommends Node 26. Check your version with:

node --version

You also need AI access. The getting started page says onboarding can reuse an existing Claude Code or Codex CLI login, or a provider API key.

For a server, the hosting FAQ gives an absolute minimum of 1 vCPU, 1 GB RAM and about 500 MB of disk. It recommends 1 to 2 vCPUs and 2 GB or more of RAM, with Ubuntu LTS as the best-tested Linux path.

How to install OpenClaw on macOS

The installer script is the documented route for the macOS CLI and Gateway:

curl -fsSL https://openclaw.ai/install.sh | bash

When Node is missing and nvm is not detected, the installer docs say install.sh provisions Node 26 through Homebrew on macOS. On a fresh install, the script then starts onboarding.

There is also a menu bar app, OpenClaw.app. The macOS platform page says it requires macOS 26.2 (Tahoe) or later, and its download links were pinned to release 2026.10.3 when read. The app does not replace the CLI: the Node-based CLI and Gateway are installed separately. The official Node 24 and 26 binaries target macOS 13.5 or later, so an older Mac can still run the CLI without the app.

How to install OpenClaw on Linux, including a server

On a Linux desktop or server, run the same script:

curl -fsSL https://openclaw.ai/install.sh | bash

When Node is missing, the script installs the supported Node 24 LTS line through NodeSource. The installer docs list Linux ARMv7 as unsupported.

If you prefer to manage Node yourself on a headless server, the Linux page gives the npm route. Include --allow-scripts=openclaw on npm 12 or npm 11.16+, and drop it on npm 11.15 and earlier:

npm i -g openclaw@latest --allow-scripts=openclaw

Then run onboarding with the daemon so the Gateway runs as a systemd user service:

openclaw onboard --install-daemon

On a regular host install the Gateway binds to loopback, so you reach it from your laptop through an SSH tunnel. The Linux page gives this command, after which you open http://127.0.0.1:18789/ and sign in with the Gateway token:

ssh -N -L 18789:127.0.0.1:18789 <user>@<host>

How to install OpenClaw on Windows: native or WSL2

The Windows platform page calls the native Windows Hub app the recommended desktop path. It runs on Windows 10 20H2+ or Windows 11, installs without administrator rights, and ships x64 and ARM64 installers linked from the install page. During setup, Hub checks whether the PC supports a native Gateway. If it does, it installs the Gateway package from the Microsoft Store with WinGet. If not, it provisions its own OpenClawGateway WSL distro. Windows Server is not supported.

For a terminal install on Windows, use the PowerShell installer, then verify:

iwr -useb https://openclaw.ai/install.ps1 | iex
openclaw --version
openclaw doctor
openclaw gateway status --json

If you want the most Linux-compatible runtime, install WSL2 yourself. The Windows platform page (opens in a new tab) uses these steps:

wsl --install
# Or pick a distro explicitly:
wsl --list --online
wsl --install -d Ubuntu-24.04

Inside the distro, enable systemd:

sudo tee /etc/wsl.conf >/dev/null <<'EOF'
[boot]
systemd=true
EOF

Restart WSL from PowerShell with wsl --shutdown, open the distro again, and run the Linux installer:

curl -fsSL https://openclaw.ai/install.sh | bash
openclaw gateway status

The hosting FAQ still describes Windows as "via WSL2". The Windows platform page is the one that covers native installs and Windows Hub.

How to install OpenClaw with Docker

The Docker page (opens in a new tab) calls Docker optional. It needs Docker Desktop or Docker Engine with Docker Compose v2, and at least 6 GB of RAM if you build the image locally. Pre-built images skip that build.

The setup script runs from the repository root, so start from a checkout. The clone commands come from the install page's source section:

git clone https://github.com/openclaw/openclaw.git
cd openclaw

To build the image locally as openclaw:local:

./scripts/docker/setup.sh

To use the pre-built image from GitHub Container Registry instead:

export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh

The script runs onboarding, writes a Gateway token to .env and starts the Gateway with Compose. Open http://127.0.0.1:18789/ and paste that token into Settings. The docs warn against unofficial image mirrors. Use ghcr.io/openclaw/openclaw or the Docker Hub mirror openclaw/openclaw. Container images default to an exposed bind, which the security page says to pair with authentication.

Run onboarding and start the Gateway

The installer scripts start onboarding on a fresh install. After an npm, pnpm or Bun install, start it yourself:

openclaw onboard --install-daemon

Onboarding offers Quick start, which reuses detected AI access and opens the dashboard, or Custom setup for the full guided flow. If you kept the Gateway in the foreground, stop it with Ctrl+C and install it as a background service:

openclaw gateway install
openclaw gateway start

Then confirm it is running and open the Control UI:

openclaw gateway status
openclaw dashboard

The getting started page says the Gateway should listen on port 18789. If something looks wrong, openclaw doctor checks the install.

Turn on the sandbox before you connect channels

OpenClaw's sandbox is off by default. The README says tools run on the host for the main session unless you configure sandboxing, and it asks you to read the sandboxing guide (opens in a new tab) before connecting other users. Do this before you add Telegram, WhatsApp or Discord.

The sandbox setting lives in openclaw.json. Print the path of the active file with:

openclaw config file

Add the minimal block from the sandboxing guide:

{
  agents: {
    defaults: {
      sandbox: {
        mode: "non-main",
        scope: "session",
        workspaceAccess: "none",
      },
    },
  },
}

non-main sandboxes every session except the main one. all sandboxes every session, and off is the default. Docker is the default backend, and local container sandboxes run without network access unless you change agents.defaults.sandbox.docker.network.

The default image is openclaw-sandbox:trixie-slim. From an npm install with Docker sandboxing enabled, the docs build it with:

openclaw doctor --fix

Then check what is actually in effect:

openclaw sandbox explain

Changing sandbox settings does not touch containers that are already running. openclaw sandbox recreate --all rebuilds them from the current config on next use. For container permissions and network limits in general, see sandbox AI coding agent setup.

Read the install script before you run it

Both one-line installers download a script from openclaw.ai and pipe it straight into a shell (curl | bash on macOS and Linux, iwr | iex on Windows). The script runs with your user's permissions before you see a line of it. Open https://openclaw.ai/install.sh or https://openclaw.ai/install.ps1 in a browser and read it first. The installer docs say install.sh installs Node if needed, installs Git if needed, and installs OpenClaw through npm by default.

The installers also have a dry run that prints actions without applying changes:

curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --dry-run
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -DryRun

A dry run still executes the downloaded script, so it does not replace reading it. If you would rather not pipe a script at all, install Node.js yourself and use the npm command from the first section. The risks of running OpenClaw itself are a separate question, covered in the FAQ below.

How to update or uninstall OpenClaw

The updating page uses one command for installs made with the script or a package manager:

openclaw update

For Docker, pull the new images and restart the Gateway:

docker compose pull openclaw-gateway openclaw-cli
docker compose stop openclaw-gateway
docker compose up -d openclaw-gateway

To remove OpenClaw, preview the removal first, then run it:

openclaw uninstall --dry-run --all
openclaw uninstall

The uninstall page lists npm rm -g openclaw, pnpm remove -g openclaw or bun remove -g openclaw to remove the CLI afterward. State lives in ~/.openclaw unless you set OPENCLAW_STATE_DIR.

Sources

  1. 1.GitHub - openclaw/openclaw: The AI that really does things. Any OS. Any Platform. The lobster way. 🦞 · GitHubRepositoryPrimarygithub.com
  2. 2.Install - OpenClawOfficial docsPrimarydocs.openclaw.ai
  3. 3.Getting started - OpenClawOfficial docsPrimarydocs.openclaw.ai
  4. 4.Windows - OpenClawOfficial docsPrimarydocs.openclaw.ai
  5. 5.macOS app - OpenClawOfficial docsPrimarydocs.openclaw.ai
  6. 6.Linux app - OpenClawOfficial docsPrimarydocs.openclaw.ai
  7. 7.Docker - OpenClawOfficial docsPrimarydocs.openclaw.ai
  8. 8.Sandboxing - OpenClawOfficial docsPrimarydocs.openclaw.ai
  9. 9.Security - OpenClawOfficial docsPrimarydocs.openclaw.ai
  10. 10.Updating - OpenClawOfficial docsPrimarydocs.openclaw.ai
  11. 11.github.com/openclaw/openclaw/releases/tag/v2026.11.5RepositoryPrimary
  12. 12.docs.openclaw.ai/help/faq-first-run/providers-and-hostingOfficial docsPrimary
  13. 13.docs.openclaw.ai/install/installerOfficial docsPrimary
  14. 14.docs.openclaw.ai/gateway/sandboxing/modes-scope-and-backendOfficial docsPrimary
  15. 15.docs.openclaw.ai/gateway/sandboxing/images-and-setupOfficial docsPrimary
  16. 16.github.com/openclaw/openclaw/blob/main/docs/cli/config.mdRepositoryPrimary
  17. 17.github.com/openclaw/openclaw/blob/main/docs/cli/sandbox.mdRepositoryPrimary
  18. 18.docs.openclaw.ai/install/uninstallOfficial docsPrimary
  19. 19.docs.openclaw.ai/providers/ollamaOfficial docsPrimary

Spotted an error? See our corrections policy.

Enjoyed this? Get the weekly brief.

New guides, Project & Tool of the Week and the AI developments that matter. One email, no spam.

Read next

More on these topics