ใƒ›ใƒผใƒ  ่ปŠใƒปใƒใ‚คใ‚ฏ ๐Ÿณ OpenClaw Docker Troubleshooting Complete Guide (With Workspace Version)

๐Ÿณ OpenClaw Docker Troubleshooting Complete Guide (With Workspace Version)

็™ฝๅท ็”ฑ็œŸ ็™ฝๅท ็”ฑ็œŸ โ€ข ๆ›ดๆ–ฐ๏ผš โ€ข ๅ…ฌ้–‹๏ผš โ€ข ่ชญไบ†็ด„ 22 ๅˆ†
็›ฎๆฌก

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

n129a2248a3a0
  1. Docker Desktop is not running

  2. Cannot access port / Cannot connect to gateway

  3. CLI cannot connect to gateway (1006 abnormal closure)

  4. Dashboard: "unauthorized: gateway token mismatch"

  5. Dashboard: "pairing required"

Docker Desktop is not running

Error Details
ERROR: Cannot connect to the Docker daemon at unix:///Users/<user>/.docker/run/docker.sock
Cause

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 Details
  • The Gateway container is running

  • Cannot access the Gateway from a browser or CLI

  • Connection refused error occurs

Cause

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.

Solution

Work 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
How to verify

๏ธ 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
Cause
  1. The CLI container is trying to connect to ws://127.0.0.1:18789, which points to its own loopback, not the Gateway container

  2. The tokens in .env and openclaw.json do not match

Solution

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
How to verify

๏ธ 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 details
disconnected (1008): unauthorized: gateway token mismatch (open the dashboard URL and paste the token in Control UI settings)
Cause

The old token stored in the browser's local storage does not match the Gateway's current token.

Solution

Option 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

  1. Open the dashboard page (http://localhost:18789/) in your browser

  2. Open DevTools (F12 or Cmd+Option+I on macOS)

  3. Go to the Application tab

  4. Expand Local Storage โ†’ http://localhost:18789

  5. Delete all keys

  6. Reload the page

  7. Access using the correct URL with the token from Option 1

How to verify

๏ธ 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 details
disconnected (1008): pairing required
Cause

The browser/device is attempting to connect to the Gateway but has not yet been paired/authorized.

Solution

Step 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
How to verify

๏ธ 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>
CLI commands

๏ธ 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)

Configuration
  • [ ] 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

Network
  • [ ] 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

Authentication
  • [ ] 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.


ๅŒใ˜ใ‚ซใƒ†ใ‚ดใƒชใฎ่จ˜ไบ‹

็™ฝๅท ็”ฑ็œŸ
ใƒˆใƒฌใƒณใƒ‰ใƒชใ‚ตใƒผใƒใƒฃใƒผ ็™ฝๅท ็”ฑ็œŸ
ใƒ—ใƒญใƒ•ใ‚ฃใƒผใƒซใ‚’่ฆ‹ใ‚‹ โ†’

ๆ˜ ็”ปใจ้€ฃ็ถšใƒ‰ใƒฉใƒžใฎๅ…ฌ้–‹ๆƒ…ๅ ฑใ‚’่ฟฝใ†ๆ‹…ๅฝ“ใ€‚้…็ตฆไผš็คพใฎใƒ—ใƒฌใ‚นใ‚ทใƒผใƒˆใจๅ…ฌๅผใ‚ตใ‚คใƒˆใฎ็™บ่กจๆ—ฅใ‚’็ขบ่ชใ—ใŸใ†ใˆใงๅŸท็ญ†ใ—ใพใ™ใ€‚

ใŠใ™ใ™ใ‚ใฎ้–ข้€ฃ่จ˜ไบ‹