How to host a website in Github ?

Hosting a website for free in Github

What is Github?

  • Github is a provider of internet hosting for software development and version control using git and github desktop.



Now if you have your website ready for hosting then follow the below steps properly for hosting this website for free in github.
I'll just show you up the files of my website here...


Okay!!! Now follow the below steps for hosting...


Step-1 : Create a account in Github.

  • If you have already created a account in github then Sign In into Github.
  • If you don't have a account in Github, its simple and easy to create a account.
1) Open Github : Github   

Here you will find a page like this : 



2) Click on Sign up. You'll find a page as shown below.

3) Fill the required details properly. Next You will be redirected to your github account. 

Okay!!! We are done with first step...


Step-2 : Creating a Repository in Github.

1) Go to your Github account in browser. Click on new repository.




2) Here you need to follow few important things.


  • Enter repository name. The repository name must be your user name followed by extension .github.io (Eg. arshad272.github.io) as shown in above image.
  • Afrer that Click on Create repository.

As of now we created our repository. Now close your github page.



Step-3 : Download and install Github Desktop

What is Github Desktop ?
  • Github Desktop is a tool that allows you to interact with github from Desktop.
1) Go to Github Desktop : Github Desktop 

2) From the above link download Github Desktop. Now we see the installation of Github Desktop.

3) Now open your downloaded file. This will start installaing Github Desktop.


4) Now you will find Github Desktop window as shown below. Here you need to login into your Github Desktop.


5) Click on Clone Repository and then Click on Sign in.


6) Here as we had already created and signed in into our Github in browser, now you can simply Click on option showing, Sign in using your browser.



7) Now in your browser you'll find alert as shown below. Here Click on Open Github Desktop.


Now we had successfully logged in into your Github Desktop.



Step-4 : Now Clone the repository in Github Desktop.

1) Find and open the repository which you created now in Github and then Click on Clone.

In my case the repository in shown above.

2) Now here choose your path where you want to create your new repository folder and then Click on Clone.


Now we had successfully cloned into our repository.




Step-5 : Push the website to Github.

This is our Final Step. We are ready for hosting.

1) Now in the above step a folder will created in the path you chosen while Cloning Repository. Copy your website files to that folder. In my case the folder will look like this.


2) Now open your Github Desktop.


Now here Add Summary of as your wish (In my case 'Uploading Website') and the Click on Commit to main.

3) Now finally Click on Publish branch.



  • Now all of our website files had published into our github repository.
  • Website is ready now. Now you can access your website Globally through the link which will be in the format of (your_user_name.github.io/your_html.html ). In my case the link looks like (arshad272.github.io/home.html).

That's all Guys!!! Hope you find this Helpful... Keep Sharing...

Comments