Phase 2 / Ep 07: Gateway Management —— start, stop, restart, and daemon mode
🎯 Learning Objectives: Master Gateway's starting, stopping, restarting, and daemon configuration.
1. What is Gateway?
Gateway is OpenClaw's control plane—it does not directly handle AI inference, but is responsible for:
- Receiving messages from all Channels
- Authentication and permission checks
- Routing messages to the correct Agent
- Plugin pipeline execution
- Logging and monitoring
2. Core Commands
Start Gateway
# Run in foreground (for development and debugging)
openclaw gateway start
# Background daemon mode (for production)
openclaw gateway start --daemon
Stop Gateway
openclaw gateway stop
Restart Gateway
# Graceful restart (no message loss)
openclaw gateway restart
Check Status
openclaw status
3. Detailed Explanation of Daemon Mode
Daemon mode allows OpenClaw to run silently in the background, even if the Terminal is closed.
macOS: Using LaunchAgent
# Install daemon
openclaw onboard --install-daemon
# Manual management
launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plist
launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Linux: Using systemd
sudo systemctl start openclaw
sudo systemctl stop openclaw
sudo systemctl enable openclaw # Autostart on boot
4. CLI vs Telegram Comparison
| Operation | CLI Command | Telegram Command | Description |
|---|---|---|---|
| Start Gateway | openclaw gateway start |
N/A | CLI-only operation |
| Stop Gateway | openclaw gateway stop |
N/A | CLI-only operation |
| Restart Gateway | openclaw gateway restart |
/restart |
Telegram requires admin |
| Check Status | openclaw status |
/status |
Available via both |
| Diagnose & Repair | openclaw doctor |
/doctor |
Available via both |
⚠️ Gateway management is an infrastructure operation, mostly performed via CLI. Telegram's
/restartrequires whitelisted user permissions.
Next Episode Preview: Ep 08, a deep dive into
openclaw configandopenclaw.json, mastering the art of configuration management.