openclaw connect
Connect the current machine to an OpenClaw Gateway as a headless node. The
command redeems a short-lived bootstrap credential, saves the Gateway endpoint
in the existing node-host state, and runs the same runtime as
openclaw node run.
Create a join command
On the Gateway host, use admin credentials to mint a single-use join URL:Connect in the foreground
Paste the printed command on the machine you want to connect:--session-host:
openclaw.json, so the next normal node-host start remains non-hosting.
Environment-managed cloud nodes
Worker providers use--ephemeral for disposable cloud machines:
--service or --session-host. The Gateway owns the setup identity and paired-node lifetime: provider replay resumes the persisted device token after the one-shot setup credential is consumed, and environment teardown removes the node role after releasing the cloud lease.
--ephemeral is intended for provider-managed state directories on throwaway machines, not as a shortcut for enrolling a personal device.
Install as a service
Pass--service to redeem the bootstrap credential and install the node host as
the platform user service:
openclaw node status to inspect the
installed service.
The service does not host worker sessions by default. To consent to full
worker-session hosting, add --session-host:
nodeHost.workerRuns.enabled=true, preserving
the rest of the config, and install the service. If the config write fails,
service installation does not start. The installed service advertises worker
hosting and exact capacity from this durable consent when it starts.
Accepted targets
openclaw connect <target> accepts:
- an
https://<gateway>/j/<shortcode>join URL; - an
oc-pair://<setup-code>URL; - a bare base64url setup code.
--target-file <path> accepts a regular file up to 64 KiB. It removes the path
only after reading a non-empty target. If the file is empty, too large,
unreadable, or not a regular file, OpenClaw leaves it in place. A symlink is
allowed; OpenClaw reads its target, removes the symlink after a successful read,
and keeps the backing file. The dormant installer wrapper uses this handoff to
keep the single-use target out of child-process arguments.
Join URLs must use HTTPS. Plain HTTP is accepted only for loopback Gateway URLs
such as http://127.0.0.1/j/<shortcode>. Direct setup codes can carry the
Gateway TLS certificate fingerprint, which lets the node host pin a self-signed
Gateway certificate after decoding the payload.
The payload determines the saved host, port, TLS mode, WebSocket context path,
and ordered fallback endpoints. Normal and foreground connections do not add
openclaw.json keys; --service --session-host explicitly persists the worker
hosting consent described above.
Revocation behavior
A join code and a paired device have separate lifecycles:- Burning or expiring a join code prevents another enrollment with that code.
- It does not disconnect or remove a node that already redeemed it.
- To revoke a normal enrolled machine, remove its paired device with
openclaw devices remove <deviceId>. - Environment-managed
--ephemeralnodes are removed automatically when their owning cloud environment is destroyed.
Troubleshooting
If the join URL reports that it is missing or expired, mint a new one withopenclaw devices join-code. A used code intentionally returns the same result
as an unknown code.
If an HTTPS join URL uses a certificate the local machine does not trust, use
the direct oc-pair:// or bare setup-code form that includes the TLS pin.
See Node for service management, explicit connection flags, node
state, and exec approval behavior.