ClawEngine.ai
All posts
Hosting

OpenClaw Cloudflare Containers Setup and What Recovery Costs You

How the OpenClaw guide runs the gateway on Cloudflare Containers with R2 backups, the limits it lists, and when a managed instance costs less.

OpenClaw on Cloudflare Containers runs the gateway behind a Cloudflare Worker, with SQLite databases replicated to R2 storage so a restarted container can restore its state. The OpenClaw guide marks this target as experimental. ClawEngine hosts the same agent from $24 a month billed yearly, and this article lays out what the Cloudflare route asks of the person who runs it.

How does OpenClaw run on Cloudflare Containers?

The OpenClaw Cloudflare Containers guide describes a Worker that forwards every HTTP and WebSocket request to one Durable Object. That object owns a single container running the official OpenClaw image, which listens on port 8080. A Litestream process inside the container streams SQLite changes to an R2 bucket, and on boot it restores them before the gateway starts.

The template deploys a standard-2 container with one instance. The guide is explicit that you should not raise that number, because the single Durable Object is what guarantees one writer at a time.

What do you need before you start?

This is not a one-click path. The guide lists a Cloudflare account with Workers, Containers and R2 available, Docker Buildx with linux/amd64 support, a public Docker Hub repository for your derived image, an S3-compatible command line tool, Node.js and npm, and your model provider and channel credentials.

Step in the guideWhat it involvesWho does it again later
Prepare the templateClone the repository, install packages, log in to Wrangler and confirm the right accountWhoever updates it
Create R2 storageCreate a bucket and an R2 API token limited to itWhoever rotates the token
Publish the imageBuild a derived image for linux/amd64 and push it to a public Docker Hub repositoryEvery OpenClaw update
DeployRun the check and deploy scripts to create the Worker, Durable Object, container and bucket bindingEvery update

The guide does not give a time estimate for this route, so any hour count is yours to set. Plan for the first run to be slower than the later ones.

What are the limits and recovery trade-offs?

This section of the guide is the one a buyer should read twice, because it describes what can go wrong in production.

  • Recovery point. Litestream syncs about once a second. The guide calls this a seconds-scale recovery point but says it is not synchronous replication, and abrupt termination can lose writes that have not reached R2.
  • Ephemeral disk. Every sleep, replacement or host restart starts from the image plus the restored databases. Litestream protects SQLite, not the whole state directory, so config, credential files, plugin files and workspaces need the full archive backups from the OpenClaw backup guide.
  • Rollback side effects. Restoring older database bytes is time travel. The guide warns that channel credentials, WhatsApp in particular, can fall out of sync, and approvals and delivery state also roll back, so you relink channels and review pending approvals.
  • Egress. Outbound requests use shared Cloudflare address space with no fixed egress address, which matters if a downstream system allow-lists by IP.
  • Not a provider. The guide says this is a deployment template, not an OpenClaw cloud worker provider.

The guide also reports measurements on its own template: about 2.4 seconds from write to replica, and about 9 seconds to restore both databases, with a healthy gateway roughly 13 seconds after start. It tells you to treat these as order-of-magnitude figures, not guarantees.

Is the Cloudflare route cheaper than managed hosting?

The answer depends on a bill this article cannot fill in for you, because Cloudflare pricing for Workers, Containers and R2 changes. Read the current figures on Cloudflare's own pricing pages and add them up for one standard-2 container running all month. Then add the work.

Here is a worked example with labelled assumptions, not measurements. Say an ops lead spends 3 hours a month on image rebuilds, update testing, token rotation and checking that restores work, and the team values that time at $50 an hour. That is $150 a month of attention before any Cloudflare charge. Team at $288 a year is $24 a month, so the managed plan is cheaper whenever your real monthly hours exceed about half an hour at that rate.

LineCloudflare routeClawEngine Team
Platform feesYour Cloudflare bill$24 a month billed yearly, or $49 monthly
Hours per month (assumed)3 at $50 = $1500 on infrastructure
Model tokensYour providerYour provider
BackupsYou design them beyond SQLiteDaily, kept 7 days

Change the hours to match your team. If nobody wants to own the pipeline, the number is not the point.

When is the Cloudflare route the right choice?

It fits a team that already lives in Cloudflare, wants the gateway close to its other Workers, and has an engineer who likes owning a build pipeline. It also fits someone who wants to test scale-to-zero behaviour for webhook-driven agents, which the guide discusses. Because the guide calls it experimental, keep production credentials out of it until you have tested a restore.

It is a poor fit when the agent must answer on a chat channel all day and nobody is assigned to the deployment. In that case a managed instance removes the job. If you also run the agent for a creator or seller client, a tool such as Earnly can handle the client's payout tracking while you keep the agent running.

What does ClawEngine do instead?

ClawEngine runs the gateway in its own cloud, so there is no Worker, bucket or derived image in your account. The instance runs in an isolated container with hard CPU and RAM limits, daily backups of memory, workspace and configuration are kept for 7 days, and updates and gateway monitoring are handled for you. You bring your own model key and your provider bills the tokens. You do not get root access.

Compare the options in the hosting pricing comparison, see how rented servers stack up in the Hetzner comparison, or read the Tailscale upkeep article for the private-network route, or the GCP Compute Engine cost article for a plain cloud VM. When you are ready, start with a plan and have an instance running today.

Frequently asked questions

Does OpenClaw run on Cloudflare?

Yes, as an experimental deployment target. The guide runs the official OpenClaw image in a Cloudflare Container behind a Worker, with Litestream copying SQLite databases to R2. It is a template you deploy yourself, and the guide says to read its limits before using production credentials.

Is OpenClaw on Cloudflare production ready?

The guide labels the target experimental. It lists real limits, including seconds of possible data loss on abrupt termination, an ephemeral disk and channel credential drift after a rollback. Test a restore with a separate bucket before relying on it.

What does OpenClaw need on Cloudflare?

A Cloudflare account with Workers, Containers and R2, Docker Buildx for linux/amd64, a public Docker Hub repository, Node.js with npm, and your model and channel credentials. The template deploys a standard-2 container with a single instance.

Can ClawEngine run inside my Cloudflare account?

No. ClawEngine instances run in our own cloud. If the gateway has to live in your Cloudflare account, the self-run template is the honest choice.

Build the agent you just read about

Describe the job on our home page and get its workspace files, its first reply and the instance we would host for it.

Build your agent

Run OpenClaw without running servers

Isolated instances, updates, daily backups, monitoring, roles, approvals and spend caps, from one panel.