Self-hosting
ClawMobile Cloud is a thin control plane over open components. You can run the whole stack yourself; this page sketches the pieces and how they fit.
Components
| Layer | Tech | Role |
|---|---|---|
| Edge API | Cloudflare Worker (Hono) | Auth, rate limits, SSE fan-out, D1/R2 access |
| Web UI | Next.js static export → CF Pages | The dashboard you’re reading about |
| Docs | Astro Starlight → CF Pages | This site |
| Orchestrator | Bun + Hono on a VPS | Session lifecycle, device pool, scrcpy relay |
| Devices | Redroid containers (Kamatera / Vast.ai) | The Android runtime per session |
| Storage | R2 (skills, recordings), D1 (index), KV (tokens, rate limits) | State |
Provisioning outline
- Edge. Create the Worker, D1 database (apply migrations), R2 buckets
(
clawmobile-skills,clawmobile-recordings), and KV namespaces. Deploy the Worker and both Pages projects. - Orchestrator VPS. Run the first-boot script (generates the ADB keypair,
creates
/var/clawmobile, installs Bun), installcloudflared, and start the orchestrator + watchdog under PM2. - Redroid node(s). Install Docker and pull the Redroid image. Register the
node(s) in the orchestrator’s
REDROID_HOSTS. - Tunnel. The orchestrator is reached only through a Cloudflare Tunnel; the
Worker calls its
/internal/*routes with a sharedX-Tunnel-Secret.
Key configuration
REDROID_HOSTS— comma-separated standing nodes (Tier 1).VASTAI_API_KEY— optional burst capacity (Tier 2). Leave blank to disable;VASTAI_MAX_HOURSis a hard cost cap enforced by the watchdog.TUNNEL_SECRET/JWT_SECRET— must match between Worker and orchestrator.- R2 S3-compat credentials (
R2_S3_ENDPOINT,R2_ACCESS_KEY_ID,R2_SECRET_ACCESS_KEY) enable presigned skill sharing.
See the .env.example and .dev.vars.example files in the repo for the full
list, and the infra/ directory for the bootstrap scripts.
The plugin contract
The agent’s behavior comes from the mobile-ui plugin’s tool surface, which is
stable: adding, removing, or renaming a tool is a breaking change. If you fork
it, keep openclaw.plugin.json and the Tools reference in
sync. Cloud mode is just CLAWMOBILE_LITE=1 + CLAWMOBILE_CLOUD=1.