Learning how to host a static website for free is one of the most useful skills a beginner web developer can pick up. Whether you have built your first portfolio page, a small business landing page, or a simple blog, you do not need to pay for hosting to put it online. In this guide, you will learn five reliable ways to get your site live at zero cost, with step-by-step instructions for each one.
A static website is simply a collection of HTML, CSS, and JavaScript files that the browser renders directly, without a server-side language like PHP or a database like MySQL. This simplicity is exactly why free hosting is possible: static files are cheap to serve, so generous platforms offer it at no charge. If your site does not need user logins, a shopping cart, or dynamic content pulled from a database, static hosting is all you need.
In This Guide
- What Is a Static Website?
- How to Host a Static Website for Free: 5 Proven Platforms
- Comparing the 5 Free Hosts Side by Side
- Adding a Custom Domain (Still Free)
- Frequently Asked Questions
- Key Takeaways
What Is a Static Website?

A static website delivers the same pre-written files to every visitor. Your HTML page, its stylesheet, and its images sit on a server, and when someone types in your URL, those files are sent to their browser. Nothing is generated on the fly. This is different from a dynamic site built on WordPress, where every page view triggers PHP code and database queries.
The good news is that most beginner projects are static by nature. A personal portfolio, a resume page, a documentation site, a landing page for an app, or a simple event page — all of these can be built as plain HTML and CSS files. And because static files are so lightweight, hosting them costs the provider almost nothing, which is why the free tiers are genuinely useful rather than crippled demos.
One thing to know upfront: static does not mean boring. With modern JavaScript, a static page can include animations, interactive maps, image sliders, and even pull data from third-party APIs. It just cannot run code on the server itself. If you need a contact form, for example, you can use a free form-handling service instead of writing backend code — see our guide on building an HTML contact form without a backend for how that works.
How to Host a Static Website for Free: 5 Proven Platforms
Below are five platforms that let you host a static site for free with no credit card required. Each method includes the exact steps you need to follow. They all work the same basic way: you upload your files (or connect your code repository), and the platform serves them from a fast global network.
Method 1: How to Host a Static Website for Free with GitHub Pages
GitHub Pages is the classic free option and a natural fit if you already use Git. It is built directly into GitHub, so you can publish straight from a repository, and it is perfect for portfolios, project documentation, and small sites.
First, create a new public repository on GitHub named username.github.io, replacing username with your GitHub username. Then, in your project folder, run these commands to push your files:
git init
git add .
git commit -m "First commit"
git branch -M main
git remote add origin https://github.com/username/username.github.io.git
git push -u origin main
Once the push finishes, go to your repository on GitHub, open Settings > Pages, and under “Build and deployment” choose “Deploy from a branch” with the main branch and the / (root) folder. GitHub will publish your site within a minute or two at https://username.github.io. Every time you push new commits, the site updates automatically. GitHub’s official quickstart covers this flow in more detail: GitHub Pages quickstart.
The limits are generous for small sites: 1 GB of storage and 100 GB of bandwidth per month, which is far more than a personal portfolio will ever use. If you want a full walkthrough focused on beginners, read our step-by-step tutorial on how to deploy a website on GitHub Pages.
Method 2: Netlify — Free Hosting with the Easiest Setup
Netlify is widely loved for its simplicity. Its most beginner-friendly feature is drag-and-drop deployment: you can literally drag your project folder into the Netlify dashboard and get a live URL seconds later. No command line required.
Here is the fastest route. First, sign up at Netlify with your GitHub, GitLab, or email account. Then go to the Sites tab and drag your site folder onto the page. Netlify uploads the files and gives you a random URL like brave-panda-123abc.netlify.app, which you can rename in the site settings.
For a more professional workflow, connect a Git repository instead. Click Add new site > Import an existing project, authorize your Git provider, and pick your repo. Since your site is static, you can leave the build command empty and set the publish directory to the folder containing your index.html. From then on, every git push triggers an automatic redeploy — with a preview URL for each commit so you can check changes before they go live.
If you prefer the terminal, install the Netlify CLI and deploy in two commands:
npm install -g netlify-cli
netlify deploy --prod --dir=.
The first run will ask you to log in and create a site; after that, deploys take seconds. The free tier includes 100 GB of bandwidth per month, 300 build minutes, and automatic HTTPS on every site.
Method 3: Vercel — Fast Global Deployments in Seconds
Vercel started as a platform for frontend frameworks, but it handles plain static sites beautifully too. Its deploys are famously fast, and every project gets a global content delivery network plus automatic HTTPS without any configuration.
The quickest way to publish is the Vercel CLI. From your project folder, run:
npm install -g vercel
vercel --prod
The first time you run it, Vercel asks you to log in through your browser and then asks a few questions — accept the defaults, and when it asks for the output directory, just press Enter (for a plain static site, the current folder works fine). Vercel then uploads your files and prints a live URL like https://my-site.vercel.app.
Alternatively, import a Git repository through the Vercel dashboard: click Add New > Project, select your repo, and leave the framework preset on “Other” for plain HTML. Every push to your main branch redeploys automatically, and Vercel keeps every deployment in your history so you can roll back to an earlier version with one click — handy when an experiment breaks your layout.
The free “Hobby” plan includes 100 GB of bandwidth per month and unlimited projects, which covers personal sites and portfolios comfortably. Vercel also handles the technical details most beginners do not think about: compression, image optimization for supported frameworks, and instant cache invalidation so visitors always see your latest version.
Method 4: Cloudflare Pages — Unlimited Bandwidth on the Free Tier
Cloudflare Pages stands out for one reason: its free plan includes unlimited requests and unlimited bandwidth. If your site ever goes viral on social media, Cloudflare will not bill you or shut you down — a real risk on some other free tiers. It also runs on Cloudflare’s enormous global network, so your pages load quickly for visitors anywhere in the world.
The dashboard route is simple: log in to Cloudflare, go to Workers & Pages > Create > Pages > Upload assets, give the project a name, and drag in your project folder. Cloudflare deploys it and assigns a your-project.pages.dev address.
If you like the command line, use Wrangler, Cloudflare’s official tool:
npx wrangler pages deploy ./public --project-name=my-site
Replace ./public with the folder containing your index.html file. Wrangler uploads the files and prints the live URL. For Git-based workflows, connect your repository under Connect to Git instead, and Cloudflare will rebuild on every push. The official Pages documentation walks through all three flows: Cloudflare Pages docs.
One limitation to know: Cloudflare Pages does not support server-side code on the free plan, but that is irrelevant for a static site. It also gives you free HTTPS, free DDoS protection, and the ability to add your own domain at no cost — more on that below.
Method 5: Render — Free Static Sites with Automatic Deploys
Render is another solid option that offers free static site hosting with automatic deployments from Git. It is slightly less well-known than the others, but the workflow is clean and the free tier is reliable for small projects.
To deploy: sign up at Render, click New + > Static Site, and connect your GitHub or GitLab account. Select your repository, then set the Publish Directory to the folder holding your index.html (use . if it is at the repo root). Leave the build command empty for a plain static site and click Create Static Site. Render builds and deploys, giving you a URL like https://my-site.onrender.com, and redeploys automatically on every push.
Render’s free tier includes 100 GB of bandwidth per month and free automatic HTTPS. Its one notable quirk is that free web services (dynamic backends) sleep after inactivity — but static sites are served from its CDN and do not sleep, so your pages stay fast around the clock.
Comparing the 5 Free Hosts Side by Side
All five options are genuinely free and more than enough for a beginner’s static site, but they have different strengths. Here is how to pick:
- Choose GitHub Pages if your code already lives on GitHub and you want the simplest possible setup with no third-party account.
- Choose Netlify if you want the easiest possible path — drag-and-drop deploys, plus handy extras like form handling and deploy previews on the free plan.
- Choose Vercel if speed matters most to you, or if you plan to grow into a JavaScript framework later (it natively supports React, Next.js, and others).
- Choose Cloudflare Pages if you expect real traffic, because unlimited bandwidth means you will never get a surprise bill or a suspended site.
- Choose Render if you want a clean, no-nonsense deploy pipeline and like its straightforward dashboard.
In practice, you cannot go wrong with any of them. Many developers start with GitHub Pages for their first site and move to Netlify or Cloudflare Pages as their needs grow. Migrating is easy: your site is just files, so you can upload the same folder to a different platform in minutes.
Adding a Custom Domain (Still Free)
Every platform above gives you a free subdomain (.github.io, .netlify.app, .vercel.app, .pages.dev, .onrender.com). That is fine for practice, but a custom domain like yourname.com looks far more professional on a portfolio. Here is the good news: you can connect a custom domain to any of these hosts for free. You only pay the domain registrar (usually around $10–15 per year for a .com).
The process is the same everywhere and takes about ten minutes:
- Buy the domain from any registrar (Namecheap, Cloudflare Registrar, Porkbun, or similar).
- Add the domain in your host’s dashboard. On Netlify, for example, go to Site settings > Domain management > Add a domain. GitHub Pages has a “Custom domain” field under Settings > Pages.
- Point your DNS at the host. The host will tell you exactly which DNS records to create — usually a
CNAMErecord pointing to the host’s address, orArecords with specific IP addresses. Add these in your registrar’s DNS panel. - Wait for DNS to propagate (anywhere from a few minutes to a few hours), then verify that HTTPS is enabled. All five platforms issue free SSL certificates automatically, so the padlock appears with no extra work.
Do not skip the HTTPS step. Browsers now warn visitors about insecure sites, and search engines prefer secure pages. Fortunately, since every platform above handles certificates for you, there is nothing to install or renew manually.
Also, while you are polishing your site for real visitors, remember the small details that separate amateur pages from professional ones. A minimal valid HTML page is a good starting point — here is a correct template:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jane Doe — Web Developer Portfolio</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Jane Doe</h1>
<p>Front-end developer based in Berlin.</p>
</header>
</body>
</html>
The viewport meta tag makes your page display correctly on phones — without it, mobile visitors see a tiny desktop layout. Descriptive alt text on every image helps both accessibility and search rankings; our guide on how to write alt text for images for SEO shows exactly how to do it. And if you are still unsure how HTML documents are structured, the MDN Learn web development track is the most authoritative free resource available.
Frequently Asked Questions
Is free static website hosting really free forever?
Yes, with a caveat. The free tiers from GitHub Pages, Netlify, Vercel, Cloudflare Pages, and Render have no expiry date and require no credit card. What they do have are usage limits — bandwidth caps, build minutes, and sometimes storage caps. A personal site, portfolio, or small project will stay comfortably inside those limits forever. You would only need to pay if your site grows to serious traffic levels, at which point it is presumably earning its keep.
Can I use my own custom domain name on free hosting?
Absolutely. All five platforms in this guide let you connect a custom domain at no extra cost — you only pay your domain registrar for the domain itself. The host issues and renews the SSL certificate for free, so https://yourdomain.com works exactly as it would on paid hosting.
Is free hosting secure enough for a real website?
Yes — arguably more secure than many cheap shared hosts. Because there is no server-side code or database to hack, the attack surface is tiny. All five platforms serve your site over HTTPS by default, run it on a global CDN with DDoS protection, and handle patching and server maintenance for you. There is nothing to update and nothing to misconfigure.
What happens if I run out of bandwidth?
On most platforms, nothing dramatic: some will throttle or pause serving, and Netlify and Vercel may ask you to upgrade if you consistently exceed 100 GB per month. To put that in perspective, 100 GB covers roughly one to two million page views of a typical lightweight page — far beyond what a new site receives. If you expect viral spikes, Cloudflare Pages is the safest choice since its free tier has no bandwidth cap.
Can I host a blog or a portfolio with multiple pages for free?
Yes. A static site can have as many pages as you like — each page is just another HTML file. Many developers write posts in Markdown and use a static site generator like Jekyll, Hugo, or Eleventy to turn them into HTML, then host the output on any of these platforms. For a small portfolio, hand-written HTML pages are perfectly fine and you can expand to a generator later.
What can I not do with free static hosting?
You cannot run server-side code (no PHP, no Node.js backends, no databases) on these free static tiers. That rules out WordPress, user account systems, and shopping carts with real checkouts. Workarounds exist for common needs: form-handling services for contact forms, third-party comment systems like Giscus, and headless CMS options for editable content — but if your project truly needs a backend, you will need a different kind of hosting.
Key Takeaways
- A static website is plain HTML, CSS, and JavaScript served directly to the browser — no server code or database required.
- GitHub Pages, Netlify, Vercel, Cloudflare Pages, and Render all host static sites for free with no credit card needed.
- Deploy by pushing to Git or dragging a folder into the dashboard; every push redeploys your site automatically.
- All five platforms include free HTTPS, a global CDN, and a free subdomain — and all support custom domains at no extra cost.
- Pick GitHub Pages for simplicity, Netlify for ease of use, Vercel for speed, Cloudflare Pages for unlimited bandwidth, and Render for a clean deploy pipeline.
- Static hosting cannot run backends or databases — use third-party services for forms, comments, and other dynamic features.
Your First Site Can Be Live Tonight
You now have everything you need: five platforms, the exact commands to deploy, and a plan for adding your own domain. The fastest path to a live site is to start with whichever method felt most natural while reading — GitHub Pages if you already use Git, Netlify’s drag-and-drop if you want zero setup, or Cloudflare Pages if you want unlimited bandwidth from day one. Build your index.html, run the deploy steps, and share the URL. Once you understand how to host a static website for free, every future project — portfolios, landing pages, documentation, experiments — can go live in minutes instead of costing you a hosting bill.