How To Get Free Hosting For Your Website

How To Get Free Hosting For Your Website

Featured Image Made With MockoFun

Want to know how to get free hosting for your website? Read to find out step by step how to get a website hosted for free and get 100 PageSpeed score.

There’s no catch, I won’t try to sell you into any hosting providers, honestly!

It’s just an elegant method to get a free website setup and hosting. I’ve used this method on various occasions for clients and myself. When building websites on a budget this method works great. If you want to see how a website with free hosting performs, check out these 2:

  • Nickname Generator – an online nickname generator with blog section and everything else you would expect from a normal website
  • Free IT Solutions – an IT blog dedicated to free solutions for IT problems

What You Need To Host Your Website Free

Hosting a static website for free requires only 2 things:

  1. A free Github account
  2. Your website files

That’s it!

Free Site Hosting HTML Files On Github

Yes, Github allows you to host static websites in their infrastructure. Once you created your Github account, simply create a repository.

To make your free site hosting to work on Github, you need to place your static website in your repository under a folder named /docs/. You can use the Github interface to create this folder and also to upload the files of your static website. This is what Github refers to as Github Pages.

It’s as easy as that!

After your files are uploaded to your repository’s /docs/ folder your website will be accessible via a link like this:

https://[githubUsername].github.io/[repositoryName]

When you access that link, it will load index.html from your /docs/ folder. Here’s how it works:

 

Why Github Is The Best Free Website Hosting?

Why is Github is really the best free website hosting you’ll ever get?

Here are just a few reasons:

  1. Github has a really strong high-availability infrastructure which will guarantee 99.99% uptime. This rivals even paid hosting providers.
  2. It uses an in-built CDN (content delivery network) which means all requests will be served extremely fast from geographical locations closest to the requestor
  3. Provides HTTPS out-of-the-box
  4. Automatic backup and version management. All changes to your website stored and backed up automatically (basic Github functionality; you can fork, branch, etc)
  5. Up to 10GB of storage per repository
  6. Ability to easily transfer your website to any hosting provider (most of them provide Github integrations for migrating)

Let’s Check Website Speed Test Results For A Github Hosted Website

According to a recent study on page speed done by Brian Dean of BacklinkO aprox. 47% of websites have less than optimal performance speed. Google already announced that in the period of June-August it will start considering core web vitals metrics as a ranking factor.

This means that faster websites will have a ranking advantage over slower websites. Also, a faster website means happier readers that will stay on your website and come back often. A while back I wrote an article about how to reduce bounce rate on a website, so check that out if you’re interested.

For our website speed test we’ll use one of my websites that I hosted on Github: Nickname Generator

Of course, speed test results are determined by many factors which have to do with how the website is developed. But, we can make a general idea about how fast the site is. Page speed is a important both for the user experience and for SEO purposes.

To give you some idea about how the Nickname Generator website is implemented, I used Bootstrap 5 for the front-end framework and some custom built JS to generate cool nicknames, username or gamertags.

For generating the speed test results I used 3 online website speed test tools:

  1. Pingdom Tools
  2. GTmetrix
  3. Google PageSpeed Insights

Here are the results:

How To Get Free Hosting PageSpeed Insight Test Results How To Get Free Hosting Pingdom Tools Test Results How To Get Free Hosting GTmetrix Speed Test Results

As you can see: a perfect score on Google PageSpeed Insights and almost perfect on all other page speed test tools. This is mainly due to the top quality Github free website hosting.

How To Get Free Website Hosting AND Domain Name Registration?

So now with Github you have the free website hosting part solved. But how about a free domain name registration?

That’s a tricky one. In my case, I registered my nickname-generator.net domain name with a normal domain registrar service like GoDaddy, NameCheap, etc. and I paid around 15$/yr.

But, there are services online that you can register your domain for free. Just Google them. Of course, you will get a domain name with .tk, .ml, .ga or similar, not a .com or .net.

No matter if you choose a free domain name registration or a paid one, your next step should be to link your new domain name to your Github hosted website.

I highly recommend here to register for a free account with Cloudflare. Cloudflare is mainly a proxy DNS service, but it’s so much more. Basically, with the Cloudflare services you will funnel all traffic through their infrastructure for a whole bunch of advantages from access speed improvements, to DoS (denial of service) protection, to easy management and setup of your DNS records.

For switching your new domain through Cloudflare you will basically need to change your NS (name servers) in your domain registrar administration panel. Then, all your DNS records will be managed in Cloudflare. This is a big advantage because all your DNS changes take instant effect.

Then, to hook up your Github free website hosting setup to your new domain, simply put the Github IP address in the Cloudflare A record associated with your domain (the Github IP is 185.199.111.153).

Then, in your Github repository under Settings > Pages > Custom domain simply put in your new domain name and click save.

And voila!

Your setup for free website hosting and domain name registration works like a dream!

Want to subscribe to our newsletter?

John Negoita

View posts by John Negoita
I'm a Java programmer, been into programming since 1999 and having tons of fun with it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top