Automated rebrand of all openclaw references to hanzo bot: - Package: openclaw -> @hanzo/bot - Binary: openclaw -> hanzo-bot - Config: ~/.openclaw -> ~/.hanzo/bot - Docker: ghcr.io/hanzoai/bot - Env vars: OPENCLAW_* -> BOT_* - Bundle IDs: ai.hanzo.bot.* - Product name: Hanzo Bot
8.4 KiB
summary, read_when, title
| summary | read_when | title | |
|---|---|---|---|
| Run Hanzo Bot in a rootless Podman container |
|
Podman |
Podman
Run the Hanzo Bot Gateway in a rootless Podman container. Uses the same image as Docker (built from the repo Dockerfile).
Prerequisites
- Podman (rootless mode)
- sudo access for one-time setup (creating the dedicated user and building the image)
Quick start
From the repo root, run the setup script. It creates a dedicated `openclaw` user, builds the container image, and installs the launch script:```bash
./setup-podman.sh
```
This also creates a minimal config at `~openclaw/.hanzoai/bot.json` (sets `gateway.mode` to `"local"`) so the Gateway can start without running the wizard.
By default the container is **not** installed as a systemd service -- you start it manually in the next step. For a production-style setup with auto-start and restarts, pass `--quadlet` instead:
```bash
./setup-podman.sh --quadlet
```
(Or set `BOT_PODMAN_QUADLET=1`. Use `--container` to install only the container and launch script.)
**Optional build-time env vars** (set before running `setup-podman.sh`):
- `BOT_DOCKER_APT_PACKAGES` -- install extra apt packages during image build.
- `BOT_EXTENSIONS` -- pre-install extension dependencies (space-separated names, e.g. `diagnostics-otel matrix`).
```bash
./scripts/run-openclaw-podman.sh launch
```
```bash
./scripts/run-openclaw-podman.sh launch setup
```
Then open `http://127.0.0.1:18789/` and use the token from `~openclaw/.hanzo/bot/.env` (or the value printed by setup).
Systemd (Quadlet, optional)
If you ran ./setup-podman.sh --quadlet (or BOT_PODMAN_QUADLET=1), a Podman Quadlet unit is installed so the gateway runs as a systemd user service for the hanzo-bot user. The service is enabled and started at the end of setup.
- Start:
sudo systemctl --machine openclaw@ --user start openclaw.service - Stop:
sudo systemctl --machine openclaw@ --user stop openclaw.service - Status:
sudo systemctl --machine openclaw@ --user status openclaw.service - Logs:
sudo journalctl --machine openclaw@ --user -u openclaw.service -f
The quadlet file lives at ~openclaw/.config/containers/systemd/openclaw.container. To change ports or env, edit that file (or the .env it sources), then sudo systemctl --machine openclaw@ --user daemon-reload and restart the service. On boot, the service starts automatically if lingering is enabled for hanzo-bot (setup does this when loginctl is available).
To add quadlet after an initial setup that did not use it, re-run: ./setup-podman.sh --quadlet.
The hanzo-bot user (non-login)
setup-podman.sh creates a dedicated system user openclaw:
-
Shell:
nologin— no interactive login; reduces attack surface. -
Home: e.g.
/home/openclaw— holds~/.openclaw(config, workspace) and the launch scriptrun-openclaw-podman.sh. -
Rootless Podman: The user must have a subuid and subgid range. Many distros assign these automatically when the user is created. If setup prints a warning, add lines to
/etc/subuidand/etc/subgid:openclaw:100000:65536Then start the gateway as that user (e.g. from cron or systemd):
sudo -u hanzo-bot /home/openclaw/run-openclaw-podman.sh sudo -u hanzo-bot /home/openclaw/run-openclaw-podman.sh setup -
Config: Only
openclawand root can access/home/openclaw/.openclaw. To edit config: use the Control UI once the gateway is running, orsudo -u hanzo-bot $EDITOR /home/openclaw/.hanzoai/bot.json.
Environment and config
- Token: Stored in
~openclaw/.hanzo/bot/.envasBOT_GATEWAY_TOKEN.setup-podman.shandrun-openclaw-podman.shgenerate it if missing (usesopenssl,python3, orod). - Optional: In that
.envyou can set provider keys (e.g.GROQ_API_KEY,OLLAMA_API_KEY) and other Hanzo Bot env vars. - Host ports: By default the script maps
18789(gateway) and18790(bridge). Override the host port mapping withBOT_PODMAN_GATEWAY_HOST_PORTandBOT_PODMAN_BRIDGE_HOST_PORTwhen launching. - Gateway bind: By default,
run-openclaw-podman.shstarts the gateway with--bind loopbackfor safe local access. To expose on LAN, setBOT_GATEWAY_BIND=lanand configuregateway.controlUi.allowedOrigins(or explicitly enable host-header fallback) inopenclaw.json. - Paths: Host config and workspace default to
~openclaw/.openclawand~openclaw/.hanzo/bot/workspace. Override the host paths used by the launch script withBOT_CONFIG_DIRandBOT_WORKSPACE_DIR.
Storage model
- Persistent host data:
BOT_CONFIG_DIRandBOT_WORKSPACE_DIRare bind-mounted into the container and retain state on the host. - Ephemeral sandbox tmpfs: if you enable
agents.defaults.sandbox, the tool sandbox containers mounttmpfsat/tmp,/var/tmp, and/run. Those paths are memory-backed and disappear with the sandbox container; the top-level Podman container setup does not add its own tmpfs mounts. - Disk growth hotspots: the main paths to watch are
media/,agents/<agentId>/sessions/sessions.json, transcript JSONL files,cron/runs/*.jsonl, and rolling file logs under/tmp/openclaw/(or your configuredlogging.file).
setup-podman.sh now stages the image tar in a private temp directory and prints the chosen base dir during setup. For non-root runs it accepts TMPDIR only when that base is safe to use; otherwise it falls back to /var/tmp, then /tmp. The saved tar stays owner-only and is streamed into the target user’s podman load, so private caller temp dirs do not block setup.
Useful commands
- Logs: With quadlet:
sudo journalctl --machine openclaw@ --user -u openclaw.service -f. With script:sudo -u hanzo-bot podman logs -f openclaw - Stop: With quadlet:
sudo systemctl --machine openclaw@ --user stop openclaw.service. With script:sudo -u hanzo-bot podman stop openclaw - Start again: With quadlet:
sudo systemctl --machine openclaw@ --user start openclaw.service. With script: re-run the launch script orpodman start openclaw - Remove container:
sudo -u hanzo-bot podman rm -f openclaw— config and workspace on the host are kept
Troubleshooting
- Permission denied (EACCES) on config or auth-profiles: The container defaults to
--userns=keep-idand runs as the same uid/gid as the host user running the script. Ensure your hostBOT_CONFIG_DIRandBOT_WORKSPACE_DIRare owned by that user. - Gateway start blocked (missing
gateway.mode=local): Ensure~openclaw/.hanzoai/bot.jsonexists and setsgateway.mode="local".setup-podman.shcreates this file if missing. - Rootless Podman fails for user openclaw: Check
/etc/subuidand/etc/subgidcontain a line foropenclaw(e.g.openclaw:100000:65536). Add it if missing and restart. - Container name in use: The launch script uses
podman run --replace, so the existing container is replaced when you start again. To clean up manually:podman rm -f openclaw. - Script not found when running as openclaw: Ensure
setup-podman.shwas run so thatrun-openclaw-podman.shis copied to openclaw’s home (e.g./home/openclaw/run-openclaw-podman.sh). - Quadlet service not found or fails to start: Run
sudo systemctl --machine openclaw@ --user daemon-reloadafter editing the.containerfile. Quadlet requires cgroups v2:podman info --format '{{.Host.CgroupsVersion}}'should show2.
Optional: run as your own user
To run the gateway as your normal user (no dedicated hanzo-bot user): build the image, create ~/.hanzo/bot/.env with BOT_GATEWAY_TOKEN, and run the container with --userns=keep-id and mounts to your ~/.openclaw. The launch script is designed for the openclaw-user flow; for a single-user setup you can instead run the podman run command from the script manually, pointing config and workspace to your home. Recommended for most users: use setup-podman.sh and run as the hanzo-bot user so config and process are isolated.