Hosting a static website on Cloudflare

Web sites
cloudflare
hosting
web development
Published

October 23, 2024

Hosting a static website on Cloudflare is great!
  • It’s easy to set up.
  • It’s easy to update.
  • It’s free! 🥳

Cloudflare allows you to publish static websites for free. It only limits the number of “builds” per month, but even that is very generous and not a limit I am likely to exceed.

It connects with your git repository, so doing updates is extremely simple.

To get a local static website hosted on Cloudflare, this is the procedure:

  1. Set up your Git repository on GitHub.
  2. Set up a Cloudflare account.
  3. select Workers & Pages > Overview > Pages tab
  4. Click Connect to Git
  5. Select the repository and authorize
  6. Go through the deploy procedure. It’s easy, worked first time.
  7. To get it working with my domain name, I transferred my DNS management to Cloudflare. (Since this is a new domain without any other services, such as email, set up on it, I am being quite gung-ho about this type of thing. If it was an existing domain with existing email accounts associated with it, I would be much more cautious).