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
# 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
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
# 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 Issue
Solution
Disconnects every few hours
Enable keepalive in config
Disconnects on network change
Use gateway.reconnect.enabled: true
Disconnects after system sleep
Run as systemd service
Disconnects under load
Increase system resources
Firewall blocking
Allow 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.