Back to HTML Pub

How to Host a Static Website for Free (2026 Step-by-Step)

Michael Sacca
Web Hosting
Static Hosting
Free Tools
Tutorials
How-To

How to Host a Static Website for Free (2026 Step-by-Step)

You built something. Maybe a portfolio with Astro, a docs site with Hugo, a one-pager an AI generated for you. It's all HTML, CSS, and JavaScript with no backend. Now you want it live on the internet without paying anyone.

Here's how to do it, step by step, using the five hosts that actually work well for static sites in 2026.

First: is your site actually static?

A static site is one where every visitor gets the exact same files the server has on disk. No database query, no server-side rendering, no backend.

Your site is static if:

  • You built it with HTML, CSS, and JavaScript only, or
  • You used Astro, Hugo, Jekyll, 11ty, or any static site generator, or
  • Your framework output is a "static export" or "static build" folder

Your site is NOT static if:

  • It queries a database at request time (Rails, Django, server-rendered Next.js)
  • It has user-specific pages that render on the server
  • It depends on a running backend process

If you're not sure, check the output folder of your build. If it's a pile of .html, .css, .js, and image files, you're static. Pick any of the options below.

At a glance

HostFree tierBest forCustom domain free
HTMLPub5 pages, 7-day expiryAI-generated or paste-from-AI sitesNo (Starter $10/mo)
Netlify100 GB bandwidth, 300 build minutesFramework builds with CIYes
Vercel100 GB bandwidth, generousNext.js static export, AstroYes
Cloudflare PagesUnlimited requestsGlobal edge deliveryYes
GitHub PagesFree (public repos)Portfolios, docs, open sourceYes

Option 1: HTMLPub

The fastest free path if you have an AI-generated HTML site or a single-file page.

Steps:

  1. Go to htmlpub.com.
  2. Paste your HTML (or describe what you want if you don't have HTML yet and let HTMLPub build it).
  3. Hit publish. URL is live in 60 seconds.

Free tier: 5 pages with a 7-day expiry. Good for demos and tests. Starter plan ($10/month) makes pages permanent with a custom domain.

When it wins: AI-generated sites, single-file pages, rapid paste workflow, no build step.

For the workflow details, see How to Publish HTML Online.

Option 2: Netlify

The default for framework-built static sites.

Steps:

  1. Push your code to GitHub.
  2. Go to netlify.com, connect your GitHub account.
  3. Pick the repo, set the build command (e.g., npm run build) and publish directory (e.g., dist/ or public/).
  4. Netlify builds and deploys. URL is live in a few minutes.
  5. Add a custom domain in Site Settings → Domain Management.

Free tier: 100 GB bandwidth, 300 build minutes, 1 concurrent build. Enough for personal sites.

When it wins: Framework builds (Astro, Hugo, Next.js static export, Vite), preview deploys per branch, edge functions.

Also see Netlify Alternatives if you decide Netlify isn't the right fit.

Option 3: Vercel

Vercel optimizes for Next.js but serves any static output.

Steps:

  1. Push code to GitHub.
  2. Go to vercel.com, import the repo.
  3. Vercel auto-detects most frameworks and sets build config.
  4. Deploy. URL is live in minutes.
  5. Custom domain via Vercel's domain UI or external DNS.

Free tier: Generous for personal use, includes 100 GB bandwidth. Commercial use requires a paid plan.

When it wins: Next.js static export, Astro, any framework where Vercel's auto-detection saves time.

See Vercel vs Netlify vs Cloudflare Pages for a head-to-head on the three.

Option 4: Cloudflare Pages

Cloudflare's global edge network makes Pages fast everywhere.

Steps:

  1. Push code to GitHub (or GitLab).
  2. Go to pages.cloudflare.com, connect the repo.
  3. Set build command + output directory.
  4. Deploy. Cloudflare's edge serves it globally.
  5. Custom domain via Cloudflare DNS or external.

Free tier: Unlimited requests, unlimited bandwidth on free tier (with reasonable use). 500 builds per month.

When it wins: Global audience where edge delivery speed matters, high-traffic sites approaching other hosts' free-tier caps.

Option 5: GitHub Pages

The simplest workflow if the code is already on GitHub.

Steps:

  1. Push code to a GitHub repo.
  2. Go to repo → Settings → Pages.
  3. Select the branch (usually main) and folder (/ or /docs).
  4. GitHub publishes at username.github.io/repo-name in a few minutes.
  5. For custom domain: add a CNAME file with your domain, configure DNS.

Free tier: Free for public repositories. Private repos require GitHub Pro.

When it wins: Portfolios, documentation sites, anything where the repo being public is a feature, not a bug.

Custom domain setup

All five options support custom domains. The general flow:

  1. Buy a domain (Namecheap, Cloudflare Registrar, Google Domains).
  2. In your host's settings, add the custom domain.
  3. At your DNS provider, point an A record or CNAME at the host.
  4. Wait for DNS to propagate (usually minutes to an hour).

Free SSL certificates (via Let's Encrypt) are included on all five hosts.

Which should you pick?

AI-generated site or single HTML file: HTMLPub. Paste workflow beats any other option for time-to-live.

Framework build (Astro, Hugo, Jekyll): Netlify or Vercel. Both auto-detect most frameworks, deploy in minutes.

Global audience at high scale: Cloudflare Pages. Unlimited bandwidth on free tier.

Portfolio or docs site on public repo: GitHub Pages. Zero-friction if the code is already there.

FAQ

How do I host a static website for free in 2026?

Five hosts work well: HTMLPub for AI-generated pages, Netlify or Vercel for framework builds, Cloudflare Pages for high-traffic or global sites, and GitHub Pages for public repo portfolios. Each has a free tier that covers most personal use cases.

Do I need to know git to host a static site?

Not for HTMLPub. You can paste HTML directly with no git involvement. Netlify, Vercel, Cloudflare Pages, and GitHub Pages all require git workflows for the connected-repo deployment flow.

Which free static hosting is fastest to deploy to?

HTMLPub. About 60 seconds from paste to live URL. Netlify and Vercel take a few minutes per deploy. GitHub Pages takes a few minutes after the first setup. Cloudflare Pages is similar.

Can I use a custom domain with free static hosting?

Yes on all five. Netlify, Vercel, Cloudflare Pages, and GitHub Pages include custom domains on their free tiers (you configure DNS). HTMLPub requires Starter ($10/month) for custom domains.

Will free static hosting handle my traffic?

Usually yes. Cloudflare Pages has unlimited free bandwidth. Netlify and Vercel both cap at 100 GB/month, which is enough for most personal sites. GitHub Pages has a soft 100 GB/month limit. HTMLPub's free tier is best for testing rather than sustained traffic.

Where should I learn more about the options compared side by side?

See Static Site Hosting: Free and Paid Options Compared for a deeper side-by-side.


If you want to skip the hunt: HTMLPub →


About the author. Michael Sacca is CEO of Leadpages and HTMLPub. He ships the workflows he writes about.

Keep Reading