How to host your HTML or jekyll website for free with GitHub pages

How to host your HTML or jekyll website for free with GitHub pages

Hosting a static HTML or Jekyll website on Github is easy, free, and fast and is one of the easy ways to get your project online quickly. In general you get one organization site per GitHub account and unlimited project sites. Previously hosting a site required command-link knowledge. But now you can create it easily. Of course I’ll show the step-by-step guide showing how to get your site online using Github Pages – the painless way.

For User or Organization Site


Step 1 : Sign-up for GitHub

Create a free GitHub account.

sign up for gitHub

Step 2 : Create a Git repository

create a new repository

Create a New repository named username.github.io, where username is your username (or organization name and first part of the repository should exactly match your username) on GitHub.

Github for A terminal


#1 – Clone the repository

Go to the folder where you want to store your project, and clone the new repository:

 clone the repository

#2 – Hello World

Enter the project folder and add an index.html file:
enter the project folder name

#3 – Push it

Add, commit, and push your changes:

add,commit and push changes

#4 -The website is online!

Fire up a browser and go to https://username.github.io.

GitHub for Windows & Mac


#1 – Clone the repository

Click the “Set up in Desktop” button. When the GitHub desktop app opens, save the project.

If the app doesn’t open,install github for desktop and clone the repository from the app.

clone the repository

#2 – Create an index file

Grab your favorite text editor and add an index.html file to your project:

 create an index file

#3 – Commit & sync

Enter the repository, commit your changes, and press the sync button.

commit and sync

#4 – The website is online!

Fire up a browser and go to https://username.github.io.

 Setting up a custom domain


#1 – Choose your custom domain

Pick a custom domain and register it with a DNS provider

#2 – Add your custom domain to your GitHub Pages

  1. On GitHub, navigate to your GitHub Pages site’s repository.
  2. Under your repository name, click Settings
  3. Under “Custom domain”, add or remove your custom domain and click Save.
  4. Set up your custom domain with your DNS provider

#3 – Set up your custom domain with your DNS provider

Setting up your pages custom domain with your DNS provider depending on the type of custom domain you have:

Conclusion

It looks like a lot of steps, but there’s nothing too difficult involved in setting up Github hosting, just make sure you get all the steps in the right order!
Note: 
  • GitHub Pages highly recommends its users not to store sensitive data in Pages repository because the sites hosted on GitHub Pages are public.
  • Overall published GitHub Pages sites should not exceed 1GB.
  • Doesn’t support server-side programming language such as PHP, Ruby or Python

It’s not going to meet everyone’s needs but if you just want to launch a simple website, GitHub pages is a quick and easy way to get started.