OpenClaw Doctor Command: Complete Guide to Every Flag and Fix [2026]
|4 min read
Table of Contents
Haven't installed OpenClaw yet?
curl -fsSL https://openclaw.ai/install.sh | bash
iwr -useb https://openclaw.ai/install.ps1 | iex
curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Worried it'll affect your machine? ClawTank — cloud deploy in 60s, zero risk to your files.
The openclaw doctor command is your first line of defense when something goes wrong. It diagnoses issues, explains what's broken, and can auto-fix most problems.
Basic Usage
# Diagnose issues (read-only)
openclaw doctor
# Diagnose and auto-fix
openclaw doctor --fix
The doctor runs a series of health checks and reports findings as OK, WARN, or FAIL.
What Doctor Checks
1. Gateway Configuration
Checks if gateway.mode is set and valid.
FAIL gateway.mode is unset — gateway start will be blocked
FIX: openclaw config set gateway.mode local
Auto-fix with --fix: Sets gateway.mode to local.
2. Device Token Mismatch
Checks if device tokens match the gateway's expected tokens.
Safe to run multiple times. It won't change things that are already correct.
--generate-gateway-token
Generate a new gateway token (useful after a device token mismatch):
openclaw doctor --generate-gateway-token
--verbose
Show detailed diagnostic output:
openclaw doctor --verbose
--json
Output results as JSON (useful for scripting):
openclaw doctor --json
Common Scenarios
After a Fresh Install
openclaw doctor --fix
This configures gateway mode, sets up directories, and validates the initial config.
After an Upgrade
openclaw doctor --fix
Migrates deprecated config keys and fixes any breaking changes from the upgrade.
After a Container Rebuild
docker exec -it CONTAINER_ID openclaw doctor --fix
Regenerates tokens and re-pairs devices that were lost during the rebuild.
When Nothing Else Works
openclaw doctor --fix --verbose
The verbose flag shows exactly what's being checked and fixed, helping you identify issues that doctor can't auto-repair.
What Doctor Can't Fix
Some issues require manual intervention:
Wrong API keys: Doctor can't verify your AI provider credentials
Network issues: Firewall rules, DNS, or ISP blocking
Reverse proxy misconfiguration: Caddy/Nginx config is outside OpenClaw's scope
Telegram bot conflicts: Another process polling the same bot token
For these, check openclaw logs --follow for specific error messages.
Run Doctor Regularly
Add openclaw doctor to your maintenance routine — especially after updates. It catches configuration drift before it causes problems.
Pre-Configured and Doctor-Free
ClawTank manages your OpenClaw configuration automatically. No doctor runs needed — the platform handles gateway tokens, config validation, and pairing for you.
Enjoyed this article?
Get notified when we publish new guides and tutorials.