Tutorials › Web, DNS and CI/CD

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
PieceWhat it doesWhere
DomainYour name on the internetGoDaddy (the registrar)
DNSThe phone book that points the name at your siteCloudflare
HostingThe computers that serve your filesCloudflare Workers
Source codeYour files plus their full historyGitHub (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.html file
  • 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

  1. Go to godaddy.com and type the name you want in the search box, for example yourname.co.uk.
  2. If it shows as available, click Add to cart.
  3. 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.
  4. On the cart page, check the term (1 year is fine) and note the renewal price. The first-year price is usually a discount.
  5. Create your account, pay and confirm. You now own the name.
What you'll see in GoDaddy's DNS: two A records for @ 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

  1. Go to dash.cloudflare.com and sign up for a free account.
  2. Click Add a domain (or Onboard a domain), type your domain and continue.
  3. Choose the Free plan.
  4. Cloudflare scans and copies your existing DNS records. Review them and click Continue.
  5. Cloudflare shows you two name servers, something like name1.ns.cloudflare.com and name2.ns.cloudflare.com. Yours will have different names. Keep this page open.

Part 3: Point the domain at Cloudflare (name servers)

  1. In GoDaddy, open My Products → your domain → DNS → the Nameservers tab.
  2. Click Change Nameservers → I'll use my own nameservers.
  3. Paste Cloudflare's two name servers, replacing GoDaddy's, then Save and confirm the warning.
  4. 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.

Good to know: the domain is still registered at GoDaddy and renews there. Only the DNS has moved.

Part 4: Put the website on Cloudflare Workers

  1. In Cloudflare, open Compute → Workers & Pages → Create.
  2. Choose the option to upload your static files, name the project (for example yoursite) and drag in your website folder.
  3. 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)

  1. Open your Worker → Domains tab → Add Domain → click your domain.
  2. Leave Subdomain empty to add the main domain. Set Enable for to Production, then Add domain.
  3. Click Add Domain again, type www as 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:

RecordActionWhy
A @ (GoDaddy parking IPs)DeletePoints at GoDaddy's parking page
CNAME wwwDeleteBlocks the www custom domain
TXT _dmarcKeepEmail security, needed later
CNAME _domainconnectKeep (harmless)GoDaddy helper record
MX, SPF (TXT) recordsKeepDeleting these breaks email
Careful: only delete the records for @ 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.

  1. Sign up at github.com.
  2. 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.
  3. 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.
  4. In the root of the repository, add a file called wrangler.jsonc. The name must match your Worker's name:
    {
      "name": "yoursite",
      "compatibility_date": "2026-10-01",
      "assets": {
        "directory": "./public",
        "not_found_handling": "404-page"
      }
    }
  5. In Cloudflare, open your Worker → Settings → scroll to Builds → next to Git repository, click GitHub.
  6. GitHub asks you to install Cloudflare Workers and Pages. Choose Only select repositories, pick your repo, then Install & Authorize.
  7. Back in Cloudflare: branch main, Build command empty, Deploy command npx wrangler deploy, root directory /. Click Connect.
Least privilege: choosing "Only select repositories" means the app can only touch this one repo, not everything in your GitHub account.

Check it worked

  1. Change one word on your home page in GitHub (click the file → pencil icon → Commit changes).
  2. In Cloudflare, open the Worker → Deployments. A new row appears with your commit message and a Build label, shows In progress, then Ready.
  3. Open your domain and press Ctrl + F5. You should see your change, with a padlock in the address bar.
  4. Run nslookup yourname.co.uk. The addresses returned belong to Cloudflare, which means your real server stays hidden behind it.

If something goes wrong

ProblemLikely cause and fix
Domain stuck on "pending" in CloudflareName servers not changed yet, or still propagating. Re-check them in GoDaddy and wait.
"Externally managed DNS records" errorDelete the old @ A and www CNAME records (Part 5).
Old GoDaddy parking page still showsBrowser or DNS cache. Press Ctrl + F5, or run ipconfig /flushdns.
No new deployment after a GitHub changeThe Git connection isn't saved. Check Settings → Builds shows your repo.
Build failsOpen 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