To host a website on GitHub for free, you must create a public repository containing static files (HTML, CSS, JavaScript) and enable GitHub Pages in the repository settings. The site will be automatically published at a URL like https://username.github.io/ or https://username.github.io/repository-name/ once you push your code.

Step-by-Step Process

  1. Create a Repository: Log in to GitHub and create a new public repository. For a personal site, name it username.github.io; for a project, use any name (e.g., portfolio).

  2. Add Files: Upload your index.html, CSS, and JavaScript files either by dragging them into the repository or by cloning the repo to your local machine and using Git commands:

    git clone https://github.com/username/repo-name.git
    cd repo-name
    # Add your files here
    git add .
    git commit -m "Initial commit"
    git push origin main
  3. Enable Pages: Navigate to the repository Settings, select Pages from the sidebar, and under Source, choose the branch (usually main) and folder (root or /docs) containing your files. Click Save.

  4. Verify Deployment: Wait a few minutes for GitHub to build the site. Your website will then be live at the provided URL.

Key Features and Limitations

  • Free Hosting: There are no monthly fees, and SSL/TLS encryption (HTTPS) is provided out of the box.

  • Custom Domains: You can map a custom domain (e.g., mydomain.com) by adding a CNAME record in your DNS settings and configuring it in GitHub Pages settings.

  • Static Content Only: GitHub Pages serves static sites only; it does not support server-side languages (like PHP or Python) or databases.

  • Version Control: You can track changes, roll back to previous versions, and collaborate using Git branches and pull requests.

Alternatives for Advanced Needs If you require dynamic functionality (databases, server-side logic), consider platforms like Netlify, Vercel, or Cloudflare Pages, which support serverless functions and more complex build pipelines.

GitHub has GitHub Pages that lets you host static websites for free. You won't be able to use a database with those though. Answer from TehNolz on reddit.com
🌐
Supabase
supabase.com
Supabase | The Postgres Development Platform.
I definitely plan to use it on any and all future projects. ... Love supabse edge functions. Cursor+Supabase+MCP+Docker desktop is all I need ... First time running @supabase in local. It just works. Very good DX imo. ... Run supabase locally and just wow in silence! I am impressed! This is the kind of tooling I would want for my team.
Docs
Supabase is the Postgres development platform providing all the backend features you need to build a product.
Blog
Get all your Supabase News on the Supabase blog
Pricing
Explore Supabase fees and pricing information. Find our competitive pricing Plans, with no hidden pricing. We have a generous Free Plan for those getting started, and Pay As You Go for those scaling up.
Start your project
Special character (e.g. !?<>@#$%) · 8 characters or more
🌐
Netlify
netlify.com › pricing
Pricing and Plans | Netlify
A production deploy is the live version of your project that gets pushed to your main domain and becomes accessible to all users. Also includes: Unlimited Deploy Previews and branch deploys. ... AI inference costs are calculated based on the cost of the AI model used. ... Compute is the amount of resources used by your functions and builders. This includes: Serverless functions, scheduled functions, background functions, Preview servers, and Agent runners. ... When Netlify auto-detects spam in a form submission, then a credit is not consumed.
Discussions

Does github have a free hosting service?
GitHub has GitHub Pages that lets you host static websites for free. You won't be able to use a database with those though. More on reddit.com
🌐 r/github
20
31
February 12, 2022
How to host my code on to github and then to online hosting platforms
hello @everyone! let me hope you are doing all well; Anyway guys I just need a help because I really want to start hosting some of my few free projects of html and CSS on my device to the web and GitHub but I totally don’t know where and how to begin so am asking of help from anyone who can ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
0
April 15, 2021
Host my website on github?
GitHub only supports static pages for product information, documentation, etc. If you have anything with code behind it, you're going to need a VPS or a code-hosting site like Heroku. More on reddit.com
🌐 r/github
7
7
March 25, 2019
Is github the way to go?
on github you could host static website, so no wordpress possible anyway. you could buy domain separately and link to static website later or use xxxx.github.io as it was given by github. Also you could check gitlab they almost the same More on reddit.com
🌐 r/webhosting
23
17
October 19, 2019
🌐
Medium
medium.com › @shamsu97 › hosting-your-website-with-github-pages-70308c7f5628
Hosting your website with GitHub Pages for free! (deploy straight from Git) | by ishamsu | Medium
March 23, 2020 - Hosting your website with GitHub Pages for free! (deploy straight from Git) Hosted directly from your GitHub repository. Just edit, push, and your changes are live. As a student spending money for …
🌐
GitHub
pages.github.com
GitHub Pages | Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
🌐
Quora
quora.com › How-do-I-make-a-free-website-hosted-on-GitHub
How to make a free website hosted on GitHub - Quora
2. Top right corner you will find a + symbol. Click it and it will have an option of creating a new repository.Create a new repository and name it and initialise it with a readme file 3. Now upload all your w...
🌐
Reddit
reddit.com › r/github › does github have a free hosting service?
r/github on Reddit: Does github have a free hosting service?
February 12, 2022 -

I’m still learning to code, i found github is a good tool for me to store codes and stuff.

Currently im using those free hosting websites to learn sql/html. I know I can host them locally but its easier to distribute to my other team members.

so title is the question, does github have free hosting similar to 000webhost, infinityFree kind?

thank you

Find elsewhere
🌐
GitHub
gist.github.com › TylerFisher › 6127328
Basic steps for hosting on Github · GitHub
You can just leave your website ... it is very simple to make GitHub redirect your page. Log in to your domain registrar and find where to change your host records....
🌐
GitHub
docs.github.com › en › pages › configuring-a-custom-domain-for-your-github-pages-site › managing-a-custom-domain-for-your-github-pages-site
Managing a custom domain for your GitHub Pages site - GitHub Docs
You can set up or update certain DNS records and your repository settings to point the default domain for your GitHub Pages site to a custom domain. GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-host-a-website-on-github-for-free
Host a Website on GitHub For Free - GeeksforGeeks
November 11, 2025 - You can visit your website by ... and for your website to be accessible. ... Free Hosting: GitHub Pages offers free web hosting with custom domains....
🌐
GitHub
docs.github.com › en › pages › getting-started-with-github-pages › configuring-a-publishing-source-for-your-github-pages-site
Configuring a publishing source for your GitHub Pages site - GitHub Docs
You can configure your GitHub Pages site to publish when changes are pushed to a specific branch, or you can write a GitHub Actions workflow to publish your site. People with admin or maintainer permissions for a repository can configure a publishing source for a GitHub Pages site. GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.
🌐
Udacity
udacity.com › blog › 2025 › 08 › how-to-host-your-website-for-free-using-github-pages-a-step-by-step-guide.html
How to Host Your Website for Free Using GitHub Pages: A Step-by-Step Guide | Udacity
August 6, 2025 - Before taking a look into the technical steps, let me explain the compelling benefits that can make GitHub Pages become your go-to solution for hosting static websites: GitHub Pages provides free hosting for public repositories.
🌐
DEV Community
dev.to › anticoder03 › 10-free-web-hosting-solutions-for-static-and-dynamic-sites-48g1
10 Free Web Hosting Solutions for Static and Dynamic Sites - DEV Community
October 20, 2024 - Custom Domains: You can link your own domain name (e.g., mysite.com) and use it for free. Version Control: Integrated with GitHub, making it easy for developers to track changes to their code and collaborate on ...
🌐
LinkedIn
linkedin.com › pulse › launch-your-website-free-beginners-guide-github-pages-omgmc
Launch Your Website for Free: A Beginner's Guide to GitHub Pages
February 4, 2024 - GitHub Pages is a static site hosting ... on GitHub, optionally runs the files through a build process, and publishes a website. It's an ideal platform for hosting project documentation, personal blogs, portfolio sites, and even small business ...
🌐
freeCodeCamp
forum.freecodecamp.org › t › how-to-host-my-code-on-to-github-and-then-to-online-hosting-platforms › 456063
How to host my code on to github and then to online hosting platforms - The freeCodeCamp Forum
hello @everyone! let me hope you are doing all well; Anyway guys I just need a help because I really want to start hosting some of my few free projects of html and CSS on my device to the web and GitHub but I totally d…
Published   April 15, 2021
🌐
DEV Community
dev.to › github › how-to-host-your-first-site-for-free-on-github-pages-45ob
How to host your first site for free on GitHub Pages - DEV Community
August 16, 2022 - This is a demonstration to show developers that they can build and host static websites using any framework. See more example frameworks hosted on GitHub Pages: ... All designs and elements are open source, available for free for anyone to use.
🌐
GitHub
docs.github.com › en › pages › getting-started-with-github-pages › what-is-github-pages
What is GitHub Pages? - GitHub Docs
You can use GitHub Pages to host a website about yourself, your organization, or your project directly from a repository on GitHub. GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public ...
🌐
Everhour
everhour.com › github › how to host a website on github for free: a 2026 guide
How to Host a Website on GitHub for Free: 2026 Guide & Productivity Tips
2 weeks ago - Name the repository using the format username.github.io if you want to host a user or organization site. For project-specific sites, use any name (e.g., portfolio). Keep the repository Public (required for free GitHub Pages).
🌐
GitHub
docs.github.com › articles › creating-project-pages-manually
Creating a GitHub Pages site - GitHub Docs
For example, you can have a dedicated ... deploy your site source files. If the account that owns the repository uses GitHub Free or GitHub Free for organizations, the repository must be public....
🌐
Toptal
toptal.com › developers › github › unlimited-scale-web-hosting-github-pages-cloudflare
Free Web Hosting with GitHub Pages and Cloudflare | Toptal®
January 16, 2026 - Since GitHub pages support custom domains, you can host a static website on GitHub pages free of charge, with deploys straight from Git. Enough talk, let’s see it in action! I’ve gone ahead and made a single page React app that fetches and ...