Mad World #Save_GAZA: Free Palestine  

Search

Cloudflare Pages for Production (2026): Free Hosting, Custom Domain, Private Previews, CI Token Deploys and Rollback, Tested

Cloudflare Pages for Production (2026): Free Hosting, Custom Domain, Private Previews, CI Token Deploys and Rollback, Tested

Cloudflare Pages puts a static website (HTML, CSS, JavaScript, images) on Cloudflare's network for free: you upload a folder, and visitors get it from a data centre near them, with HTTPS. This guide takes a small documentation site from a folder on a laptop to production: the first upload, deploys from the terminal, security headers, previews that only your team can open, your own domain, a rollback, and deploys from CI with a key that can do nothing but publish this one kind of project.

Tested on 18 and 26 November 2026 on a free Cloudflare account (NexaForge, our test account), with Wrangler 4.164.0 and Node.js 26.13.1 on Ubuntu 26.04.1. Every command below ran there, and every screenshot shows its real output.

Quick answer: Cloudflare Pages for production

In plain words: a Pages project is a folder of files with an address, <name>.pages.dev. Each upload is a new deployment with its own address; one of them is "production". You can upload from the dashboard or from the terminal with Wrangler, Cloudflare's command-line tool. Two small text files in the folder, _headers and _redirects, control headers and redirects without any server.

  1. Put the built site in one folder, with _headers, _redirects and a 404.html.
  2. Create the project by drag and drop in the dashboard (the first upload).
  3. Install Wrangler in the project and deploy with npx wrangler pages deploy.
  4. Deploy a branch name to get a preview address, and restrict previews with Cloudflare Access.
  5. Add your own domain; keep the pages.dev address out of search results with noindex.
  6. Know where the rollback button is before you need it.
  7. For CI, create an account API token that can only edit Pages, with an expiry date.
  8. Keep every file under 25 MiB and the site under 20,000 files on the free plan.
Cloudflare dashboard, Pages project nexaforge-docs, Custom domains tab: test.nexaforge.si with status Active and SSL enabled
The result: a Pages project on its own domain, with HTTPS. 1: the domain is active. 2: the certificate is in place.

Is Cloudflare Pages free? Limits and pricing in 2026

Yes. On every plan, requests for static files are free and unlimited: Cloudflare does not charge Pages sites per visit. What the plans change is how much you can build and attach. These are Cloudflare's published limits (checked 26 November 2026):

FreeProBusiness
Static requestsFree, unlimitedFree, unlimitedFree, unlimited
Builds per month (Git projects)5005,00020,000
Builds at the same time1520
Files per site20,000100,000100,000
Largest single file25 MiB25 MiB25 MiB
Custom domains per project100250500
Projects per account100100100
Preview deploymentsUnlimitedUnlimitedUnlimited

Two things can cost money. Pages Functions (server code inside a Pages project) count as Workers requests: 100,000 a day on the free plan, then the Workers Paid plan, from $5 a month with 10 million requests included. And on paid plans, the 100,000-file limit needs the variable PAGES_WRANGLER_MAJOR_VERSION=4 in the project settings. A plain static site, like the one in this guide, uses neither and stays at $0.

Pages or Workers static assets?

A Cloudflare Worker can serve static files too (Workers static assets), and the dashboard now leads with Workers: when you create an app, Pages sits behind a small link that calls it "the legacy Pages workflow". Pages still works, and Cloudflare publishes a guide for moving a Pages project to Workers. We uploaded the same folder both ways and checked the results:

Cloudflare dashboard Create an app page: Connect GitHub, Connect with GitLab, Start with Hello World, Select a template, Upload your static files, and the link Continue to Pages
The dashboard now starts with Workers. 1: the link to Pages ("the legacy Pages workflow"). 2: the Workers way to upload the same files.
Pages (Direct Upload)Workers static assets
Address<project>.pages.dev<worker>.<subdomain>.workers.dev
Price for static filesFree, unlimitedFree, unlimited
_headers and _redirectsYes (tested)Yes (tested)
/page.html to /page308 (permanent)307 (temporary, by default)
Preview of a branch--branch=staging gives staging.<project>.pages.devPreview URLs, on by default when workers.dev is on
Restrict previews with AccessOne button in the project settings (tested)Not tested here
RollbackDashboard button (tested)Version history kept (seen in wrangler deployments list)
New version answeringAt once, in our testsThe first request after the deploy got the old version; under a minute later, the new one
Server codePages Functions, billed as Workers requestsAny Worker code; the Workers docs describe "a distinctly broader set of features"

Our pick: a static site you deploy by hand or from CI is simple on Pages, and the private previews are one button. For a new project that may grow server code, start on Workers: the dashboard already treats Pages as the legacy path. The rest of this guide uses Pages; the Workers test is at the end.

What you need

  • A Cloudflare account. The free plan is enough for everything here.
  • Node.js and npm on your computer, for Wrangler. We used Node.js 26.13.1.
  • Your site, built, in one folder: plain HTML or the output folder of a site generator (often dist or public).
  • For your own domain: a domain whose DNS is on Cloudflare, or a subdomain you can point with a CNAME at your DNS provider.
  • For private previews: Cloudflare Zero Trust, which has a free plan (our Zero Trust 101 guide sets it up). Our account already had a team, nexaforge.

Step 1: Prepare the site folder

Our test site is five pages and a stylesheet in a folder called site. Two extra files hold the production rules. Create site/_headers:

Code
/*
  X-Frame-Options: DENY
  X-Content-Type-Options: nosniff
  Referrer-Policy: strict-origin-when-cross-origin

/assets/*
  Cache-Control: public, max-age=86400

https://:project.pages.dev/*
  X-Robots-Tag: noindex
  • Security headers on every page (/*): X-Frame-Options: DENY stops pages on another domain from loading yours in a frame, nosniff stops browsers from guessing file types, and the referrer policy sends only your domain name, not the full address, when a visitor follows a link to another domain.
  • A cache rule for /assets/*: browsers keep the stylesheet for one day. Use a long time (a year, with immutable) only when file names change with each build, like style.3f9a1c.css; with fixed names, a long cache shows old styles after a deploy. Cloudflare CDN caching explains the two cache layers.
  • noindex on the pages.dev address only. :project stands for your project's name, so the rule matches nexaforge-docs.pages.dev but not your own domain. Search engines then index one copy of the site, on your domain.

Create site/_redirects. Each line is <from> <to> [code]; without a code, Pages uses 302:

Code
/docs /getting-started 301
/start /getting-started

Keep a 404.html at the top of the folder. Without it, Pages treats the site as a single-page app and answers every unknown address with your home page and a 200 status, so broken links never show up as errors.

Terminal
node -v
tree site
cat site/_headers
cat site/_redirects
Terminal: node -v prints v26.13.1, tree shows the site folder with 404.html, _headers, _redirects, assets/style.css and three pages, then the content of _headers and _redirects
1: Node.js 26. 2: the site folder. 3: the headers file. 4: the redirects file.

Step 2: Create the project by drag and drop

The first upload is easiest in the dashboard. Open Compute > Workers & Pages and create an application. On the Create an app page, select Continue to Pages (the link under the Workers options, shown in the screenshot above), then Drag and drop your files:

Cloudflare dashboard Get started with Pages: Import an existing Git repository, or Drag and drop your files with the Get started button
Direct Upload: no Git repository needed.

Name the project. The name becomes the address, so choose it well: nexaforge-docs gave nexaforge-docs.pages.dev.

Deploy a site by uploading your project: project name nexaforge-docs, the address nexaforge-docs.pages.dev, and the Create project button
1: the project name becomes the address, here nexaforge-docs.pages.dev. 2: Create project.

Drop the folder, or a zip of it (we used a zip of the same seven files). Check that _headers and _redirects are in the list, then select Deploy site:

Upload step: 7/7 files uploaded from nexaforge-docs.zip (404.html, _headers, _redirects, changelog.html, getting-started.html, index.html) and the Deploy site button
1: all seven files arrived, the two rule files included. 2: Deploy site.
Success! Your project is deployed to Region: Earth, with the link nexaforge-docs.pages.dev
Version 1 is live at its pages.dev address.

One choice is final here: a project made by upload (Direct Upload) cannot switch to Git later. If you want Cloudflare to build from GitHub or GitLab on every push, make a Git project instead. With Direct Upload, you build the site yourself (or in your own CI) and upload the result, which is what the rest of this guide does.

Step 3: Check headers, redirects and the 404 page

Before you add a domain, check that the rule files work. curl -sI asks for the headers only:

Terminal
curl -sI https://nexaforge-docs.pages.dev/ | grep -iE '^(http|x-frame|x-content|referrer|x-robots)'
curl -sI https://nexaforge-docs.pages.dev/assets/style.css | grep -iE '^(http|cache-control)'
curl -sI https://nexaforge-docs.pages.dev/getting-started.html | grep -iE '^(http|location)'
curl -sI https://nexaforge-docs.pages.dev/docs | grep -iE '^(http|location)'
curl -sI https://nexaforge-docs.pages.dev/start | grep -iE '^(http|location)'
curl -s -o /dev/null -w '%{http_code}\n' https://nexaforge-docs.pages.dev/no-such-page

Everything matched: the three security headers and noindex on the pages.dev address, the one-day cache on the stylesheet, 301 and 302 for the two redirects, and a real 404. Pages also removes .html from addresses by itself, with a permanent 308, so link to /getting-started, not /getting-started.html.

Terminal: curl shows the security headers and noindex on pages.dev, a one-day cache on the stylesheet, 308 for .html, 301 for /docs, 302 for /start and 404 for a missing page
1: the three security headers, and noindex on the pages.dev address. 2: the cache rule for /assets. 3: Pages drops .html with a 308. 4 and 5: the two redirects, with their codes. 6: a real 404.

Step 4: Install Wrangler and sign in

Install Wrangler inside the project, as Cloudflare's docs advise, so every machine and your CI use the same version (npm records it in package.json):

Terminal
npm install --save-dev wrangler
npx wrangler --version
Terminal: npm install --save-dev wrangler adds 35 packages in 29 seconds, then npx wrangler --version prints wrangler 4.164.0
1: Wrangler goes into the project, not the whole system. 2: the version.

Sign in. wrangler login opens a Cloudflare page in your browser; select Authorize:

Terminal
npx wrangler login
npx wrangler whoami
Cloudflare page Wrangler wants to access your account: account NexaForge, 30 total permissions, and the Authorize button
The browser step of wrangler login: Wrangler asks for 30 permissions on the account. 1: Authorize.
Terminal: npx wrangler login ends with Successfully logged in; npx wrangler whoami shows an OAuth token for account NexaForge with a long list of permissions
1: the login. 2: whoami: an OAuth token with write access to Workers, D1, Pages and more.

Look at the list: the login token can write to Workers, D1, Pages, SSL certificates and more, for the whole account (the browser page counted 30 permissions). That is fine on your own computer. Never copy it to a server or CI; Step 10 makes a token for that. Then check that Wrangler sees the project:

Terminal
npx wrangler pages project list
Terminal: npx wrangler pages project list shows nexaforge-docs at nexaforge-docs.pages.dev, Git Provider No
The project made in the dashboard, seen from the terminal. Git Provider: No means Direct Upload.

Step 5: Deploy from the terminal

Change a page, then deploy the folder to the same project (use your project's name):

Terminal
npx wrangler pages deploy site --project-name=nexaforge-docs
curl -s https://nexaforge-docs.pages.dev/ | grep ''

Wrangler uploads only files that changed (here 1 of 5) plus the two rule files, and prints the new deployment's own address, https://d46f10ff.nexaforge-docs.pages.dev. That address keeps showing this exact version, even after later deploys. The main address switched to version 2 at once.

Terminal: wrangler pages deploy uploads 1 file (4 already uploaded) plus _headers and _redirects, then curl shows Version 2, deployed with wrangler
1: only the changed file is uploaded, and the deployment gets its own address. 2: the live site already shows version 2.

Step 6: Preview a change before it goes live

Give the deploy any branch name other than the production branch (main here), and it becomes a preview instead of production:

Terminal
npx wrangler pages deploy site --project-name=nexaforge-docs --branch=staging
curl -s https://staging.nexaforge-docs.pages.dev/ | grep ''
curl -s https://nexaforge-docs.pages.dev/ | grep ''
curl -sI https://staging.nexaforge-docs.pages.dev/ | grep -iE '^(http|x-robots)'

The preview gets two addresses: its own (fbedca29.nexaforge-docs.pages.dev) and an alias that always points to the latest deploy of that branch (staging.nexaforge-docs.pages.dev). Production kept version 2, and the preview answered with noindex too. When you deploy from a Git checkout, Wrangler reads the branch name by itself.

Terminal: a deploy with --branch=staging creates a preview and the alias staging.nexaforge-docs.pages.dev; the preview shows Version 3, production still Version 2, preview has noindex
1: a preview deployment with a branch alias. 2: the preview has version 3. 3: production still has version 2. 4: previews get noindex too.

Step 7: Add your own domain with HTTPS

Open the project's Custom domains tab and select Set up a custom domain:

Pages project Deployments tab: production d46f10ff on main, a preview on the staging branch and the first production deployment; the Custom domains tab is highlighted
The project's deployments: production, the staging preview and the first upload. 1: the Custom domains tab.
Add a custom domain: Domain field with test.nexaforge.si and the Continue button
1: the domain or subdomain. 2: Continue.

If the domain's DNS is on Cloudflare, the dashboard writes the DNS record for you. Read the confirmation screen: our test name already had an A record, and Pages replaced it with a CNAME to nexaforge-docs.pages.dev. If that name serves something else today, it stops the moment you select Activate domain.

Confirm new DNS record: the existing record A test 192.0.2.1 will be replaced by CNAME test nexaforge-docs.pages.dev; Activate domain button
Read this screen: 1: the record that was there. 2: the CNAME that replaces it. 3: Activate domain.
Custom domains list: test.nexaforge.si with status Initializing and a note that DNS changes can take up to 48 hours
1: the domain while Cloudflare sets it up. Ours turned Active in about three minutes.

The status went from Initializing to Active, with the certificate, in about three minutes. Then check it:

Code
dig +short test.nexaforge.si
curl -sI https://test.nexaforge.si/ | grep -iE '^(http|x-frame|x-robots)'
curl -sI https://nexaforge-docs.pages.dev/ | grep -iE '^(http|x-frame|x-robots)'
curl -sI http://test.nexaforge.si/ | grep -iE '^(http|location)'

The name points to Cloudflare, your domain serves the site without noindex while pages.dev keeps it, and plain HTTP is sent to HTTPS with a 301.

Terminal: dig shows two Cloudflare addresses for test.nexaforge.si; the custom domain answers 200 without noindex, pages.dev keeps noindex, and HTTP redirects to HTTPS with 301
1: the name points to Cloudflare. 2: the custom domain has no noindex. 3: the pages.dev address keeps it. 4: plain HTTP goes to HTTPS.

Two cases need more care. A bare domain (example.com, no subdomain) only works when the domain's nameservers are Cloudflare's: see how to change nameservers without breaking your services. A subdomain whose DNS is elsewhere works with a CNAME at your DNS provider, but add the domain in Pages first: a CNAME made before that does not resolve and shows error 522.

Step 8: Roll back a bad deploy

Every production deploy stays in the project's list. In Deployments > All deployments, open the menu of the version you want and select Rollback to this deployment:

Pages Deployments list: the menu of an older production deployment open, with Rollback to this deployment and Delete deployment
1: Rollback to this deployment, on an older production deployment.
Rollback to this deployment? dialog: it replaces the current production deployment on nexaforge-docs.pages.dev and test.nexaforge.si; Roll back button
The dialog lists every address that changes. 1: Roll back.
Terminal
curl -s https://test.nexaforge.si/ | grep ''
curl -s https://nexaforge-docs.pages.dev/ | grep ''

Both addresses served version 1 again right away. Only production deployments are rollback targets, not previews.

Terminal: right after the rollback, both test.nexaforge.si and nexaforge-docs.pages.dev show Version 1, deployed on Cloudflare Pages
1 and 2: both addresses serve version 1 again, at once.

Step 9: Make previews private with Cloudflare Access

Previews are public: anyone with the link can open them, and the addresses are easy to guess (the branch name). For unreleased work, put them behind a sign-in. In the project, open Settings > General > Preview access and select Restrict previews:

Pages project Settings, General: Preview access says preview deployments are public by default, with a Restrict previews button
Previews are public by default. 1: Restrict previews.
Pages project Settings after the change: Preview deployments are restricted by a Cloudflare Access policy; production pages.dev and custom domains are managed separately
1: previews now need a sign-in. The note below it matters: production is not covered.

Pages creates a Cloudflare Access application for *.nexaforge-docs.pages.dev and a policy that lets in the account's members. You find both under Zero Trust, on the Access Applications page. Add your team's e-mail addresses to the policy, or an e-mail domain rule:

Zero Trust Access applications: nexaforge-docs - Cloudflare Pages, destination *.nexaforge-docs.pages.dev, policy Allow Members - Cloudflare Pages
The Access application Pages made: every *.nexaforge-docs.pages.dev address.
Access policy Allow Members - Cloudflare Pages: Include, Selector Emails, Value igprod@igprod.net
Who may see previews: 1: the account member's e-mail. Add your team here.

Then test four addresses: the branch alias, a preview, production's own deployment address and the production address:

Terminal
curl -sI https://staging.nexaforge-docs.pages.dev/ | grep -iE '^(http|location)' | cut -c1-90
curl -sI https://fbedca29.nexaforge-docs.pages.dev/ | grep -iE '^(http|location)' | cut -c1-90
curl -sI https://8aa08ee5.nexaforge-docs.pages.dev/ | grep -iE '^(http|location)' | cut -c1-90
curl -sI https://nexaforge-docs.pages.dev/ | grep -iE '^(http|location)'

Before the change, all four answered 200. After it, the alias, the preview and even the deployment address of production (8aa08ee5, live again since the rollback in Step 8) send visitors to the Access sign-in page. Only nexaforge-docs.pages.dev stays public, as the settings page says. To keep people off the pages.dev address entirely, Cloudflare's docs suggest a Bulk Redirect from it to your own domain; we kept it, with noindex.

Terminal: the staging alias, a preview address and production's own deployment address answer 302 to nexaforge.cloudflareaccess.com; nexaforge-docs.pages.dev answers 200
1 to 3: the branch alias, a preview and even production's own deployment address now go to the sign-in page. 4: the production address stays public.
Cloudflare Access sign-in page: Log in to nexaforge-docs - Cloudflare Pages, an Email field and the Send login code button
What a visitor sees on a preview link: 1: the Access sign-in, with a one-time code sent by e-mail.

Step 10: Deploy from CI with a token that can only edit Pages

A CI job needs a key that can deploy and nothing else. Make an account API token: open Manage account > Account API tokens and create a token. Give it a name, keep Entire Account, and add one permission: Pages (in the Developer Platform group), Edit. An account token is not tied to a user: Cloudflare's docs describe it as a durable integration with its own permissions, made for CI/CD.

Account API tokens, Create a token: name pages-ci-deploy, Entire Account, and the Developer Platform permission Pages with Edit selected
1: a name you will recognise later. 2: one permission: Pages, Edit.

Set an expiry date (we chose 90 days), and if your CI has fixed outgoing addresses, limit the token to them. Review and create it:

Review token: name pages-ci-deploy, expiration February 24, 2027 (90 days), policy Entire NexaForge account Pages Write, all IP addresses allowed, Create token
1: the only right this token has. The expiry date is set (90 days). 2: Create token.
Token created successfully: the API token field and the Account ID field, with a note to copy the token now
Cloudflare shows the token once. 1: the token. 2: the account ID. Both go into your CI's secret store.

Store the token and the account ID as secrets in your CI. Wrangler reads them from two environment variables, so no wrangler login is needed. We tested it with the token in a private file, as a CI secret would be:

Terminal
export CLOUDFLARE_API_TOKEN="$(cat ~/.cf-pages-token)" CLOUDFLARE_ACCOUNT_ID="$(cat ~/.cf-account-id)"
npx wrangler pages deploy site --project-name=nexaforge-docs
curl -s https://nexaforge-docs.pages.dev/ | grep ''
npx wrangler r2 bucket list

The deploy worked and version 4 went live. The same token then tried to list R2 buckets and got Authentication error [code: 10000]: if it leaks from a CI log, it can publish this project and do nothing else. In a CI job, run the deploy line from a Git checkout, so the branch name decides production or preview. Never commit the token to Git (scan your history for leaked secrets), and delete it when the project is gone; ours was deleted after the test.

Terminal: with CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID set, wrangler pages deploy publishes Version 4; wrangler r2 bucket list fails with Authentication error code 10000
1: the token and the account ID come from private files. 2: the deploy works without wrangler login (with a warning about a Workers config file, see Troubleshooting). 3: version 4 is live. 4: the same token cannot touch R2.

The 25 MiB file limit, tested

One file over 25 MiB stops the whole deploy. We put a 26 MiB video in the folder:

Terminal
ls -lh site/intro-video.mp4
npx wrangler pages deploy site --project-name=nexaforge-docs

Wrangler refused before it uploaded anything, so the live site was not touched. Keep large videos and downloads in R2 (Cloudflare's object storage, with a public bucket on your domain) and link to them, as Cloudflare's limits page suggests.

Terminal: a 26 MiB intro-video.mp4 in the site folder; wrangler pages deploy stops with Error: Pages only supports files up to 25 MiB in size
1: one file of 26 MiB. 2: Wrangler refuses the whole deploy before it uploads anything.

The same site on Workers static assets

For the comparison table above, we uploaded the same folder with Upload your static files, the Workers option on the Create an app page. It became a Worker named docs-on-workers:

Cloudflare dashboard, Worker docs-on-workers: the address docs-on-workers.nexaforge.workers.dev, Automatic deployment on upload
The same files uploaded with "Upload your static files": a Worker, not a Pages project. 1: its workers.dev address.
Terminal
curl -sI https://docs-on-workers.nexaforge.workers.dev/ | grep -iE '^(http|x-frame|x-content|referrer|x-robots)'
curl -sI https://docs-on-workers.nexaforge.workers.dev/getting-started.html | grep -iE '^(http|location)'
curl -sI https://docs-on-workers.nexaforge.workers.dev/docs | grep -iE '^(http|location)'
curl -s -o /dev/null -w '%{http_code}\n' https://docs-on-workers.nexaforge.workers.dev/no-such-page

The same _headers and _redirects worked. Two results differ: the noindex rule written for pages.dev does not match a workers.dev address (Cloudflare's headers docs for static assets show a rule for those), and .html is removed with a temporary 307, which the html_handling setting controls.

Terminal: the Worker answers 200 with the three security headers and no noindex, 307 for .html, 301 for /docs and 404 for a missing page
1: _headers works, but the pages.dev noindex rule does not match workers.dev. 2: .html goes away with a 307 here. 3: _redirects works. 4: the 404 page works.

From the terminal, a Worker needs a wrangler.jsonc file in the project:

JSON
{
  "$schema": "./node_modules/wrangler/config-schema.json",
  "name": "docs-on-workers",
  "compatibility_date": "2026-11-17",
  "assets": {
    "directory": "./site",
    "not_found_handling": "404-page"
  }
}
Terminal
npx wrangler deploy
curl -s https://docs-on-workers.nexaforge.workers.dev/ | grep ''
Terminal: wrangler.jsonc with an assets block, wrangler deploy uploads five assets and warns that Preview URLs are on; curl right after still shows Version 1
1: a Worker needs a config file. 2: the deploy, with a warning about preview URLs. 3: the first request right after the deploy still got the old version.

Note the warning: Preview URLs are on by default while the workers.dev address is on. Our first request right after the deploy still got version 1; less than a minute later, version 2 answered, and both versions are in the Worker's history:

Terminal
curl -s https://docs-on-workers.nexaforge.workers.dev/ | grep ''
npx wrangler deployments list
Terminal: under a minute later curl shows Version 2 on the Worker; wrangler deployments list shows the dashboard upload and the wrangler deploy
1: under a minute later, the new version answers. 2: the Worker keeps both versions.

Production checklist

  • Security headers in _headers, checked with curl -sI.
  • noindex on https://:project.pages.dev/* so only your domain is indexed.
  • A top-level 404.html, unless the site really is a single-page app.
  • Long cache times only for files whose names change with each build.
  • Previews restricted with Access, and the policy lists only your team.
  • Your own domain active, HTTP redirected to HTTPS.
  • CI uses an account token with Pages Edit only, an expiry date and a reminder to renew it.
  • Every file under 25 MiB; large media in R2.
  • Everyone on the team knows where the rollback button is.

Troubleshooting

What you seeWhyFix
Pages only supports files up to 25 MiB in sizeOne file in the folder is over 25 MiB.Move it to R2 and link to it; the deploy is refused as a whole.
Pages now has wrangler.jsonc support and missing the "pages_build_output_dir" fieldA Workers wrangler.jsonc is in the project folder (ours was left from the Workers test).Harmless: Wrangler ignores it. To use a config file for Pages, add "pages_build_output_dir": "./site"; or keep the Workers file out of a Pages project.
Authentication error [code: 10000]The API token has no permission for that product.For Pages deploys the token needs the Pages Edit permission. For anything else, make another token.
A preview link sends you to <team>.cloudflareaccess.comRestrict previews is on.Sign in with an allowed e-mail, or add the person to the Access policy.
Every unknown address shows the home page with 200No top-level 404.html: Pages serves the site as a single-page app.Add a 404.html at the top of the folder.
Your custom domain shows error 522A CNAME was made at your DNS provider before the domain was added in Pages.Add the domain in the project's Custom domains tab, so Pages knows it.

Frequently asked questions

Is Cloudflare Pages free?

Yes. Static requests are free and unlimited on every plan. The free plan has limits on builds (500 a month for Git projects), files (20,000 per site, 25 MiB each), custom domains (100 per project) and projects (100 per account). Everything in this guide ran on the free plan.

How much does Cloudflare Pages cost if I outgrow the free plan?

Static hosting stays free. Cloudflare's Pro and Business plans raise build and domain limits. Server code (Pages Functions) is billed as Workers: 100,000 requests a day free, then Workers Paid from $5 a month with 10 million requests included and $0.30 per extra million.

Is Cloudflare Pages being deprecated?

Cloudflare's docs give no end date (checked 26 November 2026), and existing Pages projects keep working. The direction is clear, though: the dashboard calls it "the legacy Pages workflow", Workers can serve static files for free too, and Cloudflare publishes a guide to move from Pages to Workers. Existing Pages sites can stay; for new projects, look at Workers first.

Cloudflare Pages or Workers for a static site?

Both serve static files free and unlimited, and both read _headers and _redirects. Pages is simpler for previews (a branch name and one button to make them private) and rollbacks. Workers suits projects that will grow server code, since Cloudflare's docs give Workers "a distinctly broader set of features". The comparison table above has our test results.

Cloudflare Pages or Vercel?

For a static site, the main difference is the free allowance. Pages does not charge for static requests at all. Vercel's free Hobby plan includes the first 100 GB of Fast Data Transfer and the first 1,000,000 CDN requests each month (Vercel's Hobby plan page, read 26 November 2026). For frameworks with server rendering, compare the function limits of both before you choose.

Can I use Cloudflare Pages without moving my domain to Cloudflare?

For a subdomain, yes: add it in the project's Custom domains tab first, then create the CNAME to <project>.pages.dev at your DNS provider. A bare domain like example.com needs Cloudflare's nameservers.

What is the file size limit on Cloudflare Pages?

25 MiB per file, on every plan, and 20,000 files per site on the free plan (100,000 on paid plans). In our test, one 26 MiB file stopped the whole deploy.

Can I switch a Direct Upload project to Git later?

No. A project created by upload stays a Direct Upload project. To build from GitHub or GitLab on every push, create a new Git project and move your custom domain to it.

Sources

Yassine

Yassine

Yassine founded IGProd to educate the visitors with technological tutorials. These helpful guides are available for all sorts of professionals and novices, whether they work in technology or not!

Surf freely 💗

Leave a comment

Your email address will not be published. Required fields are marked *

Your experience on this site will be improved by allowing cookies Cookie Policy