Deploy to Cloudflare Pages¶
Deploy your FastReact frontend on Cloudflare Pages for ultra-fast global edge hosting.
What You'll Use¶
- Cloudflare Pages - Frontend hosting on Cloudflare's edge network
- Backend elsewhere - FastAPI backend on Azure, Railway, or similar
Cost Estimate¶
- Cloudflare Pages: Free (unlimited requests, 500 builds/month)
- Plus backend hosting: $10-30/month
Total: ~$10-30/month (one of the cheapest options!)
Why Cloudflare Pages?¶
- Blazing fast - Runs at 275+ edge locations worldwide
- Generous free tier - Unlimited requests
- Zero config - Works with React out of the box
- DDoS protection - Built-in security
- Workers integration - Edge functions if needed
Deployment Guide¶
1. Build the Frontend¶
2. Deploy via Wrangler CLI¶
# Install Wrangler
npm install -g wrangler
# Login
wrangler login
# Deploy
cd frontend
wrangler pages deploy build/client --project-name fastreact
3. Or Deploy via Dashboard¶
- Go to dash.cloudflare.com → Pages
- Click Create a project → Connect to Git
- Select your repository
- Configure:
- Build command:
npm run build - Build output directory:
build/client - Root directory:
frontend - Click Save and Deploy
4. Configure Environment Variables¶
In Pages project settings → Environment variables:
Custom Domain¶
- Pages project → Custom domains
- Add your domain
- Cloudflare handles DNS automatically if your domain uses Cloudflare nameservers
Key Features¶
- Global edge network (275+ locations)
- Unlimited free requests
- Preview deployments for every PR
- Automatic HTTPS
- DDoS protection included
- Web Analytics (free)
Want to contribute this guide? Open a PR with your deployment experience!