[{"data":1,"prerenderedAt":58},["ShallowReactive",2],{"\u002Fcf-deploy":3},{"title":4,"description":5,"path":6,"date":7,"updated":8,"verified":8,"category":9,"keywords":10,"officialSources":17,"related":33,"readingTime":37,"html":38,"toc":39},"cf deploy: build, check, deploy","cf deploy builds by default and deploys standardized Build Output. Verify the framework integration, selected mode, secrets, and Worker target first.","\u002Fcf-deploy","2026-09-29","2026-09-30","Deployment",[11,12,13,14,15,16],"cf deploy","cloudflare cf deploy","cf deploy worker","cf deploy build output","cf deploy --prebuilt","cf deploy --mode",[18,21,24,27,30],{"label":19,"url":20},"Official cf build and deploy guide","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fcf\u002Fprojects\u002F",{"label":22,"url":23},"Official Wrangler to cf command reference","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fcf\u002Fwrangler\u002Freference\u002F",{"label":25,"url":26},"cf build implementation and output validation","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fcf\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fsrc\u002Fcommands\u002Fbuild\u002Findex.ts",{"label":28,"url":29},"First deployment secrets issue #31","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fcf\u002Fissues\u002F31",{"label":31,"url":32},"Secrets file formats issue #30","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fcf\u002Fissues\u002F30",[34,35,36],"\u002Fwrangler-to-cf","\u002Fcloudflare-config","\u002Ferrors\u002Fcf-deploy-mode-nuxt",3,"\u003Ch2 id=\"basic-deployment\">Basic deployment\u003C\u002Fh2>\n\u003Cdiv class=\"code-block\">\u003Cdiv class=\"code-toolbar\">\u003Cspan>Terminal\u003C\u002Fspan>\u003Cbutton type=\"button\" data-copy-code aria-label=\"Copy code\">Copy\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre>\u003Ccode class=\"hljs language-bash\">cf auth login\n\n\u003Cspan class=\"hljs-comment\"># Build and deploy a supported project\u003C\u002Fspan>\ncf deploy\n\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cp>Run the command in the project root. You need valid authentication, the intended account, and a supported build integration. A \u003Ccode>cloudflare.config.ts\u003C\u002Fcode> file by itself is not standardized Build Output.\u003C\u002Fp>\n\u003Cp>For a new plain Worker, \u003Ccode>cf init\u003C\u002Fcode> prepares the scaffold and integration. For an existing project, review \u003Ca href=\"\u002Fwrangler-to-cf\">cf migrate\u003C\u002Fa> and your framework’s current support before changing the deployment command.\u003C\u002Fp>\n\u003Ch2 id=\"understand-the-build-contract\">Understand the build contract\u003C\u002Fh2>\n\u003Cp>By default, deploy runs the detected build workflow and then reads the Build Output. That output contains resolved configuration and the files to upload. \u003Ccode>--prebuilt\u003C\u002Fcode> skips building; it does not convert arbitrary \u003Ccode>dist\u003C\u002Fcode> or \u003Ccode>.output\u003C\u002Fcode> folders into valid Build Output.\u003C\u002Fp>\n\u003Cdiv class=\"code-block\">\u003Cdiv class=\"code-toolbar\">\u003Cspan>Terminal\u003C\u002Fspan>\u003Cbutton type=\"button\" data-copy-code aria-label=\"Copy code\">Copy\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre>\u003Ccode class=\"hljs language-bash\">cf build\n\n\u003Cspan class=\"hljs-comment\"># Reuse the standardized output from a successful build\u003C\u002Fspan>\ncf deploy --prebuilt\n\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cp>If your adapter only generates a normal framework bundle, investigate its Build Output integration. Do not rename a directory or point at a Nitro entrypoint and assume cf can deploy it.\u003C\u002Fp>\n\u003Ch2 id=\"check-modes-and-worker-selection\">Check modes and Worker selection\u003C\u002Fh2>\n\u003Cdiv class=\"code-block\">\u003Cdiv class=\"code-toolbar\">\u003Cspan>Terminal\u003C\u002Fspan>\u003Cbutton type=\"button\" data-copy-code aria-label=\"Copy code\">Copy\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Requires a build integration that supports the chosen mode\u003C\u002Fspan>\ncf deploy --mode production\n\n\u003Cspan class=\"hljs-comment\"># Reuse output built with the same recorded mode\u003C\u002Fspan>\ncf deploy --prebuilt --mode production\n\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cp>The prebuilt output’s recorded mode must match a requested mode. Rebuild for a different mode. \u003Ccode>--worker\u003C\u002Fcode> selects a Worker already present in the Build Output; it is not a flag for renaming a deployment on the fly.\u003C\u002Fp>\n\u003Cp>Framework support varies. In cf 1.0.0-beta.5, the \u003Ca href=\"\u002Ferrors\u002Fcf-deploy-mode-nuxt\">Nuxt mode issue\u003C\u002Fa> prevents one detected Nuxt command from accepting \u003Ccode>--mode\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch2 id=\"secrets\">Secrets\u003C\u002Fh2>\n\u003Cdiv class=\"code-block\">\u003Cdiv class=\"code-toolbar\">\u003Cspan>Terminal\u003C\u002Fspan>\u003Cbutton type=\"button\" data-copy-code aria-label=\"Copy code\">Copy\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Inspect the supported options\u003C\u002Fspan>\ncf deploy --\u003Cspan class=\"hljs-built_in\">help\u003C\u002Fspan>\n\n\u003Cspan class=\"hljs-comment\"># Use a private local JSON file; do not commit it\u003C\u002Fspan>\ncf deploy --secrets-file .secrets.local.json\n\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Cp>The current CLI exposes \u003Ccode>--secrets-file\u003C\u002Fcode> for JSON or environment-file input. Early beta discussions that say the flag does not exist refer to older versions. Review the linked upstream reports for environment-file formats and first-deployment secret behavior before relying on them.\u003C\u002Fp>\n\u003Cp>\u003Ccode>bindings.secret()\u003C\u002Fcode> declares an expected binding. Keep values out of executable configuration and public build artifacts. The deployment script for this static website requires no Worker secrets.\u003C\u002Fp>\n\u003Ch2 id=\"checks-and-previews\">Checks and previews\u003C\u002Fh2>\n\u003Cp>\u003Ccode>cf deploy --dry-run\u003C\u002Fcode> builds and validates without uploading the Worker or sending API requests; it does not need credentials. If the project has no \u003Ccode>cloudflare.config.ts\u003C\u002Fcode>, automatic configuration can still install packages and change local files first. Inspect the generated output and local behavior before a real deployment.\u003C\u002Fp>\n\u003Cp>\u003Ccode>cf dev\u003C\u002Fcode> is local development, not a publicly accessible preview deployment. For a shareable Worker Preview, use \u003Ccode>cf previews deploy\u003C\u002Fcode>. It builds with preview context, uploads the preview, and needs credentials; the command has no \u003Ccode>--dry-run\u003C\u002Fcode> option. Preview behavior can change during the beta. Do not guess a \u003Ccode>cf deploy --preview\u003C\u002Fcode> flag.\u003C\u002Fp>\n\u003Ch2 id=\"common-failures\">Common failures\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Build Output missing:\u003C\u002Fstrong> the build integration produced a framework bundle without the required specification.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Mode mismatch:\u003C\u002Fstrong> prebuilt output belongs to another mode or does not record a mode.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>No matching Worker:\u003C\u002Fstrong> \u003Ccode>--worker\u003C\u002Fcode> does not match any Worker in the output.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Required secret unavailable:\u003C\u002Fstrong> review declaration, provisioning and the current first-deployment issue.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Unknown binding resource:\u003C\u002Fstrong> confirm the selected account and resource identifier.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Keep a working Wrangler deployment available while testing the beta. Use \u003Ca href=\"\u002Fwrangler-to-cf-commands\">the command reference\u003C\u002Fa> to compare workflows.\u003C\u002Fp>\n",[40,43,46,49,52,55],{"id":41,"text":42},"basic-deployment","Basic deployment",{"id":44,"text":45},"understand-the-build-contract","Understand the build contract",{"id":47,"text":48},"check-modes-and-worker-selection","Check modes and Worker selection",{"id":50,"text":51},"secrets","Secrets",{"id":53,"text":54},"checks-and-previews","Checks and previews",{"id":56,"text":57},"common-failures","Common failures",1790729614466]