openclaw daemon
Manage the OpenClaw Gateway as a system background service.Usage
Commands
install
Install the gateway as a system service.- macOS: LaunchAgent (
~/Library/LaunchAgents/ai.openclaw.gateway.plist) - Linux: systemd user service (
~/.config/systemd/user/openclaw-gateway.service) - Windows: Task Scheduler task
Overwrite existing service configuration
start
Start the gateway service.- macOS:
launchctl load - Linux:
systemctl --user start - Windows:
schtasks /run
stop
Stop the gateway service.- macOS:
launchctl unload - Linux:
systemctl --user stop - Windows:
schtasks /end
restart
Restart the gateway service.stop followed by start.
status
Show service install status and probe the Gateway.Output JSON format
uninstall
Remove the gateway service.- macOS: Removes LaunchAgent plist
- Linux: Removes systemd service unit
- Windows: Removes Task Scheduler task
Examples
Platform Details
macOS (LaunchAgent)
The service is installed as a LaunchAgent at:Service Configuration
The plist includes:- Automatic startup on login
- Standard output/error logging
- Restart on crash
- Environment variables
Manual Management
Linux (systemd)
The service is installed as a user service at:Service Configuration
The unit file includes:- User service (no root required)
- Restart on failure
- Standard output to journal
- Environment variables
User Lingering
For the service to run when not logged in, enable lingering:Without lingering enabled, systemd stops user services on logout. The
doctor command will detect this and offer to enable lingering.Manual Management
Windows (Task Scheduler)
The service is installed as a scheduled task.Service Configuration
- Runs on user login
- Background execution
- Restart on failure
Manual Management
Environment Variables
The daemon service inherits environment variables from:- Service configuration (set during install)
- User environment (shell profile)
- Config file (
~/.openclaw/openclaw.json)
Gateway authentication token
Gateway authentication password
Node environment (production, development)
Configuration profile name
Logging
Service logs are managed by the platform’s logging system:macOS Unified Logs
Linux systemd Journal
Via OpenClaw CLI
Use thelogs command to view gateway logs:
Troubleshooting
Service Won’t Start
-
Check installation:
-
Check gateway config:
-
Run diagnostics:
-
Try manual start:
Service Crashes Immediately
-
Check logs:
-
Check port availability:
-
Check authentication:
Service Stops on Logout (Linux)
Enable user lingering:Linger=yes.
Permission Errors
Ensure the service runs as your user (not root):Automatic Startup
By default, the daemon starts automatically:- macOS: On user login (LaunchAgent)
- Linux: When systemd user session starts (requires lingering)
- Windows: On user login (Task Scheduler)

