Cloudflare Pages for Static Sites

Cloudflare Pages is the default hosting recommendation on LaunchStatic because it solves the three problems indie hackers care about most: cost, speed, and simplicity. You push HTML files to a Git repository, connect that repo to Cloudflare, and your site is served from hundreds of edge locations worldwide with automatic HTTPS. There is no build step required for plain static sites, no bandwidth cap on the free tier, and no credit card needed to get started.

Why Cloudflare Pages beats generic static hosts

Many static hosts work fine for a single landing page, but Cloudflare Pages combines hosting with the same CDN infrastructure that protects large enterprises. That means your waitlist page loads quickly in Tokyo, Berlin, and São Paulo without you configuring regional servers. Preview deployments are generated for every Git branch and pull request, which is invaluable when you want a client or cofounder to review copy changes before merging to production.

Unlike some competitors, Cloudflare does not throttle free projects after a traffic spike. A Product Hunt launch or a viral tweet will not trigger a surprise invoice. For pre-revenue founders, predictable $0 hosting removes one more reason to delay shipping. You still own your files — if you outgrow Pages or want a different workflow, download your repo and move elsewhere.

What you need before connecting

  • A GitHub, GitLab, or Bitbucket account with your site files in a repository
  • An index.html at the repository root (not buried in a subfolder)
  • Root-relative asset paths like /assets/css/main.css
  • A free Cloudflare account at dash.cloudflare.com

LaunchStatic templates are structured exactly for this layout. Download a template, customize copy locally, initialize Git, push to GitHub, and you are one dashboard wizard away from a live URL ending in *.pages.dev.

Create a Pages project (Git-connected)

  1. Log in to Cloudflare Dashboard → Workers & Pages → Create application → Pages → Connect to Git.
  2. Authorize Cloudflare to read your repository provider and select the repo containing your landing page.
  3. Set the production branch to main (or master if older repos use that name).
  4. Leave Build command empty. Set Build output directory to / (repository root).
  5. Click Save and Deploy. First deploy usually finishes in under two minutes.
  6. Visit the generated your-project.pages.dev URL and verify CSS, images, and links.

Build settings for plain HTML

If Cloudflare detects a framework it may suggest a build command. For LaunchStatic templates, ignore those prompts. An empty build command tells Pages to publish files as-is. This is faster and eliminates an entire class of CI failures caused by missing Node versions or npm lockfile drift. You edit HTML, commit, push — done.

Custom domains and DNS

After the first deploy succeeds, open your Pages project → Custom domains → Set up a custom domain. Enter your apex domain (example.com) or subdomain (www.example.com). Cloudflare walks you through DNS records. If your domain is already on Cloudflare, the record is often added automatically. If your registrar is elsewhere, create the CNAME Cloudflare displays and wait for propagation — usually minutes, occasionally up to 24 hours.

SSL certificates provision automatically. Do not pay for third-party certificates unless you have a specific compliance requirement. For standard landing pages, Cloudflare's Universal SSL is sufficient and renews without manual intervention.

Headers, caching, and security basics

Add a _headers file at your project root to set security headers without a server. A minimal example sets X-Frame-Options, Referrer-Policy, and cache lifetimes for static assets. Pages reads this file on deploy and applies rules at the edge.

/*
  X-Frame-Options: DENY
  Referrer-Policy: strict-origin-when-cross-origin

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

For redirects — for example forcing www to apex — add a _redirects file. Cloudflare Pages supports the same syntax Netlify popularized, which keeps migration straightforward if you switch hosts later.

Common mistakes and fixes

SymptomLikely causeFix
404 on homepageNo index.html at repo rootMove index.html to top level
Unstyled pageRelative CSS paths break on subroutesUse root-relative /assets/ paths
Old content after deployBrowser or CDN cacheHard refresh; bump asset query strings
Build failsAccidental npm build commandClear build command; redeploy

When to choose something else

Cloudflare Pages is not the only valid choice. GitHub Pages is simpler if your audience lives entirely inside GitHub and you do not need preview URLs per branch. Netlify Drop is unbeatable for one-off ZIP uploads without Git. Choose Pages when you want production-grade CDN, generous free limits, and a path to custom domains without migrating DNS providers later.

Related: Cloudflare deployment walkthrough Formspree form guide Waitlist template

Is Cloudflare Pages really free for landing pages?

Yes. Static HTML sites on the free tier include unlimited bandwidth for reasonable use, automatic SSL, and global CDN delivery. You pay only if you add paid Cloudflare products or exceed specific Workers/Pages paid-plan limits — unlikely for a single marketing site.

Do I need Wrangler CLI?

No. Git-connected deploys handle everything from the dashboard. Wrangler is optional for direct uploads or advanced Workers integration.

Can I deploy without GitHub?

Yes. Use Direct Upload via Wrangler or drag-and-drop workflows documented by Cloudflare. Git integration is recommended because it gives you version history and preview URLs.

How does Pages work with Formspree or Umami?

They are client-side integrations. Pages serves your HTML; forms post to Formspree and analytics scripts call Umami. No server configuration on Cloudflare is required.

Deploy your template today

Grab a free LaunchStatic template, push to GitHub, and connect Cloudflare Pages. Most founders have a live HTTPS URL within fifteen minutes.

Browse templates Full deploy guide