How to Install Moltworker on Cloudflare
Moltworker lets you run the OpenClaw personal AI assistant inside a Cloudflare Sandbox environment. Instead of keeping a dedicated computer running at home, you can deploy the project using Cloudflare's developer platform.
If you are new to the project, it helps to understand what Moltworker is and how it works before starting the installation.
This guide uses the official Cloudflare Moltworker GitHub repository. The instructions cover the standard command-line deployment route, followed by the recommended security and storage configuration.
Before you begin: Moltworker is an experimental proof of concept. It is not an officially supported, production-ready Cloudflare product. Review the repository and current documentation before using it for important workloads.
What Do You Need to Install Moltworker?
Prepare the following items before running the installation commands. Having your accounts and tools ready makes the deployment process easier.
Cloudflare Account
A Cloudflare account with access to Workers and Sandbox Containers. A Workers Paid plan is required for the Sandbox Containers used by this project.
Node.js and npm
Install Node.js with npm so you can install project dependencies and run the deployment scripts.
Git
Git is used to download the official Moltworker source code from GitHub.
AI Provider API Key
You need an AI provider credential, such as an Anthropic API key, or a supported Cloudflare AI Gateway configuration.
Check your installation tools
Open your terminal, Command Prompt or Git Bash and check whether Node.js, npm and Git are installed.
node -v
npm -v
git --version
If these commands return version numbers, the tools are available. Otherwise, install them from their official websites:
Moltworker Installation: Step-by-Step
Follow these steps in order. The commands below use the official repository and its documented deployment process.
Step 1: Open the Official GitHub Repository
First, visit the official Cloudflare Moltworker repository. This is the source you should use rather than an unofficial mirror or third-party download.
Review the README and check the latest project requirements before continuing.
Step 2: Clone the Moltworker Repository
Open your terminal and run the following command to download the project to your computer.
git clone https://github.com/cloudflare/moltworker.git
Move into the downloaded project directory:
cd moltworker
You should now be inside the local Moltworker project folder.
Step 3: Install Project Dependencies
Install the packages required by the project using npm.
npm install
Wait until the installation finishes. If npm reports an error, check your Node.js version, internet connection and terminal output before continuing.
Step 4: Connect Your Cloudflare Account
Authenticate Wrangler, the Cloudflare command-line tool used by the project.
npx wrangler login
A browser window will open. Sign in to your Cloudflare account and approve the requested access. Return to your terminal after authentication is complete.
Step 5: Configure Your AI Provider
Moltworker needs access to an AI model to respond to messages. The simplest documented route is to configure an Anthropic API key.
Run:
npx wrangler secret put ANTHROPIC_API_KEY
When prompted, paste your API key. The secret is stored by Wrangler rather than being written directly into your source code.
You can obtain an API key through the Anthropic Console. Provider usage may incur separate charges.
Alternative: The project also supports Cloudflare AI Gateway. Its current native configuration uses CLOUDFLARE_AI_GATEWAY_API_KEY, CF_AI_GATEWAY_ACCOUNT_ID and CF_AI_GATEWAY_GATEWAY_ID. Follow the official README for the exact provider-specific setup.
Step 6: Generate a Secure Gateway Token
The gateway token protects access to your remotely hosted Control UI. Generate a random token using OpenSSL:
export MOLTBOT_GATEWAY_TOKEN=$(openssl rand -hex 32)
Display the generated token so you can save it securely:
echo "$MOLTBOT_GATEWAY_TOKEN"
Now save it as a Cloudflare secret:
echo "$MOLTBOT_GATEWAY_TOKEN" | npx wrangler secret put MOLTBOT_GATEWAY_TOKEN
Keep this token private. Do not publish it in screenshots, public repositories or website content.
Windows users can run these commands in Git Bash or another terminal with OpenSSL available.
Step 7: Deploy Moltworker to Cloudflare
Once the dependencies and required secrets are configured, deploy the project:
npm run deploy
The deployment process builds the application and publishes the Worker using Wrangler. When it completes, the output should include your Worker URL.
It will usually look similar to:
https://your-worker.workers.dev
Use the actual URL displayed in your terminal, not the example above. The first request may take around one or two minutes while the container starts.
How to Access Your Moltworker Installation
After deployment, open your Worker URL in a browser and add your gateway token as a query parameter.
https://your-worker.workers.dev/?token=YOUR_GATEWAY_TOKEN
Replace the example Worker address and token with your own values. Keep the token private because it grants access to the Control UI.
Important security step: The initial deployment is not the end of the setup. The official project requires Cloudflare Access protection for the admin interface and device pairing through /_admin/ before you can use the Control UI normally.
Set Up Cloudflare Access
Cloudflare Access helps restrict who can reach the administrative interface. Follow the current official repository instructions for your Worker configuration.
Enable Cloudflare Access
Open Workers & Pages in the Cloudflare Dashboard. Select your deployed Worker, open Settings and find Domains & Routes. Use the workers.dev domain option to enable Cloudflare Access where available.
Configure an Access Policy
Open the Zero Trust dashboard and locate the Access application created for your Worker. Add an allow policy for your email address or configure an identity provider you trust.
Save the Access Details
Find your Access team domain and application audience (AUD) value. You will need these details to configure the Worker secrets.
Add the Required Secrets
npx wrangler secret put CF_ACCESS_TEAM_DOMAIN
npx wrangler secret put CF_ACCESS_AUD
Enter the matching values when Wrangler prompts you. Then deploy the updated configuration:
npm run deploy
Once configured, visit your Worker URL followed by /_admin/ and authenticate through Cloudflare Access. Use the admin interface to approve your new device pairing request.
Do not use DEV_MODE=true as a production security workaround. The project documents this setting for local development only.
Enable Persistent Storage with Cloudflare R2
By default, the project can use temporary container storage. If the container restarts, data such as configuration and conversation history may not be preserved. R2 provides an optional backup and restore approach.
1. Create an R2 API Token
- Open R2 in your Cloudflare Dashboard.
- Go to Manage R2 API Tokens.
- Create a token with Object Read & Write permissions.
- Restrict its access to the relevant bucket where possible.
- Save the Access Key ID and Secret Access Key securely.
2. Add the R2 Secrets
Run these commands from your Moltworker project directory:
npx wrangler secret put R2_ACCESS_KEY_ID
npx wrangler secret put R2_SECRET_ACCESS_KEY
npx wrangler secret put CF_ACCOUNT_ID
Enter the corresponding credentials when prompted. Your Cloudflare Account ID is available in your account dashboard.
3. Deploy the Updated Configuration
npm run deploy
After deployment, check the admin interface for the R2 storage status and backup options. R2 is optional, but it is worth considering if you want to preserve your assistant's configuration and data across container restarts.
Connect Telegram, Discord or Slack
You can optionally connect supported messaging platforms to your Moltworker assistant. Each platform requires its own bot credentials.
Telegram
Create a Telegram bot and configure its token as a Worker secret.
npx wrangler secret put TELEGRAM_BOT_TOKEN
npm run deployDiscord
Create a Discord application and bot, then save its token.
npx wrangler secret put DISCORD_BOT_TOKEN
npm run deployFor Slack, the repository documents both bot and app tokens:
npx wrangler secret put SLACK_BOT_TOKEN
npx wrangler secret put SLACK_APP_TOKEN
npm run deploy
Follow each platform's current developer documentation to create and configure the required credentials. Keep bot tokens private and review the project's device-pairing and direct-message policies before enabling a channel.
Moltworker Installation Problems and Solutions
If your Moltworker deployment does not work as expected, check these common issues before reinstalling the project.
| Problem | What to check |
|---|---|
| npm install fails | Check Node.js, npm, internet access and terminal error messages. |
| Wrangler authentication fails | Run npx wrangler login and confirm the correct Cloudflare account. |
| Deployment is rejected | Check your Workers plan and whether Sandbox Containers are available for your account. |
| AI assistant does not respond | Verify the provider API key, provider billing and configured model. |
| Admin page is inaccessible | Review Cloudflare Access, the application policy and the two Access secrets. |
| First request is slow | The container may need time to start. The initial request can take around 1–2 minutes. |
| Data disappears after restart | Check whether R2 persistence has been configured correctly. |
| Local WebSocket connection fails | The repository documents limitations with WebSocket proxying in local development. Test a deployed Worker. |
Useful troubleshooting commands
Check the configured secrets without displaying their values:
npx wrangler secret list
View your deployed Worker logs:
npx wrangler tail
These commands can help you identify missing configuration and runtime errors. Never share private API keys or tokens when asking for technical support.
How Much Does It Cost to Run Moltworker?
Moltworker is based on Cloudflare infrastructure, but that does not mean every part of the deployment is free.
Workers Paid Plan
The official repository lists a $5 USD monthly Workers Paid plan as a requirement for Sandbox Containers.
Container Usage
Container memory, disk and active CPU usage can add to the monthly bill. Costs depend on how long and how heavily your container runs.
AI Provider
Anthropic or another selected provider may charge separately for model usage, depending on the configured billing arrangement.
Optional Services
R2, Browser Rendering, network usage and other Cloudflare services may have separate limits or charges.
The official repository provides a container cost estimate and explains how an idle sleep setting can reduce usage. Check the latest cost estimate and Cloudflare Containers pricing before deploying. Your actual bill will depend on usage and current pricing.
Moltworker Installation Checklist
Before you start using your assistant, make sure the essential setup tasks are complete.
- Cloudflare account and required Workers plan are ready.
- Node.js, npm and Git are installed.
- Official Moltworker repository has been cloned.
- Project dependencies have been installed.
- Cloudflare authentication is working.
- AI provider credentials are configured.
- A secure gateway token has been saved.
- Deployment completed and the Worker URL is available.
- Cloudflare Access is configured for the admin interface.
- Device pairing has been completed.
- R2 storage has been considered and configured if needed.
Frequently Asked Questions About Moltworker Installation
Is Moltworker free to install?
The source code is publicly available, but deploying it requires a Workers Paid plan for Sandbox Containers. Container usage and AI provider charges may also apply.
Do I need a Mac Mini to run Moltworker?
No dedicated Mac Mini is required for the Cloudflare deployment approach. You use your local computer to prepare and deploy the project, while the application runs in Cloudflare's environment.
Can I install Moltworker on Windows?
Yes. You can use a Windows terminal environment with Git, Node.js, npm and the required command-line tools. Git Bash can be useful for commands that rely on OpenSSL.
Do I need an Anthropic API key?
The official quick-start instructions support direct Anthropic API access. The project also documents Cloudflare AI Gateway configurations and other supported provider options. Check the current README for the latest choices.
Why is my Moltworker Control UI not opening?
Check that deployment completed, the gateway token is correct and the container has started. You must also complete the required admin access protection and device-pairing steps.
Is Cloudflare Access required?
The official repository currently instructs users to protect the admin interface with Cloudflare Access and configure the related Access secrets. Follow the current README if the project changes its authentication process.
Does Moltworker save conversation history?
Persistent storage is optional. Without the documented R2 configuration, data stored in the container may not survive a restart.
Can I connect Telegram to Moltworker?
Yes. The project documents Telegram integration using a bot token stored as a Worker secret. You can also review its Discord and Slack setup instructions.
Is Moltworker suitable for beginners?
It is more suitable for users who are comfortable with terminals, API credentials and cloud configuration. Beginners can follow a guide, but some technical experience is helpful.
Useful Moltworker Installation Resources
Use these original resources when you need to verify a command, check a project update or learn more about Cloudflare services.
Official GitHub Repository
Source code, README, requirements and installation commands.
Visit GitHub ↗Cloudflare Announcement
Read the original explanation of the Moltworker project.
Read Cloudflare Blog ↗Cloudflare Sandbox Documentation
Understand the infrastructure used by the project.
Read Documentation ↗Start Your Moltworker Setup
Follow the official project documentation, configure your Cloudflare environment carefully and test your AI assistant before adding more integrations.
Get Moltworker on GitHub ↗ What Is Moltworker?