Published: September 21, 2020
Today I’m going to tell you how I used free services to host my blog completely for free.
On top of that, the hosting is handled by a third party, so I don’t have to worry about servers which are open to the internet, and, of course, completely for free.
If that wasn’t enough, I don’t even have to worry about deploys, since every time I push my site to github, it gets automatically updated and published to the internet, almost in real time.
I chose to host a blog on it, but you could host any html page on it, and here is how:
You could create your own site from scratch using html, but it honestly isn’t a viable choice if you are looking to create a blog, because it’s going to get harder the more content you have.
In this tutorial we are going to use Jekyll, a static site generator.
So if you don’t already have it, go ahead and download Jekyll.
Follow the Quick Start Guide to create your first blog, for now just do a bare post to test your blog. In short once you finished installing jekyll run this in a command prompt:
$ bundle install jekyll # installing jekyll in your machine
$ jekyll new my-site && cd my-site # create new jekyll project
Once you’ve done with creating your placeholder post, run
$ bundle exec jekyll serve --host 0.0.0.0
In the same directory of the blog. This way you will have hot reload for each change, and by adding --host 0.0.0.0
you can test your site even on other devices on the same network.
If you actually want to use this blog you might want to take a look at Jekyll Themes instead of going for the default one.
Go to Github and create an account/log in, then from your dashboard click on New
to create a new repo. Go back to your blog’s directory and type this in a command line:
$ git init # initializing project folder
$ git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPO.git # change UPPERCASE with your own!
$ git add -A && git commit -m "Initialize" && git push -u origin master # push code to github
Go to netlify.com and, if you don’t already have an account, register, then connect netlify to your Github/Gitlab/BitBucket account. After you do this go to netlify dashboard, and following this step.
new site from git
, then choose Github
or whatever else you chose as your VCS.Deploy site
Your site should now be live, but the domain is a random mess of words.
Go to Freenom and find a domain that you like. Technically you could get more than 1, but please don’t do that as that site can only exist if the userbase is able to regulate themselves. As you can probably see I chose https://alessandroferrari.live
.
Now all you need to do is go on your project dashboard on Netlify, click on Domain Settings
, then Add Custom Domain
, and follow the simple process to register your newly acquired domain as a valid one for netlify.
.com
, .org
, .xyz
, or any other “popular” domain.