solution docker high macos linux windows

Docker: docker-setup.sh or image build fails

Fix common Docker onboarding/build failures by rebuilding with correct deps, adding apt packages, checking Docker Desktop file sharing, and reading compose logs.

By CoClaw Team •

Symptoms

  • ./docker-setup.sh fails during docker build or pnpm build.
  • The container starts but the gateway crashes immediately.
  • You mounted extra paths but the container can’t see them (macOS/Windows).

Cause

Common causes:

  • Missing system packages in the image for your workload (media tools, build tooling, etc.)
  • Docker Desktop file sharing not enabled for the host path you mounted (macOS/Windows)
  • Stale image layers / partial build artifacts
  • Not enough disk space for images and build caches

Fix

1) Start from the supported flow

From the OpenClaw repo root:

./docker-setup.sh

2) Inspect logs (best signal)

docker compose logs -f openclaw-gateway

3) If you need extra system packages, install them during build

Set OPENCLAW_DOCKER_APT_PACKAGES, then rerun docker-setup.sh:

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

4) If you use extra mounts (macOS/Windows), ensure paths are shared

If you set OPENCLAW_EXTRA_MOUNTS, Docker Desktop must be allowed to access those host paths.

After changing mounts, rerun:

./docker-setup.sh

5) Rebuild cleanly if the image is stale

docker compose down
docker build --no-cache -t openclaw:local -f Dockerfile .
docker compose up -d openclaw-gateway

Verify

  • docker compose exec openclaw-gateway node dist/index.js health --token "$OPENCLAW_GATEWAY_TOKEN"
  • Open http://127.0.0.1:18789/ and paste the token into Control UI settings.

Verification & references

  • Reviewed by:CoClaw Code Team
  • Last reviewed:March 14, 2026
  • Verified on: macOS · Linux · Windows

References

Want to explore more? Browse all solutions or ask in the Community Forum .
Report a problem

Related Resources

Docker: EACCES permission denied writing ~/.openclaw (openclaw.json.*.tmp)
Fix
Fix Docker permission errors when the gateway container can't write to the bind-mounted ~/.openclaw directory (common when host UID/GID != 1000).
Docker: 'This version of Antigravity is no longer supported' (update required)
Fix
When Antigravity rejects requests with an update-required message, upgrade OpenClaw (or rebuild your Docker image) and re-authenticate.
Windows: tools.exec cannot find docker, rg, or gh even though they work in PowerShell
Fix
Fix native Windows cases where the Scheduled Task gateway uses a different PATH than your interactive shell, so tools.exec cannot resolve installed CLI tools.
OpenClaw Docker Deployment: A Reproducible Gateway Setup You Can Recover
Guide
Deploy OpenClaw with Docker Compose, persistent host state, and a repeatable verification loop so upgrades, restarts, and channel changes do not turn into guesswork.
OpenClaw Installation Troubleshooting: Node/NPM, PATH, Windows (WSL2), and Docker
Guide
A layered checklist for the most common 'can't install' / 'command not found' / 'service won't start' failures. Covers Node version, global install permissions, PATH issues, WSL2 systemd, and Docker setup gotchas.
OpenClaw State, Workspace, and Memory: Persistence & Permissions Troubleshooting
Guide
Fix OpenClaw persistence the boring way: confirm the real state and workspace paths, repair write permissions, verify artifacts survive restarts, and stop confusing runtime drift with memory loss.