mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
summary: "Optional Docker-based setup and onboarding for Moltbot"
|
||||
summary: "Optional Docker-based setup and onboarding for OpenClaw"
|
||||
read_when:
|
||||
- You want a containerized gateway instead of local installs
|
||||
- You are validating the Docker flow
|
||||
@@ -11,12 +11,12 @@ Docker is **optional**. Use it only if you want a containerized gateway or to va
|
||||
|
||||
## Is Docker right for me?
|
||||
|
||||
- **Yes**: you want an isolated, throwaway gateway environment or to run Moltbot on a host without local installs.
|
||||
- **Yes**: you want an isolated, throwaway gateway environment or to run OpenClaw on a host without local installs.
|
||||
- **No**: you’re running on your own machine and just want the fastest dev loop. Use the normal install flow instead.
|
||||
- **Sandboxing note**: agent sandboxing uses Docker too, but it does **not** require the full gateway to run in Docker. See [Sandboxing](/gateway/sandboxing).
|
||||
|
||||
This guide covers:
|
||||
- Containerized Gateway (full Moltbot in Docker)
|
||||
- Containerized Gateway (full OpenClaw in Docker)
|
||||
- Per-session Agent Sandbox (host gateway + Docker-isolated agent tools)
|
||||
|
||||
Sandboxing details: [Sandboxing](/gateway/sandboxing)
|
||||
@@ -44,93 +44,93 @@ This script:
|
||||
- generates a gateway token and writes it to `.env`
|
||||
|
||||
Optional env vars:
|
||||
- `CLAWDBOT_DOCKER_APT_PACKAGES` — install extra apt packages during build
|
||||
- `CLAWDBOT_EXTRA_MOUNTS` — add extra host bind mounts
|
||||
- `CLAWDBOT_HOME_VOLUME` — persist `/home/node` in a named volume
|
||||
- `OPENCLAW_DOCKER_APT_PACKAGES` — install extra apt packages during build
|
||||
- `OPENCLAW_EXTRA_MOUNTS` — add extra host bind mounts
|
||||
- `OPENCLAW_HOME_VOLUME` — persist `/home/node` in a named volume
|
||||
|
||||
After it finishes:
|
||||
- Open `http://127.0.0.1:18789/` in your browser.
|
||||
- Paste the token into the Control UI (Settings → token).
|
||||
|
||||
It writes config/workspace on the host:
|
||||
- `~/.clawdbot/`
|
||||
- `~/clawd`
|
||||
- `~/.openclaw/`
|
||||
- `~/.openclaw/workspace`
|
||||
|
||||
Running on a VPS? See [Hetzner (Docker VPS)](/platforms/hetzner).
|
||||
|
||||
### Manual flow (compose)
|
||||
|
||||
```bash
|
||||
docker build -t moltbot:local -f Dockerfile .
|
||||
docker compose run --rm moltbot-cli onboard
|
||||
docker compose up -d moltbot-gateway
|
||||
docker build -t openclaw:local -f Dockerfile .
|
||||
docker compose run --rm openclaw-cli onboard
|
||||
docker compose up -d openclaw-gateway
|
||||
```
|
||||
|
||||
### Extra mounts (optional)
|
||||
|
||||
If you want to mount additional host directories into the containers, set
|
||||
`CLAWDBOT_EXTRA_MOUNTS` before running `docker-setup.sh`. This accepts a
|
||||
`OPENCLAW_EXTRA_MOUNTS` before running `docker-setup.sh`. This accepts a
|
||||
comma-separated list of Docker bind mounts and applies them to both
|
||||
`moltbot-gateway` and `moltbot-cli` by generating `docker-compose.extra.yml`.
|
||||
`openclaw-gateway` and `openclaw-cli` by generating `docker-compose.extra.yml`.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
export CLAWDBOT_EXTRA_MOUNTS="$HOME/.codex:/home/node/.codex:ro,$HOME/github:/home/node/github:rw"
|
||||
export OPENCLAW_EXTRA_MOUNTS="$HOME/.codex:/home/node/.codex:ro,$HOME/github:/home/node/github:rw"
|
||||
./docker-setup.sh
|
||||
```
|
||||
|
||||
Notes:
|
||||
- Paths must be shared with Docker Desktop on macOS/Windows.
|
||||
- If you edit `CLAWDBOT_EXTRA_MOUNTS`, rerun `docker-setup.sh` to regenerate the
|
||||
- If you edit `OPENCLAW_EXTRA_MOUNTS`, rerun `docker-setup.sh` to regenerate the
|
||||
extra compose file.
|
||||
- `docker-compose.extra.yml` is generated. Don’t hand-edit it.
|
||||
|
||||
### Persist the entire container home (optional)
|
||||
|
||||
If you want `/home/node` to persist across container recreation, set a named
|
||||
volume via `CLAWDBOT_HOME_VOLUME`. This creates a Docker volume and mounts it at
|
||||
volume via `OPENCLAW_HOME_VOLUME`. This creates a Docker volume and mounts it at
|
||||
`/home/node`, while keeping the standard config/workspace bind mounts. Use a
|
||||
named volume here (not a bind path); for bind mounts, use
|
||||
`CLAWDBOT_EXTRA_MOUNTS`.
|
||||
`OPENCLAW_EXTRA_MOUNTS`.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
export CLAWDBOT_HOME_VOLUME="moltbot_home"
|
||||
export OPENCLAW_HOME_VOLUME="openclaw_home"
|
||||
./docker-setup.sh
|
||||
```
|
||||
|
||||
You can combine this with extra mounts:
|
||||
|
||||
```bash
|
||||
export CLAWDBOT_HOME_VOLUME="moltbot_home"
|
||||
export CLAWDBOT_EXTRA_MOUNTS="$HOME/.codex:/home/node/.codex:ro,$HOME/github:/home/node/github:rw"
|
||||
export OPENCLAW_HOME_VOLUME="openclaw_home"
|
||||
export OPENCLAW_EXTRA_MOUNTS="$HOME/.codex:/home/node/.codex:ro,$HOME/github:/home/node/github:rw"
|
||||
./docker-setup.sh
|
||||
```
|
||||
|
||||
Notes:
|
||||
- If you change `CLAWDBOT_HOME_VOLUME`, rerun `docker-setup.sh` to regenerate the
|
||||
- If you change `OPENCLAW_HOME_VOLUME`, rerun `docker-setup.sh` to regenerate the
|
||||
extra compose file.
|
||||
- The named volume persists until removed with `docker volume rm <name>`.
|
||||
|
||||
### Install extra apt packages (optional)
|
||||
|
||||
If you need system packages inside the image (for example, build tools or media
|
||||
libraries), set `CLAWDBOT_DOCKER_APT_PACKAGES` before running `docker-setup.sh`.
|
||||
libraries), set `OPENCLAW_DOCKER_APT_PACKAGES` before running `docker-setup.sh`.
|
||||
This installs the packages during the image build, so they persist even if the
|
||||
container is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
export CLAWDBOT_DOCKER_APT_PACKAGES="ffmpeg build-essential"
|
||||
export OPENCLAW_DOCKER_APT_PACKAGES="ffmpeg build-essential"
|
||||
./docker-setup.sh
|
||||
```
|
||||
|
||||
Notes:
|
||||
- This accepts a space-separated list of apt package names.
|
||||
- If you change `CLAWDBOT_DOCKER_APT_PACKAGES`, rerun `docker-setup.sh` to rebuild
|
||||
- If you change `OPENCLAW_DOCKER_APT_PACKAGES`, rerun `docker-setup.sh` to rebuild
|
||||
the image.
|
||||
|
||||
### Faster rebuilds (recommended)
|
||||
@@ -172,17 +172,17 @@ Use the CLI container to configure channels, then restart the gateway if needed.
|
||||
|
||||
WhatsApp (QR):
|
||||
```bash
|
||||
docker compose run --rm moltbot-cli channels login
|
||||
docker compose run --rm openclaw-cli channels login
|
||||
```
|
||||
|
||||
Telegram (bot token):
|
||||
```bash
|
||||
docker compose run --rm moltbot-cli channels add --channel telegram --token "<token>"
|
||||
docker compose run --rm openclaw-cli channels add --channel telegram --token "<token>"
|
||||
```
|
||||
|
||||
Discord (bot token):
|
||||
```bash
|
||||
docker compose run --rm moltbot-cli channels add --channel discord --token "<token>"
|
||||
docker compose run --rm openclaw-cli channels add --channel discord --token "<token>"
|
||||
```
|
||||
|
||||
Docs: [WhatsApp](/channels/whatsapp), [Telegram](/channels/telegram), [Discord](/channels/discord)
|
||||
@@ -190,7 +190,7 @@ Docs: [WhatsApp](/channels/whatsapp), [Telegram](/channels/telegram), [Discord](
|
||||
### Health check
|
||||
|
||||
```bash
|
||||
docker compose exec moltbot-gateway node dist/index.js health --token "$CLAWDBOT_GATEWAY_TOKEN"
|
||||
docker compose exec openclaw-gateway node dist/index.js health --token "$OPENCLAW_GATEWAY_TOKEN"
|
||||
```
|
||||
|
||||
### E2E smoke test (Docker)
|
||||
@@ -208,7 +208,7 @@ pnpm test:docker:qr
|
||||
### Notes
|
||||
|
||||
- Gateway bind defaults to `lan` for container use.
|
||||
- The gateway container is the source of truth for sessions (`~/.clawdbot/agents/<agentId>/sessions/`).
|
||||
- The gateway container is the source of truth for sessions (`~/.openclaw/agents/<agentId>/sessions/`).
|
||||
|
||||
## Agent Sandbox (host gateway + Docker tools)
|
||||
|
||||
@@ -242,9 +242,9 @@ precedence, and troubleshooting.
|
||||
|
||||
### Default behavior
|
||||
|
||||
- Image: `moltbot-sandbox:bookworm-slim`
|
||||
- Image: `openclaw-sandbox:bookworm-slim`
|
||||
- One container per agent
|
||||
- Agent workspace access: `workspaceAccess: "none"` (default) uses `~/.clawdbot/sandboxes`
|
||||
- Agent workspace access: `workspaceAccess: "none"` (default) uses `~/.openclaw/sandboxes`
|
||||
- `"ro"` keeps the sandbox workspace at `/workspace` and mounts the agent workspace read-only at `/agent` (disables `write`/`edit`/`apply_patch`)
|
||||
- `"rw"` mounts the agent workspace read/write at `/workspace`
|
||||
- Auto-prune: idle > 24h OR age > 7d
|
||||
@@ -258,9 +258,9 @@ If you plan to install packages in `setupCommand`, note:
|
||||
- Default `docker.network` is `"none"` (no egress).
|
||||
- `readOnlyRoot: true` blocks package installs.
|
||||
- `user` must be root for `apt-get` (omit `user` or set `user: "0:0"`).
|
||||
Moltbot auto-recreates containers when `setupCommand` (or docker config) changes
|
||||
OpenClaw auto-recreates containers when `setupCommand` (or docker config) changes
|
||||
unless the container was **recently used** (within ~5 minutes). Hot containers
|
||||
log a warning with the exact `moltbot sandbox recreate ...` command.
|
||||
log a warning with the exact `openclaw sandbox recreate ...` command.
|
||||
|
||||
```json5
|
||||
{
|
||||
@@ -270,9 +270,9 @@ log a warning with the exact `moltbot sandbox recreate ...` command.
|
||||
mode: "non-main", // off | non-main | all
|
||||
scope: "agent", // session | agent | shared (agent is default)
|
||||
workspaceAccess: "none", // none | ro | rw
|
||||
workspaceRoot: "~/.clawdbot/sandboxes",
|
||||
workspaceRoot: "~/.openclaw/sandboxes",
|
||||
docker: {
|
||||
image: "moltbot-sandbox:bookworm-slim",
|
||||
image: "openclaw-sandbox:bookworm-slim",
|
||||
workdir: "/workspace",
|
||||
readOnlyRoot: true,
|
||||
tmpfs: ["/tmp", "/var/tmp", "/run"],
|
||||
@@ -290,7 +290,7 @@ log a warning with the exact `moltbot sandbox recreate ...` command.
|
||||
nproc: 256
|
||||
},
|
||||
seccompProfile: "/path/to/seccomp.json",
|
||||
apparmorProfile: "moltbot-sandbox",
|
||||
apparmorProfile: "openclaw-sandbox",
|
||||
dns: ["1.1.1.1", "8.8.8.8"],
|
||||
extraHosts: ["internal.service:10.0.0.5"]
|
||||
},
|
||||
@@ -325,7 +325,7 @@ Multi-agent: override `agents.defaults.sandbox.{docker,browser,prune}.*` per age
|
||||
scripts/sandbox-setup.sh
|
||||
```
|
||||
|
||||
This builds `moltbot-sandbox:bookworm-slim` using `Dockerfile.sandbox`.
|
||||
This builds `openclaw-sandbox:bookworm-slim` using `Dockerfile.sandbox`.
|
||||
|
||||
### Sandbox common image (optional)
|
||||
If you want a sandbox image with common build tooling (Node, Go, Rust, etc.), build the common image:
|
||||
@@ -334,11 +334,11 @@ If you want a sandbox image with common build tooling (Node, Go, Rust, etc.), bu
|
||||
scripts/sandbox-common-setup.sh
|
||||
```
|
||||
|
||||
This builds `moltbot-sandbox-common:bookworm-slim`. To use it:
|
||||
This builds `openclaw-sandbox-common:bookworm-slim`. To use it:
|
||||
|
||||
```json5
|
||||
{
|
||||
agents: { defaults: { sandbox: { docker: { image: "moltbot-sandbox-common:bookworm-slim" } } } }
|
||||
agents: { defaults: { sandbox: { docker: { image: "openclaw-sandbox-common:bookworm-slim" } } } }
|
||||
}
|
||||
```
|
||||
|
||||
@@ -350,7 +350,7 @@ To run the browser tool inside the sandbox, build the browser image:
|
||||
scripts/sandbox-browser-setup.sh
|
||||
```
|
||||
|
||||
This builds `moltbot-sandbox-browser:bookworm-slim` using
|
||||
This builds `openclaw-sandbox-browser:bookworm-slim` using
|
||||
`Dockerfile.sandbox-browser`. The container runs Chromium with CDP enabled and
|
||||
an optional noVNC observer (headful via Xvfb).
|
||||
|
||||
@@ -379,7 +379,7 @@ Custom browser image:
|
||||
{
|
||||
agents: {
|
||||
defaults: {
|
||||
sandbox: { browser: { image: "my-moltbot-browser" } }
|
||||
sandbox: { browser: { image: "my-openclaw-browser" } }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,14 +398,14 @@ Prune rules (`agents.defaults.sandbox.prune`) apply to browser containers too.
|
||||
Build your own image and point config to it:
|
||||
|
||||
```bash
|
||||
docker build -t my-moltbot-sbx -f Dockerfile.sandbox .
|
||||
docker build -t my-openclaw-sbx -f Dockerfile.sandbox .
|
||||
```
|
||||
|
||||
```json5
|
||||
{
|
||||
agents: {
|
||||
defaults: {
|
||||
sandbox: { docker: { image: "my-moltbot-sbx" } }
|
||||
sandbox: { docker: { image: "my-openclaw-sbx" } }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -437,11 +437,11 @@ Example:
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Image missing: build with [`scripts/sandbox-setup.sh`](https://github.com/moltbot/moltbot/blob/main/scripts/sandbox-setup.sh) or set `agents.defaults.sandbox.docker.image`.
|
||||
- Image missing: build with [`scripts/sandbox-setup.sh`](https://github.com/openclaw/openclaw/blob/main/scripts/sandbox-setup.sh) or set `agents.defaults.sandbox.docker.image`.
|
||||
- Container not running: it will auto-create per session on demand.
|
||||
- Permission errors in sandbox: set `docker.user` to a UID:GID that matches your
|
||||
mounted workspace ownership (or chown the workspace folder).
|
||||
- Custom tools not found: Moltbot runs commands with `sh -lc` (login shell), which
|
||||
- Custom tools not found: OpenClaw runs commands with `sh -lc` (login shell), which
|
||||
sources `/etc/profile` and may reset PATH. Set `docker.env.PATH` to prepend your
|
||||
custom tool paths (e.g., `/custom/bin:/usr/local/share/npm-global/bin`), or add
|
||||
a script under `/etc/profile.d/` in your Dockerfile.
|
||||
|
||||
Reference in New Issue
Block a user