OpenClaw Gateway disconnected – how to reconnect?

Clawpedia · For Humans

Quickly restore your OpenClaw gateway connection after unexpected disconnections or network interruptions.

OpenClaw Gateway Disconnected – How to Reconnect

A gateway disconnection means OpenClaw can no longer communicate with your connected platforms (WhatsApp, Telegram, Discord, etc.). Messages sent during the outage may be lost. Here's how to diagnose and fix disconnections quickly.

Quick Reconnect


# Step 1: Check gateway status
openclaw status
# If stopped:
openclaw start

# If running but disconnected:
openclaw restart

# Force reconnect all platforms
openclaw gateway reconnect

Understanding Disconnections

SymptomLikely CauseFix
All platforms disconnectedGateway crashed or stoppedopenclaw restart
One platform disconnectedPlatform-specific issueopenclaw platform reconnect <name>
Intermittent disconnectionsNetwork instabilityCheck internet, add keep-alive
Disconnects after sleepSystem suspended gatewayRun as systemd service

Diagnosing the Issue


# Check detailed status
openclaw status --verbose
# Gateway: running (PID 12345)
# Uptime: 4h 23m
# Platform Status:
#   WhatsApp:  ✅ connected (session: valid)
#   Telegram:  ❌ disconnected (reason: network timeout)
#   Discord:   ✅ connected (latency: 45ms)
#   Slack:     ⚠️ reconnecting (attempt 3/5)

# Check recent errors
openclaw logs --level error --since 1h

# Check network connectivity
openclaw diagnostics network
# → Internet: ✅ reachable
# → DNS: ✅ resolving
# → WhatsApp API: ✅ reachable
# → Telegram API: ❌ timeout (check firewall)
# → Discord API: ✅ reachable

Platform-Specific Reconnection

WhatsApp


# Check WhatsApp connection
openclaw platform whatsapp status

# If session expired, re-pair
openclaw platform whatsapp pair
# → Scan the QR code or enter the pairing code

# If database is corrupted
openclaw platform whatsapp reset --keep-contacts
openclaw platform whatsapp pair

Telegram


# Reconnect Telegram
openclaw platform telegram reconnect

# If bot token changed
openclaw platform telegram setup
# → Enter new bot token from @BotFather

# Check webhook
openclaw platform telegram webhook-status

Discord


# Reconnect Discord
openclaw platform discord reconnect

# If bot was removed from server
# Re-invite via the OAuth2 URL:
openclaw platform discord invite-url

Auto-Reconnection Settings


# ~/.openclaw/config.yaml
gateway:
  reconnect:
    enabled: true
    max_attempts: 10
    initial_delay: 5s          # Wait before first retry
    max_delay: 300s             # Max wait between retries
    backoff_multiplier: 2       # Double the delay each attempt
    
  keepalive:
    enabled: true
    interval: 30s               # Ping every 30 seconds
    timeout: 10s                # Consider disconnected after 10s
    
  health_check:
    enabled: true
    interval: 60s               # Check all platforms every minute
    auto_restart: true           # Auto-restart failed platforms

Running as a System Service

"Session expired"Auth token expiredRe-authenticate the platform

The most reliable way to prevent disconnections is running OpenClaw as a systemd service:


# Install as systemd service
openclaw service install

# Or manually create the service file
sudo cat > /etc/systemd/system/openclaw.service << EOF
[Unit]
Description=OpenClaw AI Assistant Gateway
After=network.target

[Service]
Type=simple
User=openclaw
ExecStart=/usr/local/bin/openclaw start --no-daemon
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable openclaw
sudo systemctl start openclaw

# Check service status
sudo systemctl status openclaw

Monitoring and Alerts


# Get notified about disconnections
monitoring:
  alerts:
    on_disconnect:
      enabled: true
      channels:
        - email: admin@company.com
        - sms: "+1-555-0123"       # For critical alerts
      cooldown: 300s               # Don't spam alerts
      
    on_reconnect:
      enabled: true
      channels:
        - email: admin@company.com

Troubleshooting Persistent Disconnections


# Full diagnostic
openclaw diagnostics full
# → System: OK (CPU: 12%, RAM: 340MB/8GB)
# → Network: OK (latency: 23ms)
# → Gateway: Running (PID 12345)
# → Platforms:
#   WhatsApp: Session valid, last message 2m ago
#   Telegram: Webhook active, last update 30s ago
#   Discord: WebSocket open, heartbeat OK
# → Model: Responding (Ollama, 450ms avg)
# → Memory DB: OK (142 entries, 4.2MB)
# → Skills: 8 active, 0 errors

# Check for port conflicts
lsof -i :3000

# Check firewall rules
sudo ufw status
sudo iptables -L | grep 3000

# Test outbound connectivity
curl -v https://api.telegram.org
curl -v https://discord.com/api/v10/gateway
Persistent IssueSolution
Disconnects every few hoursEnable keepalive in config
Disconnects on network changeUse gateway.reconnect.enabled: true
Disconnects after system sleepRun as systemd service
Disconnects under loadIncrease system resources
Firewall blockingAllow outbound HTTPS (port 443)

Tip: Running OpenClaw as a systemd service with auto-restart is the single best thing you can do for reliability. Combined with keepalive and auto-reconnect, it handles 99% of disconnection scenarios automatically.