Docker says configuration is missing after restart

Adapted community discussion: Paraphrased and condensed from an anonymized public OpenClaw Discord support conversation from August 2026. Technical guidance was reviewed for OpenClaw 2026.9.3.

I am writing a Compose file for the Gateway with a non-default UID and GID. Each instance should have its own persistent host directory, owned by that UID and GID. My current file mounts state under /home/.openclaw, exposes port 3000, makes the root filesystem read-only, and passes gateway.mode=local as an environment entry. What needs to change?

The main problem is the container path. Mount a unique absolute host directory at /home/node/.openclaw, set HOME to /home/node, and use the same state/config paths inside that directory. Expose the Gateway on port 18789, and create the host directories with ownership matching the container UID and GID before startup.

gateway.mode is an OpenClaw config key, not a normal environment variable. Set it through the CLI inside the one-off Compose container, then start the service:

docker compose run --rm --no-deps --entrypoint node openclaw-gateway \
  dist/index.js config set gateway.mode local
docker compose up -d

A fully internal Docker network also blocks outbound provider access, so keep outbound networking available. If the root filesystem stays read-only, make sure every required writable path is a volume or temporary filesystem.

After bringing it up, the Gateway logs say Missing config and ask me to run setup or set gateway.mode=local.

That means the Gateway still cannot read a persistent openclaw.json. Confirm that /home/node/.openclaw is backed by the intended host directory, then run onboarding through the same Compose service:

docker compose run --rm --no-deps --entrypoint node openclaw-gateway \
  dist/index.js onboard --mode local --no-install-daemon

docker compose up -d openclaw-gateway

If the message returns after another restart, inspect the mount target and ownership again. --allow-unconfigured is useful for temporary diagnosis, but it should not replace persistent state initialization.