Fix: launchctl bootstrap failed โ Could Not Find Domain for user gui
Could not find domain for user gui: 1000
OpenClaw's macOS installer attempts to register a LaunchAgent in your GUI user session vialaunchctl bootstrap gui/<UID>. When you connect over SSH or run the install in a headless environment (no active GUI session), macOS has not created that session domain yet, and launchctl fails. The gateway itself works fine โ only the automatic service registration fails.
Next Step
Fix now, then reduce repeat incidents
If this issue keeps coming back, validate your setup in Doctor first, then harden your config.
Jump to Fix
Option A: Use brew services (Recommended for Mac Servers)
If you installed OpenClaw via Homebrew, use brew services instead of the built-in installer. Homebrew manages background services correctly without needing an active GUI session:
brew services start openclaw # Check status brew services list | grep openclaw
brew services vs LaunchAgent: brew services start useslaunchctl load into the user domain if a GUI session is active, or falls back to a system-level approach if not. Either way, the service persists across reboots.
Option B: System-Level LaunchDaemon (Headless Mac Server)
For a Mac mini or Mac Studio running as a headless server, a system-level LaunchDaemon in/Library/LaunchDaemons/ runs before any user logs in โ no GUI session required:
sudo tee /Library/LaunchDaemons/com.openclaw.gateway.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.openclaw.gateway</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/openclaw</string>
<string>gateway</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>YOUR_USERNAME</string>
</dict>
</plist>
EOF
sudo launchctl bootstrap system /Library/LaunchDaemons/com.openclaw.gateway.plistOption C: Load LaunchAgent in an Active GUI Session
If you have occasional GUI access (e.g., using screen sharing once), log in once and run:
# Find the plist the installer created ls ~/Library/LaunchAgents/ | grep openclaw # Load it (in a GUI terminal session, not SSH) launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.openclaw.gateway.plist # Verify launchctl list | grep openclaw
Verify the Gateway is Running
curl -s http://localhost:18789/health # Should return JSON with status OK
Once the gateway is responding, the service is correctly installed. Any of the three options above will auto-start it on reboot.
Related macOS issues
Fix It Faster With Our Tools
Did this guide solve your problem?