Let’s See How to Host a Website for Free Using GitHub Pages.

Aswin Satheesh
featurepreneur
Published in
3 min readSep 3, 2021

What is GitHub?

GitHub is one of the world’s largest community of developers. It’s an intricate platform that fosters collaboration and communication between developers. GitHub has a number of useful features that enable development teams to work together on the same project and easily create new versions of software without disrupting the current versions.

What is GitHub Pages?

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website.

Let’s start…

Step 1 :

  • Create a GitHub account on github.com.

Step 2 :

After creating the account we have to create a repo that will be hosted on the Github pages.click on “New” button to create a new repo.

Name your project your [your_reponame].github.io ,For example here we are giving repo name as ‘my-website.github.io’ .It is very important that it’s named this way because that’s how we get access to GitHub’s free hosting service (GitHub Pages). Go ahead and keep this project public ,which just means anyone can see the code and initialize it with a README. Then click the “Creat repository” button.

Step 3 :

Next, we have to push the content of our site that will be visible in our Github pages.Your home page should be named as index.html. Because index.html is the page that Github pages look in your repo for hosting your main page.

So simply push your website code files via git bash or by simply drag and drop interface provided by Github.

So finally the repo looks like this.

after push the repo looks like this.

Step 4 :

Go to the Pages section of your repository’s Settings.

Step 5 :

Then choose the branch to ‘main’ .

Then save the source branch .

copy the URL shown in your page and paste it in the browser.You will see your website published live!

We have successfully published our website!!.

Thanks for reading. Hope it was useful.

Happy learning.

--

--