Elena' s AI Blog

How to Host Your Blog for Free with GitHub Pages

20 Feb 2026 (updated: 14 Sep 2026) / 18 minutes to read

Elena Daehnhardt

Generated by Midjourney. Prompt: AI-assisted coding with a robot reviewing a pull request.


If you click an affiliate link and subsequently make a purchase, I will earn a small commission at no additional cost (you pay nothing extra). This is important for promoting tools I like and supporting my blogging.

I thoroughly check the affiliated products' functionality and use them myself to ensure high-quality content for my readers. Thank you very much for motivating me to write.



TL;DR:
  • Create a GitHub account, make a repository named yourusername.github.io, add Jekyll, pick a theme, write your first post in Markdown, push to GitHub, and optionally connect a custom domain. Free, reliable, and yours.

Previous: Part 29 — Three years of Elena's AI Blog 🎈

Next: Part 31 — A Journey Through AI and Code

How to Host Your Blog for Free with GitHub Pages

A little while ago, a friend asked me how I host this blog. When I told her it was free, ran on GitHub, and I had never paid a hosting bill for it, she did not quite believe me. I completely understand that reaction — it sounds too good to be true. But GitHub Pages is genuinely one of the best-kept secrets for anyone who wants a personal blog or website without the overhead of managing a server or paying for hosting every month.

In this post I want to walk you through everything from scratch: creating a GitHub account, setting up your blog with Jekyll, choosing a theme, writing your first post, and connecting a custom domain if you have one. Whether you have never used Git before or you are a developer who just has not gotten around to setting up a personal site, I hope this gives you everything you need to get started.

What Is GitHub Pages, Exactly?

GitHub Pages is a free hosting service built into GitHub. You store your website files in a GitHub repository, and GitHub automatically builds and serves your site at a public URL. There is no server to configure, no database to manage, and no hosting plan to pay for.

GitHub Pages represents a static-site hosting model that builds and serves a Jekyll site directly from a Git repository, eliminating dedicated servers, databases, and monthly hosting fees.

The URL GitHub gives you by default looks like yourusername.github.io, which is already a perfectly respectable address for a personal blog. And if you want a custom domain like yourblog.com, you can connect one with a few small configuration steps — more on that later.

GitHub Pages works best with static sites — websites built from plain files like HTML, CSS, and Markdown, with no server-side code running. For a blog, this is ideal. Jekyll is the tool that turns your Markdown posts and templates into a complete static website, and it is the one I use and recommend. That said, if you prefer a different static site generator — Hugo, Eleventy, Astro — GitHub Pages will work with those too, though the setup steps will differ a little from what I describe here.

Prerequisites for GitHub Pages: Git, Ruby, and a GitHub Account

Before we start, make sure you have these three things:

  • A GitHub account (free — we will create one in the first step)
  • Git installed on your computer
  • Ruby installed on your computer (Jekyll runs on Ruby)

Do not worry if the last two sound unfamiliar. I will point you to the right places to get them set up.

Step 1: Create a GitHub Account

If you do not already have one, go to github.com and sign up for a free account. Choose your username thoughtfully — it will become part of your blog’s default URL (yourusername.github.io), so something close to your name or blog identity works best.

Once you are signed in, you are ready to create your blog’s home.

Step 2: Create Your Repository

In GitHub, a repository (or “repo”) is where all your blog’s files live. For GitHub Pages to publish your personal site at yourusername.github.io, the repository must be named in a very specific way: exactly yourusername.github.io, replacing yourusername with your actual GitHub username.

Click the + icon in the top right corner of GitHub and choose New repository. Set the name to yourusername.github.io, make sure it is set to Public, and click Create repository.

That is your blog’s home on GitHub. Now let us get Git set up on your computer so you can push files to it.

Step 3: Install Git and Clone Your Repository

🔒 Subscribe to keep reading.

Step 4: Install Jekyll

🔒 Subscribe to keep reading.

Step 5: Choose and Apply a Theme

🔒 Subscribe to keep reading.

Step 6: Personalise Your Configuration

🔒 Subscribe to keep reading.

Step 7: Write Your First Post

🔒 Subscribe to keep reading.

Step 8: Publish to GitHub

🔒 Subscribe to keep reading.

Step 9: Connect a Custom Domain (Optional)

🔒 Subscribe to keep reading.

Common GitHub Pages Errors and Fixes

🔒 Subscribe to keep reading.

Maintaining a GitHub Pages Blog: Ongoing Workflow

🔒 Subscribe to keep reading.

GitHub Pages Setup: Summary and Next Steps

🔒 Subscribe to keep reading.

You've hit a Deep Dive tutorial.

I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):

Already a subscriber? Use the magic link from your last newsletter, or reset your password.

New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2026) 'How to Host Your Blog for Free with GitHub Pages', daehnhardt.com, 20 February 2026. Available at: https://daehnhardt.com/blog/2026/02/20/how-to-host-your-blog-for-free-with-github-pages/
All Posts