Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

How to Host a Website on GitHub Pages (Free Plan Rules)

Put your site's files in a GitHub repository with an index.html, index.md or README.md entry file, then set a publishing source for GitHub Pages in that repository. With GitHub Free the repository must be public, and you can't use Pages to host an online business or shop.

What GitHub Pages can host, and on which plan

GitHub Pages is a static hosting service: it takes HTML, CSS and JavaScript files from a repository and publishes them as a website. It doesn't support server-side languages such as PHP, Ruby or Python.

Your plan decides which repositories you can publish from. GitHub's free plan gives you Pages in public repositories only, and the same goes for GitHub Free for organizations. On GitHub Pro, Team, Enterprise Cloud or Enterprise Server, you can publish from private repositories too.

A private repository doesn't make a private website, though. The published site is still publicly available on the internet, so take out any sensitive data first.

Two kinds of site, two web addresses

The repository's name matters, so I'd pick the type of site before creating it. A user or organisation site lives at <owner>.github.io, and you're limited to one per account. A project site lives at <owner>.github.io/<repositoryname>, and you can have one for each repository. You aren't tied to the github.io domain either: Pages also works with your own custom domain.

Create the repository on GitHub.com

Any files you publish need a repository to sit in, which is also the starting point for using GitHub to host a site.

  1. In the upper-right corner of any page, open the menu and click New repository.
  2. Choose the Owner.
  3. Type a name. For a user or organisation site it must be <user>.github.io or <organization>.github.io, all in lowercase.
  4. Choose a visibility. Pick public if you're on GitHub Free.
  5. Toggle Add README to On.
  6. Click Create repository.

Add your entry file and publish

  1. Go to your site's repository on GitHub.com.
  2. Decide on a publishing source: either a branch and folder, or a GitHub Actions workflow.
  3. Create the entry file, named index.html, index.md or README.md. With a branch and folder as your source, it has to be at the top level of that folder. So if you're publishing from /docs on main, the file goes in /docs.
  4. Configure the publishing source for the repository.

The two sources differ in how they build. Branch publishing runs your files through Jekyll by default; if you don't want that, put an empty file named .nojekyll in the root of the publishing source. With GitHub Actions, standard runners are free for public repositories. In a private repository, usage charges apply once you've used up what your plan includes.

  1. Under the repository name, click Settings. If it isn't visible, use the dropdown menu.
  2. In the sidebar's Code, planning, and automation section, click Pages.
  3. Under GitHub Pages, click Visit site.

Mistakes that stop a site showing, or break the rules

Checking too soon

Changes can take up to 10 minutes to publish, so don't start undoing things straight away. If they haven't shown after an hour, check for Jekyll build errors. A deployment that runs past 10 minutes times out.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

Pushing from an account that can't trigger publishing

If you're publishing from a branch and the site hasn't appeared, check who's pushed to the publishing source. It has to be someone with admin permissions and a verified email address.

Running a shop or online business on it

According to GitHub's documentation, Pages isn't intended for, or allowed as, free hosting to run an online business or an e-commerce site. The same rule covers any site that's primarily directed at commercial transactions or commercial software as a service. You also shouldn't use a Pages site for sensitive transactions, such as sending passwords or credit card numbers.

Ignoring the size and traffic limits

A published site can't be larger than 1 GB, and that's also the recommended limit for the source repository. There's a soft limit of 100 GB of bandwidth a month, plus one of 10 builds an hour, which doesn't apply if you build with a custom GitHub Actions workflow.

Go over the quotas and GitHub may not serve your site, or it may email you suggestions such as a content distribution network, releases or a different host. If requests are being rate limited, they'll get an HTTP 429 status.

Forgetting that visitors are logged

When someone visits a Pages site, their IP address is logged and stored for security purposes. That's true whether or not they're signed in to GitHub.

My advice for a small business

Choose GitHub Pages for a static site that isn't there to sell, and keep the repository public so you can stay on GitHub Free. Your shop, checkout or paid software should go on a different host from day one.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.