sellhosting.biz

Guides · Updated 2026-10-31

Free Website Hosting With Cloudflare Pages: A Walkthrough

If your website is made of plain HTML, CSS, JavaScript and images, you may not need to pay for hosting at all. Cloudflare Pages is a static hosting service with a free plan that includes HTTPS, a global content delivery network and custom domains. This guide walks through publishing a simple site. Plan details change from time to time, so check Cloudflare's current documentation and pricing page for exact limits before you rely on them.

Is static hosting right for your site?

A static site is a set of files that are sent to visitors exactly as they are. That suits:

It does not suit sites that need a traditional server-side content management system like WordPress, user accounts, or a database out of the box. Cloudflare does offer server-side functions and storage that can add dynamic features to a Pages site, but that is a step beyond this walkthrough.

Static sites have real advantages: they are fast because files are served from servers near the visitor, there is little to hack because no server software runs your pages, and there is nothing to update except your own files.

What you need

Option A: Upload files directly

This is the simplest route and needs no other tools.

Within a minute or so the site is live at the pages.dev address with HTTPS already working. To update the site later, upload a new version from the project's deployments page.

Option B: Connect a Git repository

If your site lives in a GitHub or GitLab repository, Pages can build and publish it every time you push a change.

A useful bonus: every other branch or pull request gets its own preview URL, so you can review changes before merging them into the live site.

Option C: Deploy from the command line

Developers can use Cloudflare's Wrangler command-line tool. After installing it with npm and signing in, a single command along the lines of wrangler pages deploy ./site --project-name your-project uploads the folder. This is handy for scripts and automated builds.

Connecting your own domain

Open your Pages project, go to Custom domains, and add your domain.

Cloudflare issues the SSL certificate automatically once the domain is verified. Add both the bare domain and www, and decide which one is the main address; you can redirect the other. See DNS basics if the records are unfamiliar.

Useful extras

Limits to keep in mind

The free plan has limits on things such as the number of builds per month, the number of files per site, and the size of individual files. For a typical small site you are unlikely to reach them, but check the current numbers in Cloudflare's documentation. Large video files are better hosted on a video or storage service and linked or embedded.

Common problems

The short version

For a static website, Cloudflare Pages offers free hosting with HTTPS and a global network. Upload a folder or connect a Git repository, add your custom domain, and use _redirects, _headers and a 404 page for polish. It is a strong first home for a simple site, and you can add paid hosting later if your needs grow. For a broader look at options, read what web hosting is.