How to Host a Website for Free Forever on Cloudflare (No Credit Card)
Free website hosting with no credit card: deploy a static site on Cloudflare Pages, add a custom domain with automatic SSL, and scale with Workers.
The site you’re reading right now has cost me exactly $0.00 to host. No credit card on file. None required to sign up. No 14-day clock quietly counting down to a $29 charge while I sleep.
I’ve been automating things since before GPT-2 was a headline, and at the moment I am genuinely broke. So when I say you can get free website hosting with no credit card and keep it that way forever, I’m not pitching you a trial. I’m handing you the exact setup I run when I can’t afford to be wrong about a bill.
The whole thing is a static site on Cloudflare Pages. The only thing I ever “spent” was about twenty minutes wiring up a git repo. Let me walk you through that flow step by step — you can have your own version live this afternoon.
Why a static site beats a server for content
Most “how to host a website” tutorials open by renting you a Linux box. For a blog, a portfolio, a landing page, or docs, that’s the wrong tool — and it’s the tool that quietly drains your wallet.
A server is a thing you patch, secure, restart, and pay for whether anyone visits or not. A static site is the opposite: just HTML, CSS, and JavaScript files sitting on a global CDN. No database to get hacked. No PHP version to keep current. No 2 a.m. “why is the box pinned at 100% CPU” page. The host serves files. That’s the entire job.
Here’s the honest breakdown of why that wins for a content site:
- It’s genuinely free at real scale. A CDN serving flat files costs the host almost nothing — which is exactly why Cloudflare and GitHub can give it away with no card.
- It’s stupid fast. Your files cache at edge locations near each visitor. No server round-trip to render a page.
- It barely breaks. No moving parts means almost nothing to go down. My uptime is “whatever Cloudflare’s uptime is,” and that number is very good.
- It scales without a bill. A static site does the identical work for 10 visitors and 100,000. You don’t buy a bigger server the day a post hits the front page of a subreddit.
Build the site with whatever you like — Astro, Hugo, Eleventy, plain hand-written HTML, even a WordPress site exported to static. The output is always the same: a folder of files. That folder is what we host. So how can a company hand that out free, forever, without ever asking for a card? Let’s read the actual fine print.
What “free website hosting, no credit card” actually means
I’m allergic to grift, so let me be precise about the deal — including the limits, because every real free tier has them.
Cloudflare Pages’ free tier gives you:
- Unlimited bandwidth and requests on your static assets. This is the line item that bankrupts you on most hosts. Here it’s genuinely uncapped.
- 500 builds per month. A build runs each time you push code. Unless you’re pushing 16-plus times a day, you’ll never feel it.
- Free, automatic SSL — the https padlock — on your
.pages.devaddress and any custom domain. - No credit card to create the account or deploy. You sign up with an email. That’s the whole gate.
Now the caps, stated plainly: one concurrent build at a time, a 25 MB ceiling per file, and 20,000 files per deployment. For a content site you will not come near any of them. And if you somehow do, congratulations — you’ve got a site popular enough that the whole math of your day has changed anyway.
That’s the unspun version of free website hosting with no credit card: not a teaser, not a countdown. A free tier a CDN company can afford to run indefinitely, because serving flat files is dirt cheap for them. Which brings us to the part that feels like a magic trick.
The deploy flow: you push to git, Cloudflare does the rest
After setup, you never “upload” anything by hand again. You push to git. Cloudflare notices, builds your site, and ships it to the edge. Three steps to get there.
1. Put your site in a Git repo
Create a repo on GitHub (also free, also no card) and push your project to it.
# from your project folder
git init
git add .
git commit -m "initial site"
git branch -M main
git remote add origin https://github.com/your-username/your-site.git
git push -u origin main
If your “site” is literally one index.html, that’s completely fine — commit it and move on.
2. Connect the repo to Cloudflare Pages
In the Cloudflare dashboard: Workers & Pages → Create → Pages → Connect to Git. Authorize GitHub, pick your repo, and Cloudflare asks just two questions:
- Build command — what turns your source into a finished folder. Astro uses
npm run build; Hugo useshugo; plain HTML needs nothing, so leave it blank. - Output directory — the folder of finished files. Astro →
dist, Hugo →public, plain HTML →/.
A quick cheat sheet for the common setups:
| Framework | Build command | Output dir |
|---|---|---|
| Plain HTML | (none) | / |
| Astro | npm run build | dist |
| Hugo | hugo | public |
| Eleventy | npx @11ty/eleventy | _site |
3. Hit deploy and watch it build
Cloudflare clones the repo, runs your build command, and publishes the output. In about a minute you get a live URL like your-site.pages.dev with https already working.
From here on, your entire publishing workflow collapses to this:
# edit a post, then:
git add .
git commit -m "new post: hosting on cloudflare"
git push
Every push triggers a fresh build and a new deploy. And here’s the safety net that quietly matters most: every deploy is versioned. Ship something broken at midnight, and you roll back to a previous deploy with a single click. That one feature alone is worth more than what most hosts charge for the whole plan.
Custom domains (still free, still no card for the hosting)
A .pages.dev URL is great for starting, but eventually you’ll want your own name on it. One honest asterisk first: the domain name itself costs money. That’s the registrar’s fee, not Cloudflare’s — a .com runs roughly $10/year. The hosting stays free. Nobody’s slipping a hosting charge in under cover of the domain.
Once you own a domain, attaching it is painless:
- In your Pages project, open Custom domains → Set up a domain.
- Type your domain (e.g.
yoursite.com). - If that domain’s DNS already lives on Cloudflare, it wires the records automatically. If not, Cloudflare hands you a CNAME to paste at your registrar.
SSL provisions for you within a few minutes. No certbot, no renewal cron, no expired-cert outage ambushing you six months from now. You get the padlock for free, automatically, and it renews itself forever.
At this point you have a fast, free, secure site on your own domain. So when would you ever need more than flat files?
When you’d reach for a Cloudflare Worker
Static is perfect right up until you need the site to actually do something — process a contact form, gate content, call an API with a secret key, or return a bit of personalized data. The good news: you don’t throw out the static setup to get there. You bolt on a Cloudflare Worker — a small serverless function that runs at the edge, on the same free tier (100,000 requests/day, no card).
A Worker is just a function that takes a request and returns a response:
export default {
async fetch(request, env) {
if (new URL(request.url).pathname === "/api/hello") {
return Response.json({ message: "hello from the edge" });
}
return new Response("Not found", { status: 404 });
},
};
Reach for one when you need:
- A contact or newsletter form that posts somewhere without exposing an API key in the browser.
- A tiny API proxy so your secret keys live server-side, never in your HTML.
- Redirects, A/B logic, or auth checks that have to run before the page loads.
- A small KV-backed feature like view counts or saved data. Workers KV is included on the Workers free plan, no card.
One honest caveat on storage: R2, Cloudflare’s object storage, also has a genuinely generous free tier — 10 GB of storage and zero egress fees. But Cloudflare makes you add a payment method to switch R2 on. You won’t be charged unless you blow past those limits, but it isn’t a no-card signup the way Pages and KV are. So if staying completely card-free is the entire point, reach for KV first.
The rule of thumb: keep the content static and cheap, and let a Worker handle the few genuinely dynamic moments. You end up with a site that’s 95% free flat files and 5% serverless function — instead of paying for a full server just to cover that 5%.
Keep GitHub Pages wired up as your failover
I run a little scared, and it’s kept me online. So I keep a backup host ready. GitHub Pages is the natural one: free, no card, and it deploys from the same git repo you already pushed. A short GitHub Actions workflow builds your site and publishes it to a username.github.io URL. If Cloudflare ever has a bad day, you flip your domain’s DNS to the GitHub Pages target and you’re back up while everyone else is still refreshing a status page.
Two free hosts, one repo, zero dollars, zero cards. That’s the kind of redundancy that used to cost real money and now just costs a little setup discipline.
What’s next
You’ve now got the whole map: build a folder of static files, push it to git, let Cloudflare Pages build and serve it on a global CDN for free, attach a custom domain with automatic SSL, and add a Worker only for the parts that truly have to be dynamic. No server to babysit. No card on file. No trial timer ticking down behind your back.
Next time an idea hits, you don’t need a budget to put it on the internet — you need a git repo and twenty minutes. If you want to push further into the broke-but-shipping toolkit, here’s where I’d head next:
- Build a web app with AI agents for zero dollars — the same free-tier mindset, aimed at actually building the thing.
- The best free AI coding tools in 2026 — what I use to write the code that ends up in these repos.
- Day one: building in the open — why I run all of this broke, public, and with no card on file in the first place.
Go host something. It’s free, and it always will be.
Some links may be referral links, always marked. Full disclosure →