OpenClaw Docker: run it on a VPS, in Docker or one click
An OpenClaw Docker setup takes four commands: clone the repository, point OPENCLAW_IMAGE at the official pre-built image and run ./scripts/docker/setup.sh. The script pulls the image, asks for your model provider key, writes a gateway token to .env and starts the gateway with Docker Compose on http://127.0.0.1:18789/. We ran it on 15 November 2026 with OpenClaw 2026.11.3 and Docker 29.9.3. Setup took 55 to 62 seconds on a machine with 2 vCPU and 4 GB of RAM, and the gateway answered its health check within about 40 seconds after that.
git clone https://github.com/openclaw/openclaw.git
cd openclaw
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.shIf you would rather not install Docker, Lizard has a one-click template: deploy OpenClaw on Lizard and the gateway comes up on an HTTPS domain. To rehearse the Docker steps away from your own machine, start a disposable sandbox in Lizard Sandboxes with the Lizard CLI: lizard sandbox create -t base -s small --timeout 3000000. We ran the Docker commands in this guide in one.
Lizard publishes this guide. Prices were read from each provider's pricing page on 15 November 2026. We ran the setup script with OPENCLAW_SKIP_ONBOARDING=1 and no model key, so the setup, health, channel, backup and update commands are tested and model replies are not. Commands we only read in the docs are marked as such.
What do you need to run OpenClaw?
You need a model provider key, Docker with Compose v2, about 2 GB of RAM and a directory where OpenClaw can keep its state. OpenClaw is an MIT-licensed gateway (github.com/openclaw/openclaw) that sits between your model provider and chat channels such as Telegram, WhatsApp and Discord.
- A model key, for example
OPENAI_API_KEYorANTHROPIC_API_KEY. Without one the gateway starts and cannot answer. - Docker Desktop or Docker Engine with Docker Compose v2. The OpenClaw Docker docs ask for "At least 6 GB RAM for a local source image build" and add that "pre-built images avoid this build requirement".
- Memory and disk. In our test the pre-built image took 2.97 GB of disk, and the idle gateway held 1.22 to 1.32 GiB of RAM with no channels connected, across three runs. A 1 GB machine is too small.
- State. Compose bind-mounts three host directories:
~/.openclaw(config, SQLite databases, credentials),~/.openclaw/workspace(the agent's files) and~/.openclaw-auth-profile-secrets. - Ports. The Compose file publishes 18789 for the gateway and its Control UI, 18790 for the bridge and 3978 for Microsoft Teams.
Channels are optional. For Telegram you need a bot token from BotFather; the Telegram bot guide shows how to get one.
How do you run OpenClaw with Docker?
Run the four commands above from a terminal, answer the onboarding prompts, then open http://127.0.0.1:18789/ and paste the token from .env. Guides from early 2026 call a script named docker-setup.sh. On 15 November 2026 that file was gone from the repository root, and the script lives at scripts/docker/setup.sh.
Use the official images only. The docs name ghcr.io/openclaw/openclaw as the primary registry and openclaw/openclaw on Docker Hub as its mirror, and tell you to "avoid unofficial mirrors". The latest-browser tag adds Chromium for the browser the gateway controls.
Check that the gateway is up:
curl -fsS http://127.0.0.1:18789/healthz
curl -fsS http://127.0.0.1:18789/readyzWe got {"ok":true,"status":"live"} and {"ready":true}. For the first seconds after start /readyz returned 503, so give it a few seconds before you debug.
Add a channel
The docs add Telegram through the openclaw-cli container. On 2026.11.3 that container refused every command that writes config while the gateway was running, with the error "cannot verify Gateway ownership from this process (different PID namespace)". The same command inside the gateway container worked and printed Added Telegram account "default".:
docker compose exec openclaw-gateway node dist/index.js \
channels add --channel telegram --token "<token>"Use the same docker compose exec openclaw-gateway node dist/index.js prefix for config set. Read-only commands such as devices list still worked through openclaw-cli. Rerunning setup.sh hit the same error until we stopped the gateway with docker compose stop openclaw-gateway.
Back up, then update
OpenClaw writes its own backup archive. The output path must sit outside the state directory, so write to /tmp in the container and copy the file out:
docker compose exec openclaw-gateway node dist/index.js \
backup create --output /tmp --verify
docker compose cp "openclaw-gateway:/tmp/<archive>.tar.gz" .Ours printed "Archive verification: passed" and was 210 KB on a fresh install. Then update with the three commands from the docs:
docker compose pull openclaw-gateway openclaw-cli
docker compose stop openclaw-gateway
docker compose up -d openclaw-gatewayOn start, the image runs openclaw doctor --fix against the mounted state, so the docs say routine upgrades need no separate repair step. State survives because it lives on the host: after docker compose down our ~/.openclaw still held openclaw.json and the state folder.
How do you run OpenClaw on a VPS?
Run the same Docker steps on a Debian or Ubuntu server, keep port 18789 closed to the internet and reach the Control UI through an SSH tunnel. The OpenClaw Hetzner guide says: "Do not add a public inbound rule for TCP 18789".
Size the server for the measured 1.2 to 1.3 GiB idle footprint, with room for tool runs. These plans were listed on 15 November 2026:
| Provider and plan | vCPU / RAM / disk | Price | Source |
|---|---|---|---|
| Hetzner CX23 | 2 / 4 GB / 40 GB | from €5.99 a month, excl. VAT; shown as unavailable when we checked | hetzner.com/cloud/cost-optimized |
| Hostinger KVM 1 | 1 / 4 GB / 50 GB | $6.49 a month on a 24-month term, renews at $11.99 | hostinger.com/vps/docker/openclaw |
| DigitalOcean Basic | 1 / 2 GiB / 50 GiB | $12 a month | digitalocean.com/pricing/droplets |
| DigitalOcean Basic | 2 / 4 GiB / 80 GiB | $24 a month | same page |
The Hetzner guide installs Docker with curl -fsSL https://get.docker.com | sh (we did not run that line). Clone the repository and run the setup script as above, then check three things.
The firewall comes first. Compose published the gateway on 0.0.0.0:18789 in our test, which means every network interface. Block it in the provider's cloud firewall and allow only SSH. The OpenClaw docs also point to Docker's DOCKER-USER chain if you filter on the host.
For access, the docs open a tunnel from your laptop, after which you browse to http://127.0.0.1:18789/:
ssh -N -L 18789:127.0.0.1:18789 root@<vps-ip>Then run the audit. On the default Docker setup security audit reported "0 critical · 1 warn · 1 info". The warning was "No auth rate limiting configured". Setting gateway.auth.rateLimit to {"maxAttempts":10,"windowMs":60000,"lockoutMs":300000} cleared it.
The Compose file sets restart: unless-stopped, so the gateway comes back after a reboot when Docker starts at boot. If you skip Docker, the docs say openclaw onboard --install-daemon installs a systemd user unit; we did not test that path. Back up all three state directories. The docs warn that OAuth tokens sit in plaintext in SQLite under the config directory, so treat every copy as a credential.
How do you deploy OpenClaw on Lizard?
Open the OpenClaw template, click Deploy Now and set ANTHROPIC_API_KEY or OPENAI_API_KEY as a variable. We did not deploy the template for this article. According to its page on 15 November 2026, it builds OpenClaw from the repository's Dockerfile, gives the gateway a public HTTPS domain, and generates a gateway token on boot that it prints once to the deploy logs.
The template does not keep state. Its page says "this template has no persistent volume", so a restart resets chat history and connected channels and issues a new token. That fits a trial run or a stateless gateway. For an assistant that must remember things for months, use a VPS with the state on disk.
The template runs as a Lizard app, the kind you can also deploy from your coding agent. Apps are billed by the second at $18.26 per active vCPU a month and $9.13 per active GB of memory a month (Lizard pricing, 15 November 2026). The template page estimates about $5.40 a month for light use and $12.61 for an active daily assistant. Our own Docker measurement points to the upper figure: 1.32 GiB (1.42 GB) of idle memory at $9.13 per GB comes to about $13 a month before CPU, if the template uses the same amount. Lizard Pro costs $19 a month and includes $19 of usage. New accounts start with a 7-day trial that needs a card and includes $5 of usage.
Docker vs VPS vs managed: which should you use?
Use Docker on your own machine to learn OpenClaw, a VPS for an assistant that stays on and keeps its memory, and a managed deploy when you want a public gateway without server work. The same questions about processes, storage and uptime apply to any long-running service, as in our guide to Python app hosting.
| Docker on your machine | Docker on a VPS | Lizard template | |
|---|---|---|---|
| Monthly cost | $0 for hosting | About $6 to $24 (plans above) | Usage inside the $19 Pro plan; about $5 to $13 by the estimates above |
| Always on | Only while the machine is awake | Yes | Yes |
| What the agent's tools can reach | The gateway container, the mounted ~/.openclaw folders and your network | The VPS and nothing on your laptop | The app container and nothing on your laptop |
| State after a restart | Kept on your disk | Kept on the server's disk | Reset; new token (template page, 15 Nov 2026) |
| Updates | Three Compose commands | Three Compose commands, plus OS patches | A new deploy builds from the repository (template page) |
| Backups | Yours to run | Yours to run | Nothing to back up while state is not kept |
| Reaching it from a phone | Needs a tunnel or tailnet | SSH tunnel or tailnet | Public HTTPS domain with token auth |
Model usage is billed by your provider in all three cases and is often the larger bill.
How do you keep OpenClaw's tools from touching your machine?
Turn on OpenClaw's sandbox for tool calls, and run the gateway on a machine that holds nothing you care about. Docker alone does not isolate tool calls. The OpenClaw docs state: "Sandboxing is off by default". Until you change that, the agent's shell and file tools run inside the gateway container with access to the mounted folders.
The setting is agents.defaults.sandbox.mode, with the values off, non-main and all. The docs give this minimal example:
{
agents: {
defaults: {
sandbox: { mode: "non-main", scope: "session", workspaceAccess: "none" },
},
},
}With the Docker backend and scope: "session", each sandboxed session gets its own container for exec, read, write and edit calls. The docs describe the limit: "This is not a perfect security boundary, but it materially limits filesystem and process access when the model does something dumb."
The pre-built image cannot run the sandbox. We ran OPENCLAW_SANDBOX=1 ./scripts/docker/setup.sh and the script skipped sandbox setup with "Docker CLI not found inside the container image". The sandbox needs a locally built image, which is the build that wants 6 GB of RAM; we did not run that build. It also mounts the host's Docker socket into the gateway, and anything that can use that socket controls Docker on the host.
A separate machine covers what the sandbox setting does not. A VPS keeps the agent away from your laptop. For short experiments, Lizard Sandboxes do the same without a monthly server: each sandbox is a Firecracker microVM with its own kernel, and a Small costs $0.0162 an hour, billed per second. The base template is Alpine Linux without Docker, so we installed it first:
lizard sandbox create -t base -s small --timeout 3000000
lizard sandbox exec <id> -- sh -c '
apk add --no-cache docker docker-cli-compose bash e2fsprogs
mount -t cgroup2 none /sys/fs/cgroup
truncate -s 14G /docker.img && mkfs.ext4 -q -F /docker.img
mkdir -p /var/lib/docker && mount -o loop /docker.img /var/lib/docker
(dockerd >/var/log/dockerd.log 2>&1 &)'The loop-mounted disk is needed because the image would not unpack on the sandbox's root file system. Use a sandbox as a test bench. It cannot host the gateway for long: on the trial every sandbox is deleted after 1 hour at the latest (limits), and on a paid plan a VM stops after at most 596 hours. Delete it with lizard sandbox rm <id> when you finish.
FAQ
Is there an official OpenClaw Docker image? Yes. The OpenClaw docs name ghcr.io/openclaw/openclaw as the primary registry and openclaw/openclaw on Docker Hub as a mirror of the same release. Other images on Docker Hub are unofficial, and the docs advise against them.
How much RAM does OpenClaw need in Docker? The docs ask for at least 6 GB to build the image from source and none of that for the pre-built image. In our tests on 15 November 2026 the idle gateway on 2026.11.3 used 1.22 to 1.32 GiB with no channels connected.
What port does OpenClaw use? The gateway and Control UI listen on 18789. The Compose file also publishes 18790 for the bridge and 3978 for Microsoft Teams.
Should I run OpenClaw in Docker or install it with npm? The OpenClaw docs call Docker optional: "Use it for an isolated, throwaway Gateway environment or a host without local installs. If you already develop on your own machine, use the normal install flow instead."
Does Docker isolate OpenClaw's tools from my computer? Only partly. Tools run in the gateway container and can read and write the mounted ~/.openclaw folders. Per-session isolation needs agents.defaults.sandbox.mode set to non-main or all, and that is off by default.
How do I update OpenClaw in Docker? Back up, then run docker compose pull openclaw-gateway openclaw-cli, docker compose stop openclaw-gateway and docker compose up -d openclaw-gateway. The image repairs and migrates the mounted state when it starts.
Can I expose the OpenClaw gateway to the internet? The OpenClaw VPS docs advise against opening port 18789 and recommend an SSH tunnel or Tailscale. A gateway bound beyond loopback requires a token or password, and the token works like a password for the whole gateway.
Build with AI. Ship with Lizard
You don't need a platform team to go live. Your whole cloud, one CLI command away.
- Services
- —
- Add-ons
- —
- Deployments
- —
- Sandbox starts
- —