One of the first decisions you have to make when creating a blog is what tools to use. In my case, it was even more important than finding what to talk about: I start by looking at solutions, and that gave me the idea of my first blog post. While writing this simple blog post, at least 5 other blog post ideas came up. And I ended up splitting the first blog post in two parts: reasons why I created it, and this article.
Available solutions
My requirements when looking at solutions were:
- completely free: the only thing I want to pay for is my domain name. Everything else should be free and not too limited in bandwidth.
- easy setup: I want to start writing content, and spend as little time as possible setting things up, customizing, reading documentation.
- least amount of maintenance possible: once I’m setup, I want to write articles, publish them in a single click or command and be done with it. No manual deploying, no manual backup, no manual dependency updates should be required.
- free backups: if the server goes down, I need to have a copy of my blog I can quickly host somewhere else.
- no local dependencies: my local environment should be as lean as possible. I don’t want to install tons of dependencies to be able to write an article. Ideally, I should be able to jump on a new laptop and start writing articles without installing anything.
- flexibility: I don’t want to be limited by the framework. If I want to embed a video, add a custom JavaScript module or redesign my front page from scratch, it should not only allow me to do it but let me do it using whatever framework I want to.
- own domain name: I want to host my blog on https://blog.sauvajon.tech.
Medium
Medium is great. It has a great design, its tools are very easy to use, and there’s no setup needed whatsoever. But even better, it’s going to bring more traffic to your posts! It’s a great solution if you want to maximise your reach. I didn’t choose this solution because you can’t use your own domain name for your blog.
Wordpress
Wordpress is by far the most used CMS. It boasts a market share of 60%, and is being used by a third of all the websites online (the exact numbers vary depending on the source). You can be sure that if there’s something you need, someone else will have already solved that problem for you.
The main problem with Wordpress were the requirements: PHP, MySQL and a Web server acting as a reverse proxy. It also needs some significant disk space - at least more than other solutions. Hosted solutions exist, but they come at a cost (subscription cost, limitations and/or ads).
Ghost, Jekyll
They look like good solutions but I don’t want to install Node.js, Ruby or other development environment locally.
Hugo
I used Hugo before, for my website and other small projects. It has tons of flaws, and needs customisation for a lot of things, but is very lightweight, allows working very effectively and produces small HTML/CSS/JS bundles.
It builds my blog in about 50 ms, supports hot reloading out of the box.
No development frameworks are needed, you simply need the Hugo binary. On Mac, brew install hugo and you’re good to go.
Hot reloading with local hosting is as simply as hugo serve, and building for production is as simple: hugo.
Git
One of the things I like the most about Hugo is that it is extremely easy to use with git.
Changes are commits: it’s a workflow I’m used to, it’s simple and convenient. Diffs are easy to read and rollbacks are as simple as it gets. By hosting my repository on GitHub, I have a durable backup, and the ability to switch between laptops while my sources are synchronised. It also makes it easy for someone to collaborate with me, if needed in the future.
Themes
Like most CMS and website generators, Hugo has plenty of themes available for free. I found the Tale Hugo theme to fit the general aspect I want my blog to have, while the Ghostwriter theme has more features I want to use. I’ll use Ghostwriter as a base and detail in another blog post how I’m going to merge both themes, keeping the Ghostwriter features while using the Tale Hugo visual identity.
Hosting
I evaluated a few hosting solutions.
Self hosting on a cloud platform (Google Cloud Platform, AWS, Digital Ocean…) works but takes time to maintain, and by experience they are not very durable in time if you plan to stay on the free tier. Free tiers changes, everything you need to do is manual - even though there are solutions to automate SSL certificates renewal, and Docker makes upgrading whatever needs to be upgraded easier - there’s still a big set-up cost and a non-negligible maintenance cost.
The best solution in my situation was a free-tier hosting platform, that handles as many things as possible for me, while having the easiest set-up track. It also needed to give me the possibility to move away from it, so not being vendor locked is a necessity.
Using Hugo, I’m simply generating and hosting static files. Therefore, the steps to a published and publicly available blog are:
- build the static files using Hugo, on each commit
- deploy automatically by copying the built files over
- make the files statically available
- make them available under a custom domain name.
A custom solution with no associated costs (apart from the domain name) could have looked like that:
- CircleCI (free tier) that builds the static files on each commit
- CircleCI pushes the built files over to my storage solution
- Google Cloud Storage (free tier) to store the files
- An Nginx Letsencrypt companion to generate and renew SSL certificates, on a Google Compute Engine machine (free tier)
- An Nginx proxy, on the same GCE machine, that serves the GCS files under my domain name, using HTTPS.
Netlify does all of this for us, and more. It is super simple to configure, allows having all of the above in less than 10 clicks, and comes for free. Unless your blog grows very big very fast, and that’s all I hope for you, the free tier covers 100GB bandwidth/month, so you should be good for a very long time.
Here’s the simple Netlify config I came up with to allow automatic deployment:
netlify.toml
[build]
publish = "public"
command = "hugo --gc --minify"
[context.production.environment]
HUGO_VERSION = "0.74.1"
[context.deploy-preview.environment]
HUGO_VERSION = "0.74.1"
Domain names
Important for SEO
Having my own domain name instead of the plaftorm domain name (Medium, Netlify etc.) allows me to build my SEO from day one. By using a domain name from the start, I make sure all links to my site stay the same over time. If I started with a free domain name on a platform (let’s say blog-sauvajon-tech.wordpress.com), making the move to my own domain afterwards would be much more complicated.
Future proof
I’m not locked into a platform (Medium, Netlify, or any other hosting solution): if I decide to change platforms, I can simply point my DNS records to the new platform. It will be transparent for the readers.
Good URL decisions from the start
A blog needs to be durable. The links can’t break every 2 or 3 years. For that, I need to make the best URL-scheme and domain name decisions from the start.
My URLs look like /2020/07/16/creating-a-blog, allowing me split and merge sections however I want, and keep the existing URLs.
My domain name is blog.sauvajon.tech. I have two concerns with this domain name:
- “Sauvajon” is not easy to pronounce for native English speakers, and I’m writing my blog in English,
- it will be hard to rename my blog, if I want to specialise on a subject, e.g.
Coding Horring. At the same time, it gives me more freedom to write about anything.
Buying a domain name
This is something I’ve done with a handful of different providers, and I currently own 6 domain names. The best solution for me has always been OVH, a French web hosting service (that is now also an ISP and a Public Cloud Provider). Setting DNS records is dead easy, buying new domain names is quick and simple, they offer free email redirection as a service and while they’re not the absolute cheapest, they’re still very competitive. The only feature they’re missing in my book are wildcard email addresses, I’ll make another blogpost about that.
If you’re after the cheapest possible domain names, consider using comparators to find something that suits you. OVH has their own extension, .ovh, for 1 euro/year, and for less esoteric extensions, I used Porkbun a few times. It’s super cheap, but is very limited in options. Email redirections are not flexible at all, and neither is DNS configuration.
Setup with Netlify
Setting up a custom domain name with Netlify is very straight forward.
In your Netflify settings, choose the Domain Management -> Domains -> Add domain alias.
Netlify will ask you to register a few NS records, in my case:
blog.sauvajon.tech -> dns1.p05.nsone.net
blog.sauvajon.tech -> dns2.p05.nsone.net
blog.sauvajon.tech -> dns3.p05.nsone.net
blog.sauvajon.tech -> dns4.p05.nsone.net
Once this is done, they will be able to generate SSL certificates for you. And that’s it!
My blog is now available under https://blog.sauvajon.tech. It gets automatically updated every time I push a commit on master, and I can easily rollback if something goes wrong.