Cloudflare Pages
Deploy your sites to Cloudflare's edge network
Deploy static sites and full-stack applications to Cloudflare's global network. Unlimited bandwidth, unlimited sites, all free. Best free tier in the industry.
Cloudflare Pages is the hosting platform from Cloudflare, the company that powers 20% of the internet's traffic. It's Vercel and Netlify, but with the most generous free tier imaginable.
Why Use Cloudflare Pages
Unlimited Everything (Free): Unlimited bandwidth, unlimited sites, unlimited requests. The free tier has no artificial limits. Deploy 100 sites? Free. Serve 10TB of bandwidth? Free.
Cloudflare's Global Network: Your site is deployed to 200+ data centers worldwide. Cloudflare's CDN is faster and more distributed than competitors.
Workers Integration: Seamlessly use Cloudflare Workers (serverless functions) with your Pages site. Run code at the edge, globally.
D1, KV, R2 Integration: Access Cloudflare's database (D1), key-value store (KV), and object storage (R2) from your Pages site. Full-stack on the edge.
Key Features
- Unlimited Bandwidth - No caps, ever
- Unlimited Sites - Host as many as you want
- 500 Builds/Month - Generous build minutes
- Cloudflare Workers - Serverless edge functions
- Analytics - Built-in web analytics
- Custom Domains - Free SSL included
- Git Integration - Deploy from GitHub/GitLab
- Deploy Previews - Every commit gets a URL
- Rollbacks - Instant rollback to any deploy
Pricing for Solo Builders
Free Tier:
- Unlimited bandwidth (yes, unlimited)
- Unlimited sites
- Unlimited requests
- 500 builds per month
- 100K Workers requests per day
- Analytics included
- Everything you need forever
Paid ($20/month):
- More build minutes (5,000/month)
- Faster builds
- More concurrent builds
- Better support
Reality: Most solo builders never need to pay. The free tier is absurdly generous.
Perfect For
- High-traffic sites (unlimited bandwidth!)
- Multiple side projects (unlimited sites!)
- Static sites and SPAs
- Edge-first applications
- Projects that need global distribution
- Developers who want best free tier
- Sites that might go viral
Cloudflare Pages vs Vercel
Choose Cloudflare Pages if you:
- Want truly unlimited bandwidth
- Have multiple projects (unlimited sites)
- Need lowest cost (free forever)
- Want fastest global CDN
- Use Cloudflare already
- Don't need Next.js optimization
Choose Vercel if you:
- Use Next.js heavily
- Want best DX (more polished)
- Need image optimization
- Prefer startup ecosystem
Cloudflare Pages has the best free tier. Vercel has better DX. Choose accordingly.
Getting Started
# Install Wrangler (Cloudflare's CLI) npm install -g wrangler # Login wrangler login # Create Pages project wrangler pages project create my-site # Deploy wrangler pages deploy ./dist
Or connect your Git repo in the dashboard and let it auto-deploy.
Cloudflare Workers Integration
Pages + Workers = full-stack edge applications:
// functions/api/hello.ts
export async function onRequest(context) {
return new Response(JSON.stringify({ message: "Hello from the edge!" }), {
headers: { 'content-type': 'application/json' }
});
}
Any file in /functions becomes a serverless endpoint. Runs at the edge in 200+ locations.
Full-Stack on the Edge
Stack:
- Frontend: Pages (static or SSR)
- Backend: Workers (serverless functions)
- Database: D1 (SQLite at the edge)
- Storage: R2 (S3-compatible object storage)
- Cache: KV (key-value store)
All at the edge, all globally distributed.
Framework Support
Works with all frameworks:
- Next.js - Static export or edge runtime
- React, Vue, Svelte - SPAs or static
- Astro, 11ty, Hugo - Static site generators
- Remix - Full-stack framework
- SvelteKit - Works great
Cloudflare has adapters for popular frameworks.
The Unlimited Bandwidth Advantage
Scenario: Your site hits Hacker News frontpage
Vercel/Netlify:
- Sudden spike in traffic
- Might exceed free tier bandwidth
- Could get charged or throttled
Cloudflare Pages:
- Unlimited bandwidth
- Handle the spike with no worries
- $0 cost no matter how viral you go
This is huge for side projects that might unexpectedly blow up.
Analytics
Built-in web analytics (privacy-focused):
- No cookies required
- GDPR-compliant
- See traffic, referrers, pages
- Free forever
Not as detailed as Plausible but included at no cost.
Cloudflare D1 (Database)
SQLite database at the edge:
export async function onRequest(context) {
const { results } = await context.env.DB.prepare(
"SELECT * FROM users WHERE id = ?"
).bind(1).all();
return Response.json(results);
}
Database runs at the edge, globally distributed. Still in beta but impressive.
R2 Storage
S3-compatible object storage:
- $0.015 per GB (cheaper than S3)
- No egress fees (huge savings)
- Works with S3 SDKs
Perfect for storing images, videos, user uploads.
KV Storage
Key-value store for edge data:
const value = await context.env.KV.get("key");
await context.env.KV.put("key", "value");
Great for session storage, feature flags, cache.
Build Times
Slightly slower than Vercel/Netlify:
- Cloudflare's build system is newer
- Large projects may take longer
- Incremental builds are improving
Not a dealbreaker but worth noting.
Custom Domains
Add custom domains easily:
- Automatic SSL via Let's Encrypt
- Support for apex domains
- Wildcard domains supported
- DNS managed by Cloudflare
If your domain is already on Cloudflare (for DNS/CDN), Pages integration is seamless.
Deploy Previews
Every branch and PR gets a preview URL:
- Unique subdomain per branch
- Test before merging
- Share with team/clients
Same as Vercel/Netlify but with unlimited bandwidth.
Environment Variables
Set per environment (production/preview):
- Encrypted at rest
- Available in Workers/builds
- Manage in dashboard or CLI
Redirects and Headers
# _redirects file /old-path /new-path 301 # _headers file /* X-Frame-Options: DENY X-Content-Type-Options: nosniff
Simple text files for redirects and headers.
Limitations
What Cloudflare Pages lacks:
- Form handling (use Workers instead)
- Split testing (build your own)
- One-click integrations (fewer than competitors)
- Build plugin ecosystem (smaller than Netlify)
It's more DIY but infinitely scalable.
The Cloudflare Ecosystem
Once you use Pages, you'll likely use:
- Workers - Serverless functions
- R2 - Object storage
- D1 - Database
- KV - Key-value store
- Images - Image optimization
- Stream - Video hosting
All integrated, all edge-native.
Performance
Fastest CDN: Cloudflare's network is the fastest and most distributed globally.
Cold starts: Workers have minimal cold starts (~5-10ms).
TTFB: First byte arrives faster than competitors due to edge proximity.
When You Might Outgrow Pages
You won't. The unlimited free tier means you can:
- Get to 1M visitors/month: Free
- Serve 10TB of bandwidth: Free
- Have 50 side projects: Free
Most businesses never need to pay Cloudflare for hosting.
Migration from Vercel/Netlify
Easy migration:
- Connect your Git repo to Pages
- Update build settings (usually same)
- Deploy
- Update DNS
- Done
No code changes needed for most static sites.
Tips for Solo Builders
- Use Pages for all side projects (unlimited free hosting!)
- Combine with Workers for backend logic
- Use D1 for database (still beta, but promising)
- Add R2 for file storage (no egress fees!)
- Set up analytics (free, built-in)
- Don't worry about traffic spikes (unlimited bandwidth)
- Use preview deploys for testing
The Catch
There must be a catch with unlimited bandwidth, right?
Sort of. Cloudflare makes money from:
- Paid tiers for teams/enterprises
- Add-on services (Workers, R2, Images, etc.)
- Their massive enterprise business
They can afford generous free tiers because hosting is cheap for them (they own the infrastructure).
The Verdict
Cloudflare Pages has the best free tier in the industry. Unlimited bandwidth and unlimited sites forever.
If you're a solo builder with multiple projects, Cloudflare Pages is a no-brainer. Host everything there and pay nothing.
The DX isn't as polished as Vercel's, and there are fewer one-click integrations, but the value is unbeatable. You get access to Cloudflare's incredible infrastructure for free.
For side projects, experiments, and portfolio sites, Cloudflare Pages is hard to beat. Even for production applications at scale, the free tier covers more than most businesses will ever need.
The only reason not to use it is if you need Vercel's Next.js optimizations or Netlify's forms/split testing. Otherwise, Cloudflare Pages is the smartest choice for solo builders.