DEV Community

Valesh
Valesh

Posted on

How to host your web applications on github pages

Github provides a free hosting service to help your websites go live online. It is called Github Pages. Github Pages builds a static website from the HTML, CSS and Javascript files in your repository. Let's see how.

(For the purpose of this tutorial, we'll assume you already know how to create a repo and add files to it.)

Step 1:
Go to your repo, click on 'Settings'

Settings Option

Step 2:
Click on 'Pages' in the left sidebar

Pages Option

Step 3:
Under the 'Source', click on 'None'.

None Option

Step 4:
From the dropdown menu, choose your main branch and click Save.

Main Branch

Step 5:
That's it! Now your site is ready to be published. Wait a couple of minutes for your site to be live on the given link!
Published

If you want to host a web application or your personal portfolio on yourusername.github.io, create a repo with the name 'yourusername.github.io' and follow the above steps.

Pro Tip:
If you want to host your custom domain on github, first enter your domain name in the 'Custom Domain' field and hit 'Save'. Then point the A record of your domain to the following ip addresses:

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
Enter fullscreen mode Exit fullscreen mode

Let me know in the comments if you found it helpful!

Top comments (0)