openclaw daemon: Legacy Gateway Service Control Reference
CLI reference for the openclaw daemon command, a legacy alias for gateway service management. Covers status, install, uninstall, start, stop, and restart subcommands with options for developers and operators.
Read this when
- You still use `openclaw daemon ...` in scripts
- You need service lifecycle commands (install/start/stop/restart/status)
openclaw daemon
The older name for handling Gateway service operations. openclaw daemon ... points to the same set of service-control commands as openclaw gateway .... For up-to-date guidance and samples, turn to openclaw gateway.
Usage
openclaw daemon status
openclaw daemon install
openclaw daemon start
openclaw daemon stop
openclaw daemon restart
openclaw daemon uninstall
Subcommands and options
| Subcommand | Options |
|---|---|
status | --url, --port, --token, --password, --timeout, --no-probe, --require-rpc, --deep, --json |
install | --port, --runtime <node|bun>, --token, --wrapper <path>, --force, --json |
uninstall | --json |
start | --json |
stop | --force, --json, --disable (launchd only: suppress KeepAlive/RunAtLoad until next start) |
restart | --force, --safe, --skip-deferral, --wait <duration>, --json |
--json works either before or after any subcommand, for instance daemon --json status and daemon status --json.
status: reports whether the service is installed (launchd/systemd/schtasks) and checks Gateway health.status --port <port>: picks a local Gateway, relying on the invoking CLI config for auth and TLS. It cannot be used together with--url; native service details are for diagnostics only.install: sets up the service, while--forcereinstalls or overwrites an existing setup.- Node serves as the primary, default, and recommended runtime for the service. Bun 1.4+ with WAL-reset-safe
node:sqliteis an explicit opt-in throughinstall --runtime bun. restart --safe: instructs the running Gateway to preflight active work and arrange a single combined restart once work finishes draining, capped at 5 minutes. If that limit is reached, the restart is forced regardless. A plainrestartgoes straight through the service manager, and--forceis the immediate override.restart --safe --skip-deferral: skips only the active-work deferral gate. Shutdown can still wait for pending replies to finish before the Gateway process exits.--safeis a prerequisite.
Notes
- When a probe's auth SecretRefs can be resolved,
statushandles them automatically. Should a required SecretRef remain unresolved,status --jsonflags it withrpc.authWarning; either supply--token/--passworddirectly or ensure the secret source is resolved beforehand. Once the probe passes on its own, warnings about unresolved auth are no longer shown. status --deepperforms a best-effort scan across the system for other gateway-like services, offering cleanup suggestions while still recommending one Gateway per machine, and it runs config validation with plugin awareness, exposing plugin manifest warnings that the quicker default route omits.- On Linux systemd setups, token-drift checks look at both
Environment=andEnvironmentFile=unit sources. - For token-drift checks,
gateway.auth.tokenSecretRefs are resolved using merged runtime environment variables, with service command env taking priority over process env. If token auth isn't truly active, which happens whengateway.auth.modeofpassword/none/trusted-proxyis present, or when it's unset and a password could take precedence, config token resolution gets skipped. installconfirms that agateway.auth.tokenmanaged by SecretRef is resolvable but never writes the resolved value into service environment metadata; if resolution fails, the install stops with an error.- When both
gateway.auth.tokenandgateway.auth.passwordare set andgateway.auth.modeis missing,installwaits until you explicitly choose the mode. - On macOS,
installrestricts LaunchAgent plists and the generated env file/wrapper to the owner only, using mode0600/0700, rather than placing secrets insideEnvironmentVariables. - For multiple Gateways on a single host, keep ports, config/state, and workspaces separate. Refer to Multiple gateways.