I have compiled common errors and solutions encountered when running OpenClaw in Docker.
I recreated this because it was difficult to understand.
I wrote an article about how to fix errors that I have experienced.
Table of Contents

Docker Desktop is not running
Cannot access port / Cannot connect to gateway
CLI cannot connect to gateway (1006 abnormal closure)
Dashboard: "unauthorized: gateway token mismatch"
Dashboard: "pairing required"
Docker Desktop is not running
Error DetailsERROR: Cannot connect to the Docker daemon at unix:///Users/<user>/.docker/run/docker.sock
Executing commands while Docker Desktop is not running.
Solution️ Work on Host OS:
For macOS, start Docker Desktop from the terminal with the following command:
# Docker Desktop を起動 open -a "Docker Desktop" 起動確認 docker info
Startup is complete if the docker info command displays information normally.
Cannot access port / Cannot connect to gateway
Error DetailsThe Gateway container is running
Cannot access the Gateway from a browser or CLI
Connection refused error occurs
The port binding configuration in docker-compose.yml does not match the OPENCLAW_GATEWAY_BIND setting in .env.
In the default compose file:
ports: - "$OPENCLAW_GATEWAY_PORT:-18789:18789"
It is configured like this, binding to 127.0.0.1 (localhost only), but in .env, it may be set to OPENCLAW_GATEWAY_BIND=lan.
SolutionWork on Host OS: Edit docker-compose.yml
To allow LAN access (all network interfaces):
# docker-compose.yml ports: - "0.0.0.0:$OPENCLAW_GATEWAY_PORT:-18789:18789" - "0.0.0.0:$OPENCLAW_BRIDGE_PORT:-18790:18790"
To allow access only from localhost:
# docker-compose.yml ports: - "127.0.0.1:$OPENCLAW_GATEWAY_PORT:-18789:18789" - "127.0.0.1:$OPENCLAW_BRIDGE_PORT:-18790:18790"
After editing, restart the service:
docker compose down docker compose up -d
️ Work on Host OS:
# サービスの状態確認 docker compose ps ポートバインディングの確認 netstat -an | grep -E "18789|18790" Linux の場合 ss -ltn | grep -E "18789|18790"
Expected output for 0.0.0.0 binding:
tcp4 0 0 .18789 *. LISTEN
Expected output for 127.0.0.1 binding:
tcp4 0 0 127.0.0.1.18789 . LISTEN
CLI cannot connect to gateway (1006 abnormal closure)
Error details[openclaw] CLI failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason Gateway target: ws://127.0.0.1:18789 Source: local loopback
The CLI container is trying to connect to ws://127.0.0.1:18789, which points to its own loopback, not the Gateway container
The tokens in .env and openclaw.json do not match
Step 1: Fix Docker Compose network mode
Work on Host OS: Edit docker-compose.yml
Configure the CLI to share the Gateway's network:
services: openclaw-cli: network_mode: "service:openclaw-gateway" # ... その他のCLI設定
Step 2: Synchronize tokens
Ensure the tokens in .env and openclaw.json match.
️ Work on Host OS:
# .env のトークンを確認 cat .env | grep OPENCLAW_GATEWAY_TOKEN openclaw.json のトークンを確認 cat ~/.openclaw/openclaw.json | grep -A2 '"auth"'
Work on Host OS: Edit ~/.openclaw/openclaw.json
"gateway": "auth": "mode": "token", "token": "SAME_TOKEN_AS_IN_ENV" , "remote": "token": "SAME_TOKEN_AS_IN_ENV"
Please set the token to the same value as in the .env file.
️ Work on Host OS: Restart Gateway
docker compose restart openclaw-gateway
️ Work on Host OS:
# CLI 接続をテスト docker compose run --rm openclaw-cli devices list
If the device list is displayed without errors, it is successful.
Dashboard: "unauthorized: gateway token mismatch"
Error detailsdisconnected (1008): unauthorized: gateway token mismatch (open the dashboard URL and paste the token in Control UI settings)
The old token stored in the browser's local storage does not match the Gateway's current token.
SolutionOption 1: Use the correct URL with the token
️ Work on Host OS: Retrieve token
cat .env | grep OPENCLAW_GATEWAY_TOKEN
Use the retrieved token to access the dashboard via the following URL:
http://localhost:18789/#token=<YOUR_TOKEN>
Or:
http://127.0.0.1:18789/#token=<YOUR_TOKEN>
Option 2: Clear browser local storage
Open the dashboard page (http://localhost:18789/) in your browser
Open DevTools (F12 or Cmd+Option+I on macOS)
Go to the Application tab
Expand Local Storage → http://localhost:18789
Delete all keys
Reload the page
Access using the correct URL with the token from Option 1
️ Work on the Host OS:
# Gateway のログで接続成功を確認 docker compose logs -f openclaw-gateway | grep -E "(connected|authorized)"
Success if an entry like the following is displayed:
[gateway] connected client=openclaw-control-ui
Dashboard: "pairing required"
Error detailsdisconnected (1008): pairing required
The browser/device is attempting to connect to the Gateway but has not yet been paired/authorized.
SolutionStep 1: Check for pending pairing requests
️ Work on the Host OS:
docker compose run --rm openclaw-cli devices list
Check if the device is displayed in the "Pending" section.
Step 2: Approve the device waiting for pairing
️ Work on Host OS:
# 特定のデバイスを承認 docker compose run --rm openclaw-cli devices approve <DEVICE_ID> すべてのペアリング待ちデバイスを承認 (利用可能な場合) docker compose run --rm openclaw-cli devices approve --all
Step 3: Enable auto-approval (Optional)
Note: This reduces security. Use only in trusted environments.
Work on Host OS: Edit ~/.openclaw/openclaw.json
"nodes": "denyCommands": [ "camera.snap", "camera.clip", "screen.record", "calendar.add", "contacts.add", "reminders.add" ], "approvals": "auto"
️ Work on Host OS: Restart Gateway
docker compose restart openclaw-gateway
️ Work on Host OS:
# デバイスリストを確認 - "Paired" セクションに表示されるはず docker compose run --rm openclaw-cli devices list Gateway のログで自動承認されたデバイスを確認 docker compose logs openclaw-gateway | grep "auto-approved"
Expected output:
Paired (1) ┌────────────────────────────────────────────┬────────────┬──────────────────────────────┬────────────┐ │ Device │ Roles │ Scopes │ Tokens │ ├────────────────────────────────────────────┼────────────┼──────────────────────────────┼────────────┤ │ <device_id> │ operator │ operator.admin, operator.... │ operator │ └────────────────────────────────────────────┴────────────┴──────────────────────────────┴────────────┘
Frequently used commands
Docker Compose commands️ Work on Host OS:
# サービスを起動 docker compose up -d 特定のサービスのみ起動 docker compose up -d openclaw-gateway サービスを再起動 docker compose restart openclaw-gateway すべてのサービスを停止 docker compose down ログを表示 docker compose logs -f openclaw-gateway CLI コマンドを実行 docker compose run --rm openclaw-cli <command> ステータスを確認 docker compose ps 起動中のコンテナでコマンドを実行 docker compose exec openclaw-gateway <command>
️ Work on Host OS:
# デバイス管理 docker compose run --rm openclaw-cli devices list docker compose run --rm openclaw-cli devices approve <device_id> docker compose run --rm openclaw-cli devices reject <device_id> 設定管理 docker compose run --rm openclaw-cli config get <key> docker compose run --rm openclaw-cli config set <key> <value> ヘルスチェック docker compose run --rm openclaw-cli doctor
Diagnostic checklist
Before reporting an issue, please check the following:
Docker[ ] Docker Desktop is running (docker info works)
[ ] Gateway container is in Up state (docker compose ps)
[ ] Ports are correctly bound (netstat or ss)
[ ] The .env file exists and is set with the correct values
[ ] OPENCLAW_GATEWAY_TOKEN is set in .env
[ ] gateway.auth.token and gateway.remote.token in openclaw.json match the token
[ ] Port bindings match the intended access (0.0.0.0 for LAN, 127.0.0.1 for localhost)
[ ] network_mode: "service:openclaw-gateway" is used when running the CLI in a container
[ ] The Dashboard URL includes the token: http://localhost:18789/#token=...
[ ] Browser local storage is cleared when switching environments
[ ] The device is authorized ("Pending" is not displayed in the devices list)
Related Resources
General gateway troubleshooting: /gateway/troubleshooting
Authentication and pairing docs: /gateway/authentication
Channel-specific pairing: /channels/pairing
Docker installation guide: /install/docker
We hope this article helps with your OpenClaw Docker troubleshooting. If the issue persists, please check the official documentation or community forums.