
Moltworker is a proof-of-concept self-hosted AI agent from Cloudflare that runs Moltbot (formerly Clawdbot) on Cloudflare Workers, leveraging tools like AI Gateway for LLMs, Sandbox Containers for secure code execution, and R2 for storage—avoiding local hardware limits while keeping data private.[2] This setup combines Moltbot's personal AI capabilities (like messaging integrations and task automation) with Cloudflare's edge computing for reliability and scalability.[1][2]
Moltworker demonstrates running a full AI agent stack serverlessly: it uses Cloudflare Workers for the core logic, AI Gateway to proxy LLM requests (e.g., Anthropic's Claude) with cost tracking and fallbacks, Sandbox Containers (powered by Docker on Cloudflare's infrastructure) for safe, isolated code execution, and R2 for persistent data storage.[2] Interesting fact: Unlike traditional self-hosting on a VPS or home server, this eliminates Docker management on your machine and handles untrusted code securely via callbacks between Workers and sandboxes—no local Mac mini or VPS needed.[2] It's ideal for privacy-focused users who want agent features like web research or Docker deployments via WhatsApp, but with Cloudflare's global edge for low latency.[1][3]
Note: Moltworker is a proof-of-concept, not a production Cloudflare product, requiring a paid Workers plan ($5/month minimum for Sandbox Containers).[2] Free tiers cover AI Gateway and other components for testing.
Follow the official README (linked in Cloudflare's blog) for exact commands, as it's a hands-on Worker deployment.[2] Here's a synthesized guide based on available details:
Sign Up and Prepare Cloudflare Resources
Create a Cloudflare account if needed. Upgrade to Workers Paid ($5/month). Top up credits for AI Gateway if using pay-as-you-go (or bring your own API keys).[2] Enable products:
Deploy Moltworker on Cloudflare Workers
npx wrangler deploy. This spins up the Worker handling Moltbot logic, gateway, and callbacks to Sandbox Containers.[2]Set Up AI Gateway for LLMs
ANTHROPIC_BASE_URL=https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway}/anthropic (replace placeholders).[2]Configure Sandbox Containers and R2
Install and Onboard Moltbot
Moltworker runs Moltbot under the hood—run the onboarding: moltbot onboard --install-daemon (adapted for Worker env).[1]
{
"gateway": { "bind": "https://agent.yourdomain.workers.dev" },
"tools": { "profile": "safe" }
}
```[3]
Secure and Monitor
moltbot models auth setup-token --provider anthropic).[1]Test Your Agent
This gets you a powerful, self-hosted agent—experiment safely and check the Moltworker README for updates![2]