Host your own website for free: GoDaddy, Cloudflare and GitHub
This is exactly how I built and host this website: a domain from GoDaddy, DNS and hosting on Cloudflare's free plan, and automatic publishing from GitHub. Total cost is just the domain. Every step is click by click, including the error I hit and how I fixed it.
What you'll build
Visitor → DNS (Cloudflare) → Cloudflare Worker (your website files) → your site
↑
You change a file → GitHub (main branch) → Cloudflare builds and deploys automatically
| Piece | What it does | Where |
|---|---|---|
| Domain | Your name on the internet | GoDaddy (the registrar) |
| DNS | The phone book that points the name at your site | Cloudflare |
| Hosting | The computers that serve your files | Cloudflare Workers |
| Source code | Your files plus their full history | GitHub (private repo) |
What you need
- An email address for three free accounts: GoDaddy, Cloudflare and GitHub
- A website: a folder with at least an
index.htmlfile - A bank card for the domain (often a few pounds for the first year, then the normal renewal price)
Part 1: Buy the domain at GoDaddy
- Go to godaddy.com and type the name you want in the search box, for example
yourname.co.uk. - If it shows as available, click Add to cart.
- GoDaddy will offer extras: email, a website builder, an AI site tool and more. You don't need any of them for this guide, so click No thanks or Continue on each one.
- On the cart page, check the term (1 year is fine) and note the renewal price. The first-year price is usually a discount.
- Create your account, pay and confirm. You now own the name.
@ pointing at a GoDaddy "parking" page, a CNAME for www, a _domainconnect CNAME and usually a _dmarc TXT record. Leave them for now.Part 2: Add the domain to Cloudflare
- Go to dash.cloudflare.com and sign up for a free account.
- Click Add a domain (or Onboard a domain), type your domain and continue.
- Choose the Free plan.
- Cloudflare scans and copies your existing DNS records. Review them and click Continue.
- Cloudflare shows you two name servers, something like
name1.ns.cloudflare.comandname2.ns.cloudflare.com. Yours will have different names. Keep this page open.
Part 3: Point the domain at Cloudflare (name servers)
- In GoDaddy, open My Products → your domain → DNS → the Nameservers tab.
- Click Change Nameservers → I'll use my own nameservers.
- Paste Cloudflare's two name servers, replacing GoDaddy's, then Save and confirm the warning.
- Wait. It's often minutes, but it can take a few hours.
Check it from Windows Terminal:
nslookup -type=NS yourname.co.uk
When the answer shows the two .ns.cloudflare.com servers, Cloudflare is in charge of your DNS. Cloudflare also emails you when the domain is active.
Part 4: Put the website on Cloudflare Workers
- In Cloudflare, open Compute → Workers & Pages → Create.
- Choose the option to upload your static files, name the project (for example
yoursite) and drag in your website folder. - Click Deploy. You get a free test address ending in
.workers.dev. Open it to check the site.
Part 5: Connect your domain (and fix the common error)
- Open your Worker → Domains tab → Add Domain → click your domain.
- Leave Subdomain empty to add the main domain. Set Enable for to Production, then Add domain.
- Click Add Domain again, type
wwwas the subdomain, choose Production, then Add domain.
If you see "Hostname already has externally managed DNS records (A, CNAME, etc). Delete them first", the old GoDaddy records copied across in Part 2 are in the way. Open your domain → DNS → Records and tidy up:
| Record | Action | Why |
|---|---|---|
A @ (GoDaddy parking IPs) | Delete | Points at GoDaddy's parking page |
CNAME www | Delete | Blocks the www custom domain |
TXT _dmarc | Keep | Email security, needed later |
CNAME _domainconnect | Keep (harmless) | GoDaddy helper record |
| MX, SPF (TXT) records | Keep | Deleting these breaks email |
@ and www. If your domain already sends or receives email, never delete MX or SPF records.To delete a record: click Edit on its row → Delete → confirm. Then add the domain and www again. Cloudflare creates the right records and a free HTTPS certificate for you.
Part 6: Publish automatically from GitHub
With this step, changing a file in GitHub publishes the site by itself. This is a simple CI/CD pipeline.
- Sign up at github.com.
- Click + → New repository. Name it (for example
yoursite), choose Private, leave Add README off, .gitignore as none and License as none, then click Create repository. - Add your website files to the repository. The easiest way is the uploading an existing file link on the empty repo page. Put the site in a folder called
public. - In the root of the repository, add a file called
wrangler.jsonc. Thenamemust match your Worker's name:{ "name": "yoursite", "compatibility_date": "2026-10-01", "assets": { "directory": "./public", "not_found_handling": "404-page" } } - In Cloudflare, open your Worker → Settings → scroll to Builds → next to Git repository, click GitHub.
- GitHub asks you to install Cloudflare Workers and Pages. Choose Only select repositories, pick your repo, then Install & Authorize.
- Back in Cloudflare: branch
main, Build command empty, Deploy commandnpx wrangler deploy, root directory/. Click Connect.
Check it worked
- Change one word on your home page in GitHub (click the file → pencil icon → Commit changes).
- In Cloudflare, open the Worker → Deployments. A new row appears with your commit message and a Build label, shows In progress, then Ready.
- Open your domain and press Ctrl + F5. You should see your change, with a padlock in the address bar.
- Run
nslookup yourname.co.uk. The addresses returned belong to Cloudflare, which means your real server stays hidden behind it.
If something goes wrong
| Problem | Likely cause and fix |
|---|---|
| Domain stuck on "pending" in Cloudflare | Name servers not changed yet, or still propagating. Re-check them in GoDaddy and wait. |
| "Externally managed DNS records" error | Delete the old @ A and www CNAME records (Part 5). |
| Old GoDaddy parking page still shows | Browser or DNS cache. Press Ctrl + F5, or run ipconfig /flushdns. |
| No new deployment after a GitHub change | The Git connection isn't saved. Check Settings → Builds shows your repo. |
| Build fails | Open the build → View build logs. Usually the name in wrangler.jsonc doesn't match the Worker, or the public folder is missing. |
Finally: lock it down
These three accounts control your name and your website, so turn on two-factor authentication (an authenticator app is best) in GoDaddy, Cloudflare and GitHub before you do anything else.
← All tutorials