Learn how Moltworker works, how to deploy OpenClaw on Cloudflare, connect AI models, configure messaging integrations, protect your agent, and get started with practical examples.
Moltworker is an open-source project from Cloudflare that provides a way to run OpenClaw, an open-source personal AI agent, on Cloudflare's infrastructure. Instead of keeping the agent on a computer at home or managing a traditional server, developers can use Cloudflare Workers and Sandbox containers to host the runtime.
The project combines a Worker-based entry point with an adapted OpenClaw runtime. It can also use Cloudflare services such as R2 storage, Access, AI Gateway, and Browser Rendering.
This tutorial explains the main ideas and takes you through the practical stages of getting started. You do not need to understand every part of the architecture before beginning, but basic terminal and Cloudflare knowledge will help.
Project status: Cloudflare describes Moltworker as an experimental proof of concept, not an officially supported Cloudflare product. Features and instructions can change, so check the official repository before deploying or updating it.
Run an AI assistant that can interact with supported tools and messaging platforms.
Use Cloudflare Workers and Sandbox containers instead of maintaining a dedicated local machine.
Explore AI providers, messaging connections, storage, and browser-related capabilities.
Understanding the basic architecture makes the deployment process easier. Moltworker connects incoming requests to an OpenClaw runtime running inside a Cloudflare Sandbox container.
The Worker acts as the entry point. It handles incoming requests and connects them to the running agent environment.
The container runs the adapted OpenClaw Gateway runtime, which manages the agent and its supported connections.
The configured AI model processes prompts and generates responses through the selected provider.
R2 can provide persistent storage and backup support for data that needs to survive container restarts.
Access adds an authentication layer to protect the remote administrative interface.
Browser-related capabilities can be connected through Cloudflare's browser infrastructure.
This architecture is different from simply installing OpenClaw on a Linux VPS. Moltworker adapts the runtime for Cloudflare's platform and its Sandbox environment.
Moltworker is useful for developers who want to explore a hosted personal AI agent without maintaining a dedicated computer for its runtime. Its main advantages come from combining OpenClaw with Cloudflare's developer services.
You can explore a cloud-hosted deployment without buying a separate machine just to run the agent.
Connect supported messaging services such as Telegram, Discord, and Slack.
Use Cloudflare Access and device pairing to control access to the administrative interface.
Configure R2 to preserve supported data and backups across container restarts.
Choose supported AI providers and adjust the deployment to suit your requirements.
Access your deployed agent through its configured remote interface and integrations.
Before following this Moltworker tutorial, prepare the accounts, software, and credentials required for deployment.
Cost reminder: The Workers Paid plan is a starting requirement, not a guarantee that the complete deployment will cost only the plan price. Container compute, AI usage, and other services can add charges.
The following is a beginner-friendly overview of the deployment process. For the exact latest commands and repository changes, use the official Cloudflare instructions.
Start by downloading the project from Cloudflare's official GitHub repository. Open a terminal and clone the repository:
git clone https://github.com/cloudflare/moltworker.git cd moltworker
This creates a local project directory containing the files needed for the deployment process.
Make sure Node.js and npm are available. Inside the project directory, install the required dependencies:
npm install
Wait for the installation to finish. If npm reports an error, check your Node.js version and the repository's current requirements.
Moltworker needs an AI provider to generate responses. The official repository documents direct Anthropic access and Cloudflare AI Gateway configuration.
npx wrangler secret put ANTHROPIC_API_KEY
Enter your API key when Wrangler asks for it. Do not put private credentials into public source code.
npx wrangler secret put CLOUDFLARE_AI_GATEWAY_API_KEY npx wrangler secret put CF_AI_GATEWAY_ACCOUNT_ID npx wrangler secret put CF_AI_GATEWAY_GATEWAY_ID
These are the current native AI Gateway secret names documented by the repository. Older third-party articles may show legacy variable names, so check the current README before copying configuration from another guide.
Generate a random gateway token and save it as a Worker secret:
export MOLTBOT_GATEWAY_TOKEN=$(openssl rand -hex 32) echo "$MOLTBOT_GATEWAY_TOKEN" | npx wrangler secret put MOLTBOT_GATEWAY_TOKEN
Keep the token in a secure location. It is used when accessing the remote Control UI.
After completing the required configuration, deploy the project:
npm run deploy
Wrangler will build and deploy the application. When deployment completes, use the Worker URL provided by the deployment process.
Note: The first request may take longer while the Sandbox container starts. Follow the current README for the correct access URL and authentication procedure.
A working deployment is not the same as a secure deployment. Before using your agent remotely, configure the required access controls.
Add the required secrets:
npx wrangler secret put CF_ACCESS_TEAM_DOMAIN npx wrangler secret put CF_ACCESS_AUD
Deploy the updated configuration:
npm run deploy
Device pairing is another important part of the access process. New device requests may remain pending until an administrator approves them.
/_admin/.A container can restart or enter a sleep state. If important data exists only inside the container, it may not remain available after a restart. Cloudflare R2 can provide persistent storage for supported Moltworker data.
npx wrangler secret put R2_ACCESS_KEY_ID npx wrangler secret put R2_SECRET_ACCESS_KEY npx wrangler secret put CF_ACCOUNT_ID
Once configured, check the admin interface for R2 status and available backup controls. Verify that backups are working before relying on them for important data.
One of the useful features of an AI agent is the ability to interact through messaging platforms. The Moltworker repository documents configuration options for several integrations.
Create a bot using Telegram's BotFather and configure its token as a Worker secret.
npx wrangler secret put TELEGRAM_BOT_TOKEN
Create a Discord application and bot. Configure the bot token and follow the required permissions.
npx wrangler secret put DISCORD_BOT_TOKEN
Configure a Slack application and provide the required bot and app-level tokens.
npx wrangler secret put SLACK_BOT_TOKEN npx wrangler secret put SLACK_APP_TOKEN
Adding a token is only one part of an integration. You may also need to configure permissions, application settings, and the relevant channel setup in the agent. Follow the current project documentation for each platform.
Browser-related capabilities can help an AI agent work with web content and browser-based tasks. Moltworker's Cloudflare architecture includes an optional connection to Browser Rendering.
The available features depend on the deployed version and its configuration. Review the Cloudflare Browser Rendering documentation before enabling this functionality.
After deployment and configuration, test the main functions before depending on the agent for regular tasks.
List configured Worker secrets:
npx wrangler secret list
Monitor live Worker logs:
npx wrangler tail
These commands can help you identify missing configuration and runtime errors. The secret list shows configured secret names, not their private values.
If something does not work as expected, check the relevant configuration before changing multiple settings at once.
| Problem | What to Check |
|---|---|
| AI agent does not respond | Check the provider API key, AI Gateway secrets, and model configuration. |
| Dashboard access denied | Review Cloudflare Access policies, team domain, and Application Audience. |
| Device remains pending | Open the admin interface and review the pairing request. |
| Data is missing after restart | Check R2 credentials, bucket configuration, and backup status. |
| Telegram or Discord does not connect | Verify the bot token, app configuration, and permissions. |
| Container takes time to respond | Allow the Sandbox to initialize and inspect the Worker logs. |
| Windows shell script error | Check Git line endings if a script fails with an exit code such as 126. |
For version-specific errors, the official GitHub issues and README should be your first reference.
Moltworker is not automatically a completely free service. The official repository identifies a Cloudflare Workers Paid plan as a requirement for Sandbox containers. Additional charges may depend on how much compute and which services you use.
The Workers Paid plan is required for the Sandbox deployment. Check current plan pricing and usage limits.
Model requests may have separate charges depending on your provider, model, and usage.
Review R2, Browser Rendering, and other service allowances and charges for your account.
Always check the latest Cloudflare pricing documentation and your AI provider's pricing before deploying. Costs and free-tier limits can change.
An AI agent may be connected to external services and tools. Its credentials and access permissions should be treated carefully.
Use Worker secrets instead of exposing credentials in public code, frontend scripts, or screenshots.
Use Cloudflare Access and allow policies to limit access to approved users.
Grant integrations only the permissions they need and approve trusted devices.
Review these main tasks before considering your initial deployment complete.
A Moltworker tutorial explains how to understand, deploy, configure, and use the Cloudflare project for running an OpenClaw-based AI agent. It typically covers architecture, requirements, AI providers, security, storage, integrations, and troubleshooting.
No. OpenClaw is the AI agent runtime. Moltworker is Cloudflare's project for adapting and running OpenClaw on Cloudflare infrastructure. They are related, but they are not the same project.
Beginners can follow a tutorial, but some technical knowledge is helpful. You should be comfortable with basic terminal commands, API keys, Cloudflare settings, and software deployment.
No dedicated Mac Mini is required for the Cloudflare deployment approach. Moltworker uses Cloudflare infrastructure and Sandbox containers, although you still need a computer to manage the setup and deployment.
Yes. The official repository documents Telegram integration using a bot token stored as a Worker secret. Additional configuration may be needed to complete and test the connection.
Yes. The project includes Cloudflare R2 integration for supported persistent storage and backup functionality. You need to configure the required R2 credentials and verify that backups are working.
Not necessarily. A Workers Paid plan is required for Sandbox containers, and additional compute or AI provider usage may create further costs. Check current Cloudflare and provider pricing.
Cloudflare describes Moltworker as an experimental proof of concept, not an officially supported product. Review the current repository, assess security requirements, and test carefully before using it for important workloads.
You can find the latest project instructions, configuration details, and changes in the official Cloudflare Moltworker GitHub repository.
Explore our related guides to understand each part of the project in more detail.
You now have an overview of how Moltworker works and the main steps involved in deploying and configuring an AI agent on Cloudflare. Continue with the official documentation to check the latest instructions and supported features.
Explore the Official Project ↗