#Openclaw docker brew not installed

1 messages · Page 1 of 1 (latest)

keen wharfBOT
#

Yeah — that’s expected with the OpenClaw Docker image.

The default container is security‑first and runs as the non-root node user (uid 1000), which means:

  • you can’t apt-get install … at runtime (no root)
  • you won’t have Homebrew (and you generally shouldn’t try to add it)
  • “global” npm installs (npm i -g …) often fail because they try to write to system paths

Docs: https://docs.openclaw.ai/install/docker (see “Power-user / full-featured container (opt-in)” + “Install extra apt packages”)

What to do (recommended)

Bake deps into the image at build time, then rebuild:

export OPENCLAW_DOCKER_APT_PACKAGES="ffmpeg build-essential git curl jq"
./docker-setup.sh
#

That’s the intended way to add OS packages inside the Docker flow.

If a “skill” says brew install <thing>, translate it to apt in that env var (e.g. brew install ffmpeg → ffmpeg).

If you specifically need npm packages

Avoid npm i -g. Prefer one of these:

  • ephemeral: pnpm dlx <pkg> … or npx <pkg> … (no root, installs into user cache)
  • persistent (inside image): add them during the Docker build (as root during build), or set a user prefix like /home/node/.npm-global and add it to PATH

If you really want runtime installs

You can run a one-off shell as root, but it’s explicitly a security tradeoff:

docker compose run --rm --user 0:0 openclaw-cli bash
#

(Still: better to rebuild with OPENCLAW_DOCKER_APT_PACKAGES so it persists.)

If you tell me which exact brew/npm installs you’re trying to do (package names + what tool needs them), I’ll map them to the clean Docker approach.

#

You “fix” it by not trying to install brew / system stuff inside a running container. The OpenClaw Docker image is intentionally non-root at runtime, so installs will fail by design.

Do one of these:

Option A (recommended): bake OS packages in at build time

From the repo root:

export OPENCLAW_DOCKER_APT_PACKAGES="git curl jq ffmpeg build-essential"
./docker-setup.sh

That rebuilds the image with those apt deps installed persistently.

Docs: https://docs.openclaw.ai/install/docker#install-extra-apt-packages-optional

Option B: for “npm tools”, don’t install globally