#19229: feat: add Apple Container setup with Docker/Podman fallbacks
docs
docker
size: M
Cluster:
Docker and Deployment Improvements
## Summary
This PR adds comprehensive Apple Container support for OpenClaw, enabling lightweight, native containerized gateway deployment on macOS with automatic fallback to Docker or Podman.
## What Changed
- **New file: `apple-container-setup.sh`**
- One-command gateway setup with auto-detection of container runtimes
- Supports Apple Container (primary), Docker, and Podman (fallbacks)
- Feature parity with `docker-setup.sh`
- Includes timeout handling for macOS, extra mounts, home volume persistence, and custom APT packages
- **New file: `docs/install/apple-container.md`**
- Comprehensive setup guide matching docker.md in scope
- "Is it right for me?" comparison with Docker and local installs
- Control UI token setup and device pairing workflow
- Channel setup instructions (WhatsApp, Telegram, Discord)
- Power-user configuration (Playwright, browser caching, permissions)
- Dockerfile optimization guidance
- 10+ troubleshooting scenarios with solutions
- **New file: `src/apple-container-setup.test.ts`**
- Basic setup validation and image building tests
## Why This Change
OpenClaw users on macOS can now deploy containerized gateways using Apple Container's lightweight, native runtime without requiring Docker Desktop's overhead. The auto-detection of container runtimes provides flexibility for existing Docker/Podman users.
## Testing Status
✅ **Fully tested**
- Verified with Apple Container, Docker, and Podman
- Gateway startup and token generation validated
- Extra mounts and home volume persistence tested
- All troubleshooting scenarios documented and verified
## AI Assistance
This PR was developed with Google Gemini assistance. All code has been reviewed and tested. Key improvements include:
- macOS timeout compatibility fixes
- Comprehensive documentation matching docker.md standards
- Feature parity validation with docker-setup.sh
## Notes for Reviewers
- This PR introduces a new optional setup path; it doesn't modify existing flows
- The script gracefully falls back to Docker/Podman if Apple Container isn't available
- Documentation is comprehensive to help users choose the right container runtime
- No breaking changes to existing functionality
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds Apple Container support for running the OpenClaw gateway on macOS, with automatic fallback to Docker or Podman. It includes a setup script (`apple-container-setup.sh`), comprehensive documentation, and basic tests.
- The setup script closely mirrors `docker-setup.sh` but uses direct `container run` commands instead of Docker Compose, which means it lacks restart policies and (more importantly) the `--init` flag for proper signal handling that `docker-compose.yml` provides.
- The test file leaks the full host environment into the sandbox, unlike the more careful `docker-setup.test.ts` which constructs a minimal env. This can cause nondeterministic test results.
- The documentation's example Dockerfile diverges from the actual repo `Dockerfile` in ways that could confuse users (missing `OPENCLAW_DOCKER_APT_PACKAGES` ARG, missing security hardening, etc.).
<h3>Confidence Score: 3/5</h3>
- Additive PR with no changes to existing flows, but has a functional gap (missing --init) and test reliability concerns that should be addressed before merge.
- The PR adds new files only and doesn't touch existing functionality, which limits blast radius. However, the missing --init flag on the gateway container is a real operational issue that will affect signal handling in production. The test environment leakage could cause CI flakiness. The documentation Dockerfile divergence is confusing but not blocking.
- apple-container-setup.sh (missing --init flag), src/apple-container-setup.test.ts (environment leakage)
<sub>Last reviewed commit: f575188</sub>
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
<!-- /greptile_comment -->
Most Similar PRs
#7133: feat: Automated Docker setup with environment-based configuration
by synetalsolutions · 2026-02-02
80.5%
#6698: feat: Add CLI wrapper for Docker integration and update documentation
by barshopen · 2026-02-01
80.5%
#9999: Docker: fix token mismatch and add dev setup workflow
by benclarkeio · 2026-02-06
80.0%
#9190: feat(docker): Add autonomous container self-restart and runtime pac...
by alexdredmon · 2026-02-05
79.9%
#6638: fix: make Dockerfile work on container platforms (Render, Railway, ...
by kaizen403 · 2026-02-01
79.0%
#11915: Docs: Docker + reverse proxy deployment notes and pairing pitfalls
by walshd1 · 2026-02-08
77.6%
#11553: feat(docker): add sandbox browser service and documentation
by dangphdh · 2026-02-08
77.1%
#19644: feat(docker): add init script support via /openclaw-init.d/
by JayMishra-source · 2026-02-18
76.7%
#7709: Using Podman in place of Docker
by juanheyns · 2026-02-03
76.1%
#12504: fix: allow docker cli container to connect to gateway
by bvanderdrift · 2026-02-09
76.0%