Host a Website for Free Using GitHub Pages | No Server, No Cost | Humanitarians AI
This beginner tutorial shows how to turn a GitHub repository into a free, live website using GitHub Pages, with no server setup or hosting cost.
Putting a website online usually comes with two obstacles: finding somewhere to host it, and paying for that hosting every month. GitHub Pages removes both. If your project is already sitting in a GitHub repository, you can turn it into a live, free website in a few clicks, with no server to configure and no credit card required.
What GitHub Pages actually does
GitHub Pages lets you host a website directly from a GitHub repository, for free. The catch, and it's an important one, is that it only serves static websites: files made of HTML, CSS, and JavaScript, with no backend server or database behind them. That makes it a strong fit for portfolios, resumes, documentation sites, and small demo projects, but not for anything that needs server-side logic or a live database connection. If your project fits that description, all you need is a GitHub repository containing your project files.
Turning on Pages in your repository
Getting a site live starts in your repository's settings. Under the "Code and automation" section, there's a "Pages" option. Opening it presents a few choices to fill in. The first is the deployment source, which branch GitHub Pages should build from, typically the main branch. The second is largely automatic: once a branch is set, GitHub assigns a standard URL in the format of your GitHub username followed by .github.io, with your project name appended, so the pattern looks like username.github.io/project-name for any project you host this way.
Kicking off the build
Sometimes selecting the branch alone doesn't immediately trigger a deployment. If that happens, switching the source to "none" and then back to the main branch is enough to kick off the build process. From there, GitHub handles the deployment automatically, and it typically finishes in under a minute. A checkmark next to the Pages settings confirms the build and deployment completed successfully, and once that appears, the live link is ready to visit.
Confirming the live site
After the build finishes, going back to the Pages settings section shows the live link directly. Following that link, formatted as username.github.io/project-name, opens the working site. For a project like a fitness tracking web app used as the example in this walkthrough, that link is the exact standard format anyone hosting a static project this way should expect to see, regardless of what the project itself does.
Key takeaways
- GitHub Pages hosts static websites, HTML, CSS, and JavaScript, for free directly from a GitHub repository.
- It cannot host sites that depend on a backend server or database.
- Enabling it takes place under Settings, then the Pages option in the Code and automation section, where you choose the deployment branch.
- The resulting URL follows a standard pattern: your GitHub username, followed by .github.io, followed by the project name.
- If a deployment doesn't trigger automatically, toggling the source off and back on will kick off the build.
- A custom domain can be connected afterward for a more professional-looking URL.
Try it yourself
If you already have a portfolio, resume site, or small HTML/CSS/JS project sitting in a GitHub repository, this is one of the fastest ways to get it online without paying for hosting. This kind of beginner-friendly walkthrough is part of the technical tutorials that Humanitarians AI shares to help people build and deploy real projects, not just learn concepts in the abstract.
Full transcript(auto-generated, with timestamps)
[0:00]Hello everyone. In this video, I'm going to explain how to host a website for free using GitHub pages. And this is a very beginner friendly video. First, let's learn about GitHub pages. Basically, this GitHub pages, they let you host your websites for free directly using your GitHub repository. And mainly, you can host only static websites. So, if you have a back end or databases, you probably cannot host it here. The best examples would be your portfolio files or basic or simple projects that contain only HTML, CSS or JavaScript files. And all you need is just a GitHub repository with all your project files in it. And let me also
[0:36]Give a quick demonstration of how it works. So this is my GitHub repository of an app, web app. Uh it's a fitness tracking web application and I will host this in GitHub pages. The first step is to go to my settings. So click on this settings button. Scroll down in the code and automation section you will find the pages option. Yes, this is what we are going to use and click on it and yes and now I have to fill out a couple of options here. So first is the source source of this deployment is going to be from a branch. I'm going to deploy my
[1:06]Main branch and yes the branch is main and um yeah the for the domain it's going to be my probably my project name dot githubname.github.io. It's a standard URL. Uh I hope I it was right. Let's see once the deployment is done. And to kick off the build or the deployment, what I'm going to be doing is I just changed it to none. And now I'm going uh to change it back to the main. And this should kick off the build. Yes, I was right as you can see. And now it might take some time. Let's see how much time it takes. It probably shouldn't be more than a minute. And
[1:42]Yeah, uh the build is going on. Yes, the build is completed now. This check mark means that the build and deployment is done and you should receive a live link. Let's go back to pages option and yes your site is live. I can see the link. Okay. So the URL was my github name.github.io/my project name. Yes, this is a standard URL for you know if you are using it for different project u the initial will be the same project name.github.io/roject name. That is going to be the standard format for all the hosting. And yes uh everything looks great. This is working exactly as expected. And that's it for
[2:17]This video. Hope this was helpful. Thank you so much for watching.
More videos
2:08Bridging the Pixel Gap in Browser Automation.
2:23How One Narrow Safety Rule Can Make an AI Less Safe Everywhere Else.
2:04Why splitting a chunk from its document makes it retrieve for the wrong question
4:20Three You Can Take Back. One You Can't.
2:21Why a 50-turn agent pays for the same screenshot 35 times unless it caches the pixels
1:53