How to Host a Validation Site on Cloudflare's Free Tier
TLDR
Cloudflare's free tier covers everything a validation site needs: Pages for static hosting, Workers for serverless API routes, D1 for SQLite database (email signups, pricing clicks, survey responses), and R2 for file storage. You can run a full validation site with email capture, fake-door pricing, and a post-signup survey for $0/month in hosting costs.
Why Cloudflare for Validation Sites
The validation stage has one financial requirement: keep hosting costs at zero until you’ve confirmed demand. Cloudflare’s free tier is designed exactly for this.
Three alternatives founders typically consider:
- Vercel free tier: SSR functions limited to 100 GB-hours execution per month; bandwidth at 100 GB. Fine for small sites, but the edge function limits are tighter than Cloudflare’s.
- Netlify free tier: 125,000 serverless function invocations per month; 100 GB bandwidth. Similar to Vercel with slightly different limits.
- Cloudflare free tier: 100,000 Worker requests per day (resets daily), not monthly. For a site getting 1,000 API calls per day, you have 99,000 requests left. Plus D1 database, R2 storage, and global CDN at no cost.
For a validation site with email capture, pricing click tracking, and a post-signup survey, Cloudflare’s free tier is the most generous option available.
What the Free Tier Actually Covers
Here’s exactly what you get at $0/month:
Cloudflare Pages (static hosting):
- Unlimited bandwidth
- Unlimited requests to static assets
- Global CDN (300+ locations)
- 500 builds per month (each git push = one build)
- Automatic HTTPS on all custom domains
- Preview deployments for every branch
Cloudflare Pages Functions (serverless API):
- 100,000 requests per day (resets at midnight UTC)
- 10ms CPU time per invocation (free tier)
- Access to D1, KV, R2, and other bindings
Cloudflare D1 (SQLite database):
- 5 GB database storage
- 25 million row reads per day
- 100,000 row writes per day
- Standard SQL syntax
Cloudflare R2 (file storage):
- 10 GB included
- Zero egress fees (unlike S3)
For a validation site, the only limit you might hit is the 100,000 daily Worker requests if you’re running a successful paid acquisition campaign. At that point, the paid Workers plan is $5/month — still effectively free.
Setup Walkthrough
1. Install Wrangler and Authenticate
npm install -g wrangler
wrangler login
This opens a browser window for OAuth. Once authenticated, Wrangler can manage all Cloudflare resources for your account.
2. Configure Your Astro Project
In astro.config.ts:
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
export default defineConfig({
output: 'server',
adapter: cloudflare(),
});
Use output: 'server' if you have API routes that need D1 access. Use output: 'static' if your site is purely static with no server-side logic.
3. Create Your D1 Database
wrangler d1 create your-validation-db
Copy the database_id from the output. Add to wrangler.toml:
[[d1_databases]]
binding = "DB"
database_name = "your-validation-db"
database_id = "paste-your-id-here"
4. Add Environment Variables
Secrets (API keys) go in Wrangler, not in .env files:
wrangler pages secret put RESEND_API_KEY
wrangler pages secret put APOLLO_API_KEY
Non-secret config goes in wrangler.toml under [vars]:
[vars]
PRODUCT_NAME = "Validea"
EMAIL_FROM = "hello@validea.dev"
import InlineSignup from ‘@validation/ui/components/inline-signup.astro’;
5. Deploy
astro build
wrangler pages deploy dist
Your site gets a *.pages.dev subdomain immediately. Add a custom domain in the Cloudflare dashboard under Pages → your project → Custom Domains.
6. Apply Database Migrations
For local development:
wrangler d1 migrations apply your-validation-db --local
For production:
wrangler d1 migrations apply your-validation-db --remote
Limitations to Know
CPU time per request: The free tier limits each Worker invocation to 10ms of CPU time. For a simple email capture or pricing click record, this is more than enough. For heavy computation or large database queries, the 10ms limit can be hit. The paid tier gives 50ms per request.
No scheduled cron on free tier: Cloudflare Workers Cron Triggers require a paid Workers account ($5/month). If your validation site needs scheduled tasks (survey reminder emails, weekly stats), you need the paid Workers plan for the cron Worker — your Pages project itself can stay on the free tier.
D1 is eventually consistent at the edge: D1 reads are served from the nearest edge location, which means a write may not be immediately visible on a read from a different location. For validation data (email signups, click tracking), this is not a practical problem. All writes go to the primary and replicate within seconds.
Cost at Scale
When your validation succeeds and traffic grows, the cost curve is still favorable:
| Tier | Cost | Workers requests | D1 reads |
|---|---|---|---|
| Free | $0/mo | 100K/day | 25M/day |
| Workers Paid | $5/mo | 10M/month | 25M/day |
| Workers Paid + D1 | $5-$15/mo | 10M/month | Scales with usage |
Most validation sites never exceed the free tier. Those that do are typically handling traffic levels where the $5/month upgrade is the smallest line item in the budget.
import DefinitionBlock from ‘@validation/ui/seo/definition-block.astro’; import AnswerBlock from ‘@validation/ui/seo/answer-block.astro’;
Q&A
What does Cloudflare's free tier include for hosting?
Cloudflare Pages free tier includes: unlimited static hosting requests, unlimited bandwidth, global CDN across 300+ cities, 500 builds per month, and custom domains with automatic HTTPS. For serverless functions (Pages Functions / Workers): 100,000 requests per day. For D1 database: 5 GB storage and 25 million row reads per day. For R2 storage: 10 GB included.
Q&A
Can I run a real database on Cloudflare's free tier?
Yes. Cloudflare D1 is a production-grade SQLite database that runs on the free tier with 5 GB storage and 25 million row reads per day. For a validation site collecting email signups, pricing clicks, and survey responses, D1 is more than sufficient. The free tier supports standard SQL operations via Drizzle ORM or the D1 client.
Q&A
What are the limitations of Cloudflare's free tier?
The main free tier limits: Workers/Functions at 100,000 requests per day (resets daily), D1 at 25 million reads per day and 100,000 writes per day, Pages builds at 500 per month. For a validation site under heavy traffic, the 100,000 daily request limit is the one most likely to be hit. At that point, the paid Workers plan is $5/month for 10 million requests.
Q&A
Does Cloudflare Pages support server-side rendering?
Yes. Cloudflare Pages supports SSR via the @astrojs/cloudflare adapter. Server-rendered routes run as Cloudflare Functions (Workers) at the edge. This is required for API routes (email capture, pricing clicks, D1 database access). Fully static pages (no server logic) are served directly from Cloudflare's CDN — fastest possible performance.
Like what you're reading?
Try Validea free — no credit card required.
Want to learn more?
Can I connect an email service to Cloudflare Pages?
How do I access my D1 database from a Pages Function?
Is Cloudflare Pages faster than Vercel or Netlify?
What happens when I exceed Cloudflare's free tier limits?
Keep reading
How to Validate a SaaS Idea Before Writing Code
A practical 5-step framework for measuring real demand before you build anything. Covers landing pages, pSEO, fake-door pricing, and kill criteria.
5 Best Landing Page Builders for Testing SaaS Ideas
We compared 5 landing page builders on speed to live, pSEO support, email capture, and total cost for idea validation experiments.
Best Webflow Alternative for Quick Idea Validation
Webflow is a powerful visual CMS but slow to build pSEO at scale, expensive for experiments, and needs middleware for programmatic SEO. Validea generates a complete validation site with pSEO content in hours, not days.