A minimal, production-ready guide to deploying OpenClaw (standalone) using Docker on a Linux based Server.
Caution
SECURITY WARNING: DO NOT EXPOSE THIS PUBLICLY WITHOUT PROTECTION
The OpenClaw Gateway is designed as an internal communication component. It should NOT be open to the public internet indiscriminately.
You MUST restrict access to your domain using one of the following methods:
- Cloudflare Access / Zero Trust: Put the domain behind an authentication layer. SSL is included and free (RECOMMENDED!)
- Firewall Rules: Allow inbound traffic on port 80/443 ONLY from your specific IP address. You will need to use
allowInsecureAuthon the OpenClaw config, if you want to access it without HTTPS. - VPN: Only allow access while connected to your private VPN. You will need to use
allowInsecureAuthon the OpenClaw config, if you want to access it without HTTPS.
Get a Domain and register it on Cloudflare. You need to enable the "SSL Flexible" setting to make it work without any SSL hassle on your Server. Either change it domain-wide (on .../ssl-tls/configuration) or create a specific rule.
⚠️ If you don't want to use Cloudflare, you will need to configure SSL yourself (e.g. with Let's Encrypt) and expose port 443 instead of 80.
Then, add an A-Record pointing your domain to your server's IP address (with Cloudflare proxy enabled).
OpenClaw runs as the node user (UID 1000). We must pre-create the host volumes and assign the correct ownership, otherwise the container will crash with EACCES errors.
mkdir -p $HOME/openclaw/workspace
chown -R 1000:1000 $HOME/openclawGenerate a random Gateway Token using this:
export OPENCLAW_GATEWAY_TOKEN=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 32; echo '')
echo "Your Gateway Token is: $OPENCLAW_GATEWAY_TOKEN"docker run -d \
--name openclaw \
--restart unless-stopped \
-p 80:18789 \
-v $HOME/openclaw:/home/node/.openclaw \
-v $HOME/openclaw/workspace:/home/node/.openclaw/workspace \
-e OPENCLAW_GATEWAY_TOKEN=$OPENCLAW_GATEWAY_TOKEN \
ghcr.io/openclaw/openclaw:latest \
node openclaw.mjs gateway --allow-unconfigured --bind lanOptionally check docker logs -f openclaw to see if there are any errors.
- Open https://your-domain.com/overview
- Enter your newly generated Gateway Token and click
Connect. You will seedisconnected (1008): pairing required. - Run
docker exec -it openclaw node openclaw.mjs devices listand you will find a Pending request. Copy the Request UUID. - Run
docker exec -it openclaw node openclaw.mjs devices approve <request-uuid> - Reload https://your-domain.com/overview and it should say
Connected - Run
docker exec -it openclaw node openclaw.mjs onboardto complete the initial setup.
