AI Agent Cloudflare Deployment Guide
September 24, 2026 · View on GitHub
This document defines the standard operating specifications and conventions for AI Agents (and automated deployment scripts) deploying EdgeEver on Cloudflare.
💡 Core Principle: Pure Serverless architecture running entirely within Cloudflare free limits—no VPS or server purchasing, no Docker or SSL certificate configuration required.
Standard Automated Deployment Steps
-
Fork Repository
- Fork
tianma-if/edgeeverto the target GitHub account.
- Fork
-
Create Cloudflare Resources
- Create a D1 database named exactly
edgeever. - Create an R2 bucket named exactly
edgeever-resources.
- Create a D1 database named exactly
-
Cloudflare Project Import
- In Cloudflare Workers & Pages, create a Worker named
edgeeverby importing the Fork repository. Select the repository root and production branchmain. - Keep the default Deploy command
npx wrangler deployin Cloudflare's Workers Builds settings. Cloudflare runs it in its build environment; the user does not run it on their computer. The repository routes it through EdgeEver's validated deployment pipeline. Do not create a Pages project for the application. - Select Save and Deploy to create the Worker. The initial build may fail because the administrator Secret has not been added yet; configure it in the next step, then retry.
- In Cloudflare Workers & Pages, create a Worker named
-
Configure Login Credentials & Instance Settings
- Worker Secret: After the Worker exists, add the runtime Secret
EDGE_EVER_AUTH_PASSWORDfor the initial administrator password. Prefer a strong password of at least 32 characters. - Keep this password only as a Worker runtime Secret; do not copy it into Workers Builds variables. The standard deploy entrypoint reuses and verifies the existing Secret.
- Do not edit
wrangler.tomlor add duplicate bindings in the Dashboard. The deployment command generates theDBandRESOURCESbindings from these standard resource names. - For an existing Worker deployed from older instructions, do not ask the user to rename or reconfigure a custom R2 bucket. With no explicit override, deployment automatically preserves the live
RESOURCESbinding and administrator username.
- Worker Secret: After the Worker exists, add the runtime Secret
-
Check Workers Builds Settings
- Keep the repository root,
mainbranch, and default Deploy commandnpx wrangler deployin Cloudflare's build settings. Existing deployments that already use the explicitbun run build:cloudflareandbun run deploy:cloudflare-buildscommands there may keep them. - The deployment pipeline automatically resolves the D1 UUID from the
edgeeverdatabase name and writes instance settings only to a temporary generated Wrangler configuration. The trackedwrangler.tomlmust remain unchanged; deployment rejects instance-specific values committed there so a Fork cannot diverge on infrastructure configuration. - Ensure the Workers Builds API token can read and edit D1. Advanced non-secret customization belongs in
EDGE_EVER_*Workers Builds variables. For a differently named database, setEDGE_EVER_D1_DATABASE_NAME; setEDGE_EVER_D1_DATABASE_IDonly if automatic UUID discovery is unavailable. Passwords remain runtime Secrets.
- Keep the repository root,
-
Start Initial Build & Verify Service
- Retry the build after adding the runtime Secret and any requested username override. Once deployed, run the following automated verifications:
- Check
https://<your-worker-domain>/api/healthreturns HTTP200with JSON{"ok": true}. - Check
https://<your-worker-domain>/api/openapi.jsonis reachable and returns JSON{"ok": true}. - Verify login API using the configured administrator username (default:
admin) andEDGE_EVER_AUTH_PASSWORD.
- Check
- Retry the build after adding the runtime Secret and any requested username override. Once deployed, run the following automated verifications:
-
Verify Upstream Update Channel
- In the Fork's Actions tab, enable Update deployed EdgeEver (required on public forks: scheduled workflows are disabled by default).
- An ordinary Fork is a deployment mirror by default. No update variable is required: the workflow applies the selected upstream Release's product snapshot to
mainbefore triggering Cloudflare. - The updater preserves the Fork's complete
.github/workflows/**directory and its two updater helper scripts as a stable local bootstrap layer. Official packaging, signing, testing, and Release workflows remain guarded totianma-if/edgeeverand are never rewritten by downstream product updates. - Only a Fork that intentionally maintains application-code changes should create the Actions repository variable
EDGE_EVER_PRESERVE_FORK_CHANGES=true. This opts into merges and requires the owner to resolve future conflicts; it is not needed for normal deployments. - Manually trigger Update deployed EdgeEver once in the Fork's Actions tab. A manual run republishes the selected version even when the Fork is already aligned, ensuring Cloudflare receives a fresh build event.
- Open the job Summary and confirm it reports Fork mode
mirror, the upstream target (stable Release or edgemain), and either an update publish or an explicit already aligned result. - Confirm Cloudflare Deployments builds the published
maincommit when a push occurred. - Do not edit deployment files or rely on GitHub Sync fork for routine upgrades; the workflow is the only synchronization path needed by a normal deployment Fork. Use Sync fork once only when an old Fork must receive a newer updater workflow itself, then return to Update deployed EdgeEver.
Optional: Customize the Initial Administrator Username
Ordinary deployments use the default username admin; do not proactively ask the user whether to change it. Only when the user explicitly requests a custom administrator username, set EDGE_EVER_AUTH_USERNAME in Workers Builds variables before retrying the initial build and use that username during login verification. Changing only this variable after the administrator account exists does not rename that account.