DEV Community

Cover image for How to host a website within a minute for FREE!
Pradumna Saraf
Pradumna Saraf

Posted on • Updated on

 

How to host a website within a minute for FREE!

Yes!! you heard it right, with the help of GitHub Pages you can host a website within a minute, for FREE.

So what are GitHub Pages?

Image description

GitHub Pages is a static website 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.

Image description

Let's now get straight into the process.

Image description

Step-1 : Creating a GitHub account,

If you already have, you can skip this step.

Image description

Step-2 : Creating a GitHub Repo.

Create a new public repository and named it as <Your-username>.github.io,(as shown in the image below). If it's an organization account, then put the organization name. After that commit it.

Image description

Step-3 : Adding a index.html file.

After the repo is created, now it's time to add the index file. You will get served with this kind of screen after you committed the repo, click on creating a new file. Also, you can head over to the repo main page for creating the file.

Image description

Name the file index.html(shown in the image below) and add some starter HTML code (You can use the sample code below).

Image description

<!DOCTYPE html>
<html>
    <head>
         <title>Pradumna Saraf</title>
    </head>
    <body>

         <h1>Website in One Minute</h1>
         <p>We Did it :)</p>

    </body>
</html>
Enter fullscreen mode Exit fullscreen mode

After adding the starter code, scroll down and commit those changes.

WOOHOO 🎉, It's done, your website is hosted at .github.io, in my case pradumnasaraf.github.io


Note: if your website is not visible, no need to worry, wait 1-2 minutes and then try again because sometimes deployment takes time:D.

Top comments (1)

Super Useful CSS Resources

A collection of 70 hand-picked, web-based tools which are actually useful.
Each will generate pure CSS without the need for JS or any external libraries.