Skip to content
DocscloudDocumentation

Deploy into your own Cloudflare account

Connect your Cloudflare account to Lunora Cloud with a scoped API token, and deploy into it as plain Workers. Your data stays in your account, and Cloudflare bills you for it directly.

Last updated:

A Lunora Cloud project can deploy into a Cloudflare account your organization connects, instead of Lunora Cloud's own. Each project becomes a plain Worker in your account, at https://<alias>.<your subdomain>.workers.dev. Its Durable Objects, D1 databases, KV namespaces and R2 buckets live in your account, where you can see them. Lunora Cloud orchestrates deploys and rollbacks, and Cloudflare bills you for usage directly.

Private early access. Lunora Cloud is in private early access, and nothing on this page is generally available. See the roadmap.

You deploy the same way as on any other target. lunora cloud deploy and push-to-deploy send the same release. The deploy target is a setting of the project, not a flag (see CLI).

Connect an account

Create an API token

In your Cloudflare dashboard, create an account API token, either under My Profile → API Tokens or under the account's own API Tokens page. Scope it to this one account. Give it these permissions:

PermissionNeededUsed for
Workers Scripts: EditRequireduploading the Worker, its cron triggers and queue consumers, and reading the workers.dev subdomain
Account Analytics: ReadOptionalrequest counts for the Usage tab
Billing: ReadOptionalthe account's real spend on the Cloudflare costs tab (self-serve accounts only)
D1: EditOptionald1 bindings
Notifications: EditOptionalsetting up Cloudflare's own usage alerts on the account from the Cloudflare accounts tab
Queues: EditOptionalqueue bindings
Workers KV Storage: EditOptionalkv bindings
Workers R2 Storage: EditOptionalr2 bindings

No zone permission is needed. Lunora Cloud does not add routes on your zones yet (see Limits).

Connect it in the studio

In the studio, open your organization's Cloudflare accounts tab and choose Connect a Cloudflare account. Only owners and admins can do this. Enter the account ID, an optional name, and the token.

Lunora Cloud checks the token before it stores anything. The token must be active and must reach the account with Workers Scripts, and the account must already have a workers.dev subdomain. If it doesn't, open Workers & Pages in the account's dashboard once to claim one. The optional permissions are probed with read-only calls, and the account's card lists any that were not granted.

The token is encrypted before it is stored, and it is never shown again. To replace it, rotate the token from the same card. A rotation only accepts a token for the same account.

Put a project on the account

In a project's Deploy target card, choose Your Cloudflare account and pick the account. Then deploy as usual.

What gets created in your account

  • A Worker for each of the project's deployment aliases. The same Worker is updated in place on every deploy and every rollback, so its Durable Object data carries over. It runs its own cron triggers and consumes its own queues.
  • One resource per binding that needs one. This covers D1 databases, KV namespaces, R2 buckets, queues and Analytics Engine datasets. Each is named <alias>--<binding>. It is created on the first deploy, reused by every release after that, and deleted only when the project itself is torn down.

Every other binding your app declares is either bound as-is or refused before the deploy starts (see What works). One thing to watch on this target: a deploy that stops binding a Durable Object class deletes that class's data. For this reason, Lunora Cloud refuses a rollback to a release that does not bind a class the live release binds.

What Lunora Cloud keeps

  • Your token, encrypted.
  • The convergence state. Lunora Cloud tracks what it has created in your account, so that a later deploy updates those resources instead of creating them again. It keeps that state in its own store, not in your account.
  • Your releases, as it does on every target, so that a rollback can restore an earlier one without a rebuild.

Your app's data is not on this list. It stays in your account.

Usage and billing

Once an hour, Lunora Cloud reads your Worker's request counts from your account's GraphQL Analytics API, and shows them in the studio's Usage tab. To do this, the token needs Account Analytics: Read. Without it, the Usage tab shows no requests for this account. Nothing else changes.

Lunora Cloud shows these counts but never bills them. Cloudflare bills your account for what your Workers use. Lunora Cloud charges for the control plane, which is your plan. Each plan caps how many Cloudflare accounts an organization can connect. The Free plan allows one.

Usage alerts from Cloudflare itself

Because Cloudflare bills your account directly, your plan's spend cap never stops a project in it. Set up the alerts a careful Cloudflare customer sets up by hand instead. Cloudflare sends them, so they keep working even if Lunora Cloud is down.

On the Cloudflare accounts tab, an owner or admin selects Set up Cloudflare usage alerts on an account. Lunora Cloud reads which products Cloudflare's Usage Based Billing notifications can watch on that account. Cloudflare offers them for Workers requests and for Durable Objects. It has none for D1 or for Workers CPU time: only the budget alert below covers those.

For Workers requests, Lunora Cloud proposes three times what your Lunora Cloud projects there used last month, rounded up, and never below what the Workers Paid plan includes. If it has no full month of usage for the account, it suggests the included amount and leaves the product unticked. For the other products, you enter the threshold yourself. Cloudflare does not document the unit of these thresholds, so after saving, the studio shows what Cloudflare stored. Check one in the Cloudflare dashboard before you rely on it.

Recipients default to your organization's owners and admins. You can change every value before anything is saved. Running the setup again updates the alerts it created, and never duplicates them. It keeps what you changed on them in Cloudflare: an alert you switched off stays off, and extra addresses, webhooks and PagerDuty destinations stay. Alerts you made yourself are listed, and left alone.

  • The token needs Notifications: Edit. You can add it to the token in Cloudflare. The connection keeps working without being rotated.
  • Usage Based Billing notifications are for Pay-as-you-go accounts. Most Enterprise contracts are not supported. The studio shows Cloudflare's own message when it refuses.
  • Cloudflare counts the whole account. If other Workers run there, raise the thresholds.
  • The alerts live in your account. Disconnecting it does not delete them. To stop them, select Remove Lunora-managed alerts on the account first, or delete them under Notifications in Cloudflare.

An account-wide budget alert, which emails you when your total usage-based spend passes an amount in US dollars, exists only in Cloudflare's dashboard. Add one under Manage Account → Billing → Billable Usage → Create budget alert.

What works, and what doesn't

When you deploy, Lunora Cloud checks the bindings in your wrangler.jsonc against the table below. If your app uses a binding this target cannot provide, the deploy is refused by name before anything is created. The table is generated from that same check, so it shows what the deploy actually enforces.

Bindingwrangler typeAvailableWhy not
Analytics Engineanalytics_engineYes — created for you
D1d1Yes — created for you
KVkvYes — created for you
Queue producersqueue_producerYes — created for you
R2r2Yes — created for you
Browser RenderingbrowserYes
Durable Objectsdurable_objectYes
ImagesimagesYes
Queue consumersqueue_consumerYes
Static assetsassetsYes
Workers AIaiYes
WorkflowsworkflowYes
AI Searchai_searchNothe provision box does not bind an AI Search instance yet.
AI Search namespacesai_search_namespaceNothe provision box does not bind an AI Search namespace yet.
Analytics SQLanalytics_sqlNothe provision box does not bind Analytics SQL yet.
ArtifactsartifactsNoan Artifacts namespace is an account resource the provision box does not create or bind yet.
ContainerscontainerNoa container needs its image built and pushed to your account's registry on every deploy, which the provision box does not do yet.
HyperdrivehyperdriveNoa Hyperdrive config needs your database's connection string, which the binding manifest does not carry; connect to it from an action instead.
Media TransformationsmediaNothe provision box does not bind Media Transformations yet.
PipelinespipelineNoa pipeline needs its stream and sink configured, which wrangler.jsonc does not carry.
Service bindingsserviceNoa service binding needs its sibling Worker deployed alongside, which a project's deploy does not ship yet.
StreamstreamNothe provision box does not bind Stream yet.
VectorizevectorizeNoan index needs its dimensions and metric, which wrangler.jsonc does not carry.
VPC networksvpc_networkNothe provision box does not bind a VPC network yet.
VPC servicesvpc_serviceNothe provision box does not bind a VPC service yet.

Beyond bindings, this target does not have:

  • Per-plan runtime limits. The CPU-time and subrequest caps your plan sets are applied by Lunora Cloud's dispatcher, which does not sit in front of a Worker in your account. Your account's own Workers limits apply instead.
  • Spend cap. Cloudflare bills your account directly, so your plan's spend cap never stops these projects. Set up Cloudflare's own usage alerts from the Cloudflare accounts tab — Cloudflare sends them, so they keep working even if Lunora Cloud is down — and add an account-wide budget alert in your Cloudflare dashboard (Manage Account → Billing → Billable Usage → Create budget alert), which Cloudflare offers only there.
  • Custom domains. Your Worker answers on your account's workers.dev subdomain. Attaching your own zone's hostnames to it from Lunora Cloud is not wired yet; add a Custom Domain to the Worker in your Cloudflare dashboard meanwhile.
  • Runtime logs. Lunora Cloud's tail consumer runs in its own account and cannot be attached to a Worker in yours, so runtime logs stay in your account's Workers Logs.
  • Recursion protection. Loop detection needs Lunora Cloud's dispatcher and an Outbound Worker on its dispatch namespace; a plain Worker in your account has neither. Only Cloudflare's per-invocation subrequest limit applies there.
  • Edge firewall events and rules. Your Worker is served from your account, not Lunora Cloud's zone, so its firewall events and DDoS settings live in your Cloudflare dashboard. Usage anomalies still alert.
  • Emergency stop without a working token. An emergency stop replaces the Worker in your account through the token you connected, so it fails — and is retried — while that token is revoked or lacks Workers Scripts: Edit. The stub keeps every Durable Object's data and parks its alarms an hour at a time (one invocation and one storage write each), and drops the Worker's cron triggers and queue consumers until the resume restores them; messages sent meanwhile wait on the queue for its retention period. Workflow classes are stubbed too, and a Workflow instance that is running when the stop lands fails on its next wake, permanently: the stub's run() throws rather than resuming the instance, so the instance is not recoverable after a resume. The halt record lists the workflow classes it stubbed.

Workflows have three limits beyond the table. Lunora Cloud does not use the name you declare for a Workflow: the Workflow's name is derived from the script and the class, so the name in your dashboard can differ from your config. A Workflow class may be bound only once in a deploy, and a deploy that binds one Workflow class under two names is refused. A Durable Object class may be bound under two names. A workflow is identified by its class, so renaming a binding that keeps its class leaves the workflow and its instances alone. Removing or renaming the class itself drops it, and the next deploy is refused unless you allow that deletion. Its instances. An emergency stop does not pause a running Workflow instance: the instance fails on its next wake and does not resume after a resume.

Limits

The list above is generated from the same contract the deploy checks. In plain terms, and with what is planned:

  • Custom domains on your zone are not wired yet. Your Worker answers on your account's workers.dev subdomain. To use your own hostname for now, add a Custom Domain to the Worker in your Cloudflare dashboard.
  • Runtime logs stay in your account. Lunora Cloud's log tail runs in its own account and cannot be attached to a Worker in yours, so use your account's Workers Logs.
  • Connecting uses a pasted token. Connecting through Cloudflare's OAuth for third-party apps, instead of pasting a token, is planned.

Disconnecting

Disconnect the account from its card in the Cloudflare accounts tab.

  • It is refused while the account is in use. If a project or a deployment that has not been torn down still uses the account, move those projects to another target first.
  • Lunora Cloud deletes its copy of the token. Nothing in your account is deleted, so the Workers and their data stay yours.
  • The token stays valid until you revoke it in your Cloudflare dashboard. Do that too.

Everything already runs in your account, so leaving needs no data export. Your Workers keep serving after you disconnect. Lunora Cloud just stops deploying to them.