Cloudflare Pages turns your HTML/CSS/JS into a global site with one click. No DevOps degree required—this guide walks you through every step, from account to live deploy.
By the end, you'll have a custom domain, HTTPS, and CDN caching. Free tier: Unlimited bandwidth, 500 builds/month. Let's launch!
Cloudflare Pages turns your GitHub repo into a live, globally distributed website in under 30 seconds — completely free with unlimited bandwidth. You push code, it auto-deploys with preview URLs for every branch, and serves your HTML/CSS/JS from the edge using the same CDN as Netflix. No build servers, no config files — just code and go. Perfect for portfolios, blogs, or learning projects like YureiBlog.
Prerequisites (2 Minutes)
Before starting, grab these:
- GitHub Account: Free at github.com. Upload your site files here.
- Domain (Optional): Free .pages.dev subdomain or buy one ($1–10/yr via Namecheap).
- Your Site Files: HTML/CSS/JS folder (e.g., index.html, style.css).
Create a Cloudflare Account
Sign up—it's free and takes 1 minute.
- Go to dash.cloudflare.com/sign-up.
- Enter email → Verify → Set password.
- Skip "Add Site" prompt → Go to Pages in sidebar.
- In case if you missed it, on sidebar do to Build > Compute & AI > Workers & Pages
Connect GitHub Repository
Link GitHub for auto-deploys on commits.
- In Pages dashboard → Connect to Git.
- Select GitHub → Authorize (one-time).
- Create new repo on GitHub:
mkdir my-site && cd my-site && git init && git remote add origin [your-repo-url] && git add . && git commit -m "Initial" && git push. - Back in Cloudflare → Select repo → Install & Authorize.
Create Your First Project
Set up the project basics.
- Click Create a project → Connect to Git.
- Choose repo → Begin setup.
- Project name: Auto-fills (e.g., my-site.pages.dev).
- Production branch: main (default).
Configure Build & Output
Tell Cloudflare how to build your site.
- Framework preset: None (for pure HTML) or select (e.g., Astro).
- Build command: Leave blank for static (or
npm run buildfor frameworks). - Build output directory: / for root or dist for built sites.
- Root directory: / (default).
- Environment variables: Add if needed (e.g., API keys).
- Click Save and Deploy.
Add Custom Domain (Optional)
Upgrade from .pages.dev to your domain.
- After deploy → Custom domains tab.
- Click Set up a domain → Enter (e.g., yureiblog.com).
- Cloudflare adds DNS records (CNAME for www, A for root).
- Go to your registrar (e.g., Namecheap) → Update nameservers to Cloudflare's (ns1.cloudflare.com, etc.).
- Wait 5–60 min for propagation → Free SSL auto-activates.
Deploy, Preview & Test
Go live and iterate.
- Deploy triggers → Visit [project].pages.dev.
- Edit files →
git commit -m "Update" && git push→ Auto-redeploy in 30s. - Preview branches: Create preview.yureiblog.com for testing.
- Test: Check HTTPS, speed (pagespeed.web.dev), mobile view.
I’m a full-time employee who runs this blog as a side hustle, so spending ₹500–1000/month on hosting or security tools was never an option. Cloudflare gives me everything for free that would easily cost ₹20,000–30,000/year elsewhere: DDoS protection, SSL, caching, image optimization, analytics — the list goes on. My site stays online even when it gets shared on Reddit, loads instantly everywhere, and never shows “Not Secure”. Honestly, I sleep better knowing random bots can’t crash my little project. If you’re a student, indie maker, or just someone learning in public like me — Cloudflare is the single best free decision you’ll ever make for your website.