Follow this step-by-step Moltworker deployment guide to prepare your Cloudflare account, install the project, configure AI access, deploy your Worker, and verify that your AI agent is running.
Moltworker deployment is the process of running the OpenClaw personal AI agent on Cloudflare infrastructure. It uses a Cloudflare Worker as an entry point and a Sandbox container to run the adapted OpenClaw Gateway runtime.
Instead of installing the entire agent on a dedicated computer or managing a traditional Linux server, developers can use Cloudflare's developer platform to host the project. The setup can also connect services such as AI Gateway, R2 storage, Cloudflare Access, and Browser Rendering.
This guide focuses on the deployment process itself: preparing your environment, downloading the source code, installing dependencies, adding the required credentials, deploying the Worker, and checking the result.
Important: Cloudflare describes the official Moltworker repository as an experimental proof of concept. It is not an officially supported Cloudflare product and may change or break without notice. Review the latest repository before deploying.
Run the adapted OpenClaw environment using Cloudflare Workers and Sandbox containers.
Configure an AI provider or Cloudflare AI Gateway to process agent requests.
Use a gateway token, Cloudflare Access, and device pairing to control access.
Before deploying Moltworker, prepare the required Cloudflare account, development tools, and AI credentials. Having these ready will make the process easier.
You need a Cloudflare account with a Workers Paid plan. Cloudflare Sandbox containers require the Paid plan. Container compute usage can create additional charges beyond the plan fee.
Open Cloudflare Dashboard ↗You need an Anthropic API key for direct Claude access, or the appropriate credentials for the Cloudflare AI Gateway configuration you choose.
Anthropic Console ↗Cost planning: Do not assume that a $5 Workers Paid plan is the total monthly cost. Sandbox compute, AI provider usage, storage, and other services may add charges. Check the current pricing before deployment.
Follow these steps in order to deploy the official Moltworker project. Commands below are based on the current official repository Quick Start.
First, download the source code from Cloudflare's official GitHub repository. Open your terminal and run:
git clone https://github.com/cloudflare/moltworker.git cd moltworker
The first command downloads the project. The second command moves your terminal into the newly created project folder.
Always use the official repository to avoid deploying an unknown or modified copy of the project.
View the official Moltworker repository ↗After entering the project directory, install the required packages using npm:
npm install
npm reads the project's package configuration and installs the dependencies needed to build and deploy the application.
Wait until the installation process finishes. If an error appears, check your Node.js version, npm installation, and the repository's current requirements.
Wrangler needs permission to deploy resources to your Cloudflare account. Run the login command:
npx wrangler login
Your browser should open a Cloudflare authentication page. Sign in to the correct account and authorize Wrangler.
After authentication, return to your terminal and continue with the project configuration.
Wrangler documentation ↗Moltworker needs an AI provider to generate responses. The official Quick Start documents direct Anthropic access and an alternative Cloudflare AI Gateway configuration.
If you want to use Anthropic directly, run:
npx wrangler secret put ANTHROPIC_API_KEY
Wrangler will prompt you to enter your API key. Paste the key securely and complete the command.
If you choose the native AI Gateway configuration, add the required secrets using the current variable names:
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
Enter the corresponding values when prompted. The API key and gateway settings must match your selected provider and authentication method.
Important: Some older deployment guides use AI_GATEWAY_API_KEY and AI_GATEWAY_BASE_URL. The current official repository documents the native configuration names shown above. Do not copy outdated commands without checking the latest README.
A gateway token is required for remote Control UI access. Generate a random token instead of using a simple password.
export MOLTBOT_GATEWAY_TOKEN=$(openssl rand -hex 32)
Save the generated token securely. Then store it as a Cloudflare Worker secret:
echo "$MOLTBOT_GATEWAY_TOKEN" | npx wrangler secret put MOLTBOT_GATEWAY_TOKEN
Security tip: Never publish your gateway token in a public repository, screenshot, or website article. Anyone with access to a valid token may be able to access the protected interface, subject to the other configured access controls.
Once the dependencies, AI credentials, and gateway token are configured, you can deploy the project.
npm run deploy
The deployment script builds the project and runs the Wrangler deployment process. Wait for the command to complete successfully.
Wrangler will display the deployed Worker address. It normally uses a workers.dev subdomain unless you have configured another supported route.
First deployment: Keep your terminal open until the deployment process finishes. Do not close it while Wrangler is still building or publishing your Worker.
After deployment, use the Worker URL shown by Wrangler. The official Quick Start provides this URL pattern:
https://your-worker.workers.dev/?token=YOUR_GATEWAY_TOKEN
Replace the example Worker subdomain and token with your actual values. The first request may take around one or two minutes while the Sandbox container starts.
Keep the complete URL private because it contains your gateway token. Do not share it in public posts or screenshots.
A successful Worker deployment is an important milestone, but it does not mean every feature is fully configured. Complete the relevant access and storage steps before using your AI agent regularly.
Protect the administrative interface with an Access application and an appropriate allow policy.
Read the setup guide →Review pending device requests and approve only devices you trust through the admin interface.
Learn about device pairing →Configure R2 if you need supported data and backups to persist across container restarts.
Configure persistent storage →Once deployment finishes, check that the Worker is reachable and that the required services are configured correctly.
Run this command to view the configured secret names:
npx wrangler secret list
This helps you identify whether expected secret names have been added. It does not display their private values.
Use Wrangler's live log command to investigate runtime issues:
npx wrangler tail
Review any error messages and compare them with the configuration required by the current repository.
Deployment problems can come from missing credentials, incorrect account settings, dependency issues, or configuration changes. Here are some common checks.
| Deployment issue | What to check |
|---|---|
| Wrangler authentication fails | Run npx wrangler login and authorize the correct Cloudflare account. |
| Dependency installation fails | Check Node.js, npm, network access, and the repository's package requirements. |
| Worker deployment fails | Review the terminal error, Wrangler configuration, and Cloudflare account permissions. |
| AI agent does not respond | Check the provider API key, gateway credentials, and selected model configuration. |
| Control UI access is denied | Review the gateway token, Cloudflare Access policy, and required Access secrets. |
| Container takes time to start | Allow time for the Sandbox to initialize and inspect the Worker logs. |
| Configuration changes do not appear | Confirm that the updated secrets or project files were deployed successfully. |
Windows users: If a shell script fails with an error such as exit code 126, check Git line endings. The official repository documents a possible CRLF issue and recommends using appropriate LF line endings.
For version-specific problems, check the official Moltworker repository and its current issues.
The cost of deploying Moltworker depends on the Cloudflare plan, container runtime, AI provider, and optional services you enable. The Workers Paid plan is required for Sandbox containers, but it should not be treated as the complete cost of running an always-active agent.
The official repository lists a $5 USD monthly starting plan requirement for Cloudflare Sandbox containers. Check current plan details.
Running the Sandbox container consumes resources and can create additional usage charges.
AI provider requests may be billed separately based on the model and your usage.
For accurate estimates, check the current Cloudflare Workers pricing documentation and your selected AI provider's pricing before deployment.
Use this checklist to review the main deployment tasks.
Moltworker deployment is the process of installing and running the Cloudflare Moltworker project so an OpenClaw-based AI agent can operate inside Cloudflare Sandbox infrastructure.
Start by cloning the official repository, installing dependencies with npm, configuring your AI provider and gateway token, and running the project's deployment command. Then follow the repository instructions for remote access and security.
Yes. The official repository lists a Cloudflare Workers Paid plan as a requirement for Sandbox containers. Additional container compute costs may apply.
Yes. The Cloudflare deployment approach runs the adapted OpenClaw runtime in Cloudflare Sandbox containers, so you do not need a dedicated Mac Mini to host the agent. You still need a computer to manage the deployment.
The official Quick Start documents direct Anthropic access and Cloudflare AI Gateway configuration. Check the current repository for supported provider options and model configuration.
Deployment time depends on your computer, network, dependency installation, and Cloudflare environment. The first request can take longer while the Sandbox container starts. There is no guaranteed deployment time for every environment.
No. A Workers Paid plan is required for Sandbox containers, and compute and AI usage may add further costs. Check current pricing before deploying.
Cloudflare describes the project as an experimental proof of concept rather than an officially supported product. Review its limitations and security requirements before using it for important workloads.
The official Cloudflare Moltworker GitHub repository contains the latest Quick Start, configuration details, and project updates.
Continue learning with our related guides. Each page covers a different part of the Moltworker process.
Start with the official source code, prepare your Cloudflare account, and follow the deployment process carefully. Always check the latest repository instructions before making changes to your environment.
Open Official GitHub Repository ↗