Host a Website on GitHub For Free (original) (raw)

Last Updated : 11 Nov, 2025

GitHub allows you to host websites for free using GitHub Pages. It’s an easy way to publish static websites, portfolios, or project demos directly from a GitHub repository. With GitHub Pages, your site gets a public URL, and you can update it anytime by pushing changes to the repository.

**Steps for Hosting Website on GitHub

Here, we are going to discuss the step-by-step process of hosting a website on GitHub for free. So, you can also host your portfolio or your college project online with GitHub.

**Step 1: Create a GitHub account

Screenshot-2025-04-14-183847

GitHub

**Step 2: Create a New Repository

Create New Repository

Create new repository

Give the description of the website you are creating and then click on ****"create repository"** button.

Name the repository

Name the repository as your username.github.io

**Step 3: Create an index.html file and a web.css file

Or

Click on ****" creating new file"** or "new file" to create a new file and name the created file.

Create New File

Create new file

Name the file with the ****".html"** extension so that you can add the HTML code for your website. Add the code for your website below in the edit section.

Add HTML code

Create index.html and add the HTML code for your website

Add a description and "**Commit changes" button so that your code gets added and saved on GitHub.

Commit HTML code

commit the HTML code

Add the CSS code for your website by doing the same process as above and then add a description and click on the ****"Commit changes"** button.

Add Css code

Create index.html and add the CSS code for your website

Commit css code

Commit the CSS code

**Step 4: Enable GitHub Pages

GitHub pages

Go to pages in the left section in the settings

**Step 5: Visit your website

Visit your hosted site

Final Hosted site

How to Host a Website on GitHub For Free?

Why Use GitHub for Website Hosting?