As a developer, we always need some sort of hosting to host our project on the internet so that our client could access that site. But for such little work, we have to buy a whole hosting plan and renew it year after year.
So I searched for a solution. And I found out 4 ways to host website for free and the best part is that there hosting duration is lifetime free as of now.
I will host this website(page) to demonstrate the whole process
4 Ways to Host a Static Website for Free
1. Host website for free : Using Netlify
Method 1: Using Drag and Drop
STEP – 1(Sign up)
First, you need to sign up for netlify. I would suggest you log in through the GitHub account so that you can directly use your project’s repo to deploy here.
STEP – 2(Drop your file)
The second step is to drop your project file in zip format so that your site could go live.
STEP – 3(Changing site name)
As you can see in the above picture you get a link through which you could access your site. But that looks very unprofessional and hard to remember.
So you could change the randomly generated site’s name by going to domain setting or add your custom domain if you have one. That’s it , your static site will be hosted for free.
Method 2: Using Netlify Git Feature
STEP – 1(Select option)
Select the new site from the git option in netlify’s dashboard. You must be login through Github to host website for free using this option.
STEP – 2(Select Git Provider)
Select your favorite Git provider which you use.
STEP – 3(Select Repo)
Select your repository which you want to host for free. In my case it is sami15/demosite. If you don’t know how to create repo worry not I have explained it in the later part of this post.
STEP – 4(Done)
Select your repo and click done. That’s it within seconds your website will hosted for free.
2.Host website for free : Using Github
STEP – 1(Create Repo)
The first step is to create a repository and set its name(Github’s suggested name is worth following) and then select a public repository.
STEP – 2(Uploading Files)
To follow this you must install git bash first : Download
Open your project folder and left-click and select open git terminal option. And type all command shown above.
If you are committing the first time through git it can throw “error like who you are“. So type these commands after git init command.
git config –global user.email “[email protected]” (Your github’s email)
git config –global user.name “Your Name” (Your github’s username)
Omit –global to set the identity only in this repository.
STEP – 3(Setting Branch)
After following step 2 go to your repo site and click setting option and scroll down and select Github pages option and change that to master branch. Than your website, link will popup and you can access your site.
3. Host website for free : Using Fast.io
STEP – 1(Connect storage provider)
First step is to select your storage provider after you click on sign up button. Always select github because it works best with fast.io.
STEP – 2(Authorization)
Second step is to authorize your Github account with fast.io.
STEP – 3(Installation)
The third step is to install fast.io in your Github. If you are going to use this service regularly to host website for free select all repositories.
STEP – 4(Password)
The fourth step is to set strong password for your fast.io account
STEP – 5(Setting Name)
The fifth step is to set the name of your site.
STEP – 6(Setting Repo)
Sixth step is to select the repo of your project which you want to host website for free. And after this it will ask to select master branch.
STEP – 7(Url Name)
The seventh step is to set the name of your site which will be used afterward to form your site URL.
STEP – 8(Final Step)
Click ok and your static website will be hosted for free.
4.Host website for free : Using Google Drive
Step – 1(Upload Files)
The first step is to log in to your google drive account and upload your project folder by drag and drop in google drive to host website for free.
Step – 2(Renaming Folder)
The second step is to rename your project folder name in this format “www.yourFolderName.com“. This step is necessary to follow so do not skip this step.
Step – 3(Selecting Host)
The third step is to visit drv.tw(google’s site) and choose google drive option.
Step – 4(Choosing Account)
The next step is to choose that Gmail account in which you have uploaded your project files before.
Step – 5(Upload Files)
The last step is to click ok and relax because google will do the next steps for you and finally it will host a static website for free. And it will redirect you to admin panel through which you can access your site by the URL generated by google.
If you want to attach the custom domain to the site read this article by google: visit.
As I said earlier all four providers are best to host website for free but my personal favorite is netlify and fast.io because they are damn easy to set up and you can easily attach your custom domain with it for free. The main problem with Github and Google Drive is custom domain. They are not easy it setup if you are doing it for the first time. That does not mean they are bad if you are ok with no custom domain than Github is the best and most reliable choice to go with.
QnA Related to Free Hosting
How can I host my HTML website for free?
Which is the best free hosting provider?
Does Google host websites for free?
Is free hosting good?
Thanks for reading my article and if you find this article helful kindly share with others. And also check out other articles on : 45+ css glitch effect , 15+ Best chrome extensions for developers and 70+ Important C# Interview Questions And Answers.