GuidesGetting started

Running OpenClaw in Docker: images, volumes, and the port-binding trap

The official Docker setup, what must be volume-mounted for your agent to survive, and the default that quietly puts the Gateway on your network.

July 17, 2026Updated October 9, 2026The Everpod team
The short answer

OpenClaw ships official Docker images (ghcr.io/openclaw/openclaw) and a Compose-based setup. Three things decide whether your containerized agent thrives: mount the state directories as volumes (or your agent’s memory dies with the container), pin a version tag instead of latest, and check what the Gateway port is bound to. The Docker setup’s default bind is lan, which is broader than the loopback default you may expect from a native install.

The official images

Images are published to GitHub Container Registry, with a Docker Hub mirror (whether to run these prebuilt images at all, versus npm or building from source, is its own decision):

Volumes: the difference between an agent and an amnesiac

Inside the container, OpenClaw’s state lives under /home/node/.openclaw (config, sessions, workspace) and /home/node/.config/openclaw (auth secrets). The official Compose file mounts both from the host. The docs put it plainly: those paths survive container replacement. Everything rides on that mount: your agent’s whole identity is that directory. Get it right and containers become disposable: you can recreate, upgrade, and reboot and the agent comes back itself. Get it wrong and the first docker compose down erases your agent’s mind.

The port-binding trap

The one setting worth double-checking before anything else: the official Docker setup defaults the Gateway bind to lan (so the host can reach the dashboard through Docker’s port publishing), and the Compose file publishes port 18789. On a laptop behind a home router that’s merely worth knowing. On a VPS with a public address, a published Gateway port is the exact exposure OpenClaw’s own security docs say must never happen: an unauthenticated Gateway is remote control of a machine that can run commands. On any internet-facing host: bind to loopback (OPENCLAW_GATEWAY_BIND=loopback), publish the port to 127.0.0.1 only or not at all, and run openclaw security audit (inside the container, via docker compose exec) after every networking change.

Setup, and the fine print worth knowing

The repo ships a setup script (./scripts/docker/setup.sh) that prompts for provider keys, generates a Gateway token into .env (kept out of the container itself: .env vs env_file matters here), and starts Compose; there’s also a manual flow (docker compose run the onboarding, then docker compose up -d). Three facts from the official docs that save real debugging time:

If you’d rather have all of that arrive assembled, that is what Everpod’s OpenClaw pod is; if you’re building it yourself, the safe-hosting checklist is the standard worth holding your setup to.

Give your AI agents a permanent cloud computer.

We set it up and secure it, so all you do is use them. Run Claude Code, Codex or any agent you use, more at once than your laptop can hold, and keep them working when it’s closed. Or have OpenClaw set up and run for you.

See the developer pod

From $24/mo · your own plan or API key

Get your OpenClaw agent

$29/mo, cancel anytime · model usage included