How I created a self-managed blog, secure and maintainable
This article is to show how I created my personal web blog
So, I finally made the decision to create my own personal website. Alright, I've purchased the domain mikelors.com, but what comes next?
What I wanted
I had some clear priorities for my webpage. Mainly three
- 👷 Minimal maintenance: I'm aiming for a setup without the need for plugins or frequent updates. I have past experiences with CMSs like Joomla, Wordpress, Drupal... and they are cool, but require maintenance effort that I don't want.
- 🔐 Secure with no effort: I don't want a website that could be hacked easily and, at the same time, I don't want to spend time and effort on security features.
- 🤌 Self-managed: I don't want a SaaS platform like Wordpress.com, Blogger, Whatever where the owner could change their policies, change their prizes or simply ban me for any reason.
The purpose of this article is to demonstrate how I achieved this setup.
Long story short is asking a good friend that already had a personal website that I guessed that could have similar priorities than me.
How it's made
So yes, I asked to my friend and coworker Dani Sancas (you can check his cool blog danisancas.com) if his website covered my priorities and, no surprise, the answer was "yes, with an SSG". This explanation is writen by me, but the credits belong to Dani. Thank you for your advice!
A Static Site Generator (SSG) is a software engine that generates static sites. This means generating HTML, CSS, and almost everything else needed for the site. There are several options but the one Dani recommended and I used here is Zola. I am not going to create a tutorial about Zola, it already has a very good documentation. I will explain how it works and how it covers my priorities.
This is everything I needed:
- 🔒 A private Repo: This is where Zola lives. It's private, so everything here is only accessible by me. It has a small CI/CD script made with Github Actions to deploy the website.
- 🔓 A public Repo: this is where the blog lives. The HTML and CSS you are seeing now. Using Github Pages, it has a HTTPS access to be published as a website.
- 🌐 A domain: I bought the nice www.mikelors.com to have my own domain.
How this works:
- ✏️ I write new articles 📄 or whatever to the Private Repo. Zola works with Markdown, so it's pretty easy to write document with good format and appearance.
- ⚙️ Whenever I commit changes to the Private Repo, the CI/CD process is triggered. It performs two key functions:
- Generate the Static Website's Files using the Zola framework.
- Update the Public Repo with these Files.
And that's it :).
What I got
How my priorities are covered:
- 👷 Almost zero maintenance: The website is 100% static. No dynamic elements or moving parts... I don't need so I don't have them. HTMLs and CSSs. Nothing to update, nothing to improve, nothing. If I wanted, I could upgrade the Zola version... but only if I wanted to get new features or something.
- 🔐 Secure with no effort: The hackeable code is in a private repo, closed. The public website only has HTML and CSS . No databases, no scripts, no files storing data, no permissions, nothing. It's only a facade.
- 🤌 Self-managed: It's me and my GIT repositories. Currently hosted on Github, but if necessary, I can migrate them to a different GIT server with just one command. This is real self-managing 🤘
Some extra cool features that were not my priorities:
- 🧳 Easy to migrate: it's markdown. There are a lot of markdown interpreters and SSGs. I love Zola, but tomorrow I could move all my articles to a different SSG or framework.
- 🍪 No cookies: Did you need to push any annoying button in this website to accept/reject cookies? You did not. Nothing in the client's browser but HTML and CSS. No cookies, no annoying warnings or storing data for third-providers.
- 🏃 Quick: I would say SUPER QUICK. The page loads super fast (95/100 performance qualification in Pagespeed.web.dev.
- 📱 Responsive and 🤙 pretty: Zola has several good templates. I checked several and decided for this cool template called DeepThought that I like. And I can forget everything about Responsiveness, the template does it very good. Actually I got a 92/100 in RankMath
- 💰 Cheap: everything is 100% free but the domain. I paid 7€ for the first year.