Skip to main content
OpenClaw combines an interactive agent with a long-running gateway. This example persists its state in a named volume and maps the gateway only to host loopback.

Set up OpenClaw

1

Run onboarding

Complete the provider and channel prompts. The openclaw-data volume retains the workspace, configuration, credentials, sessions, and gateway state after the setup sandbox is removed.Verify the installed version before removing the setup sandbox:
The pinned package reports OpenClaw 2026.7.1-2.
2

Run the gateway

Generate a token in the host shell:
Start a fresh gateway sandbox using the persisted state:
The gateway listens inside the guest on port 18789, while microsandbox exposes it only at 127.0.0.1:18789 on the host. Follow its output with:
OPENCLAW_GATEWAY_TOKEN is visible to the guest and to processes that can inspect the host command environment. Use the microsandbox secrets workflow for production credentials. Do not change the host bind address to 0.0.0.0 without adding transport security and understanding the exposure.
3

Clean up

Remove the setup and gateway sandboxes:
Remove persisted OpenClaw state only when you no longer need it:
Clear the token from the host shell:
Keep openclaw-data if you want the configured agent to survive sandbox replacement.

Reference