I remember when I was in my first year at University, my neighbour in student residences used apache to share his music collection. It was just an index page of all the files he had, but at the time I was fascinated with all things file sharing. Kazaa was in the process of being dethroned and bittorrent was in its ascendency. Anyway, the idea of being able to host your own page from your own computer was fairly amazing to me. I remember going to the Apache homepage…and being completely and utterly overwhelmed. Having only really had a computer for a couple of years at that point, I gave up pretty quickly.
Fast forward just over a decade and I have NAS to install software from a repository. I see Wordpress and I wonder what I could do with it. I had just got to grips with Dynamic DNS so I could SSH into my NAS from outside my network, and this seemed like a logical next step to take.
Wordpress
I found Wordpress initially tricky, partially because it required a full LAMP stack to run. I dutifully installed a MySQL database and after a fair amount of tinkering got it working. Initially I set up a site for my girlfriend so she could publish some of her writing. The software was pretty good at staying out of the way only broke…some of the time.
I was also involved in administering an eSports website running on a paid host. That was, at times, a bit of a nightmare as we had malicious code uploaded by some of our members to deal with.
Overall I quite like Wordpress and, when it works, it’s a nice bit of software with generally fairly intuitive tools for authoring content. I am certainly going to keep an instance running for my girlfriend as, even when self-hosted, the act of logging in to the site directly, creating a post, editing and formatting it and then publishing it without ever being exposed to the backend cannot be beaten.
However, the downsides have been getting to me for a while. I always found it a bit slow. It is, after-all, essentially an app written in PHP. For every link followed or bit of interactive content served it has to retrieve it from the MySQL databse behind it. This complexity introduces some of the insecurities for which Wordpress is famous if left without updates or installing plugins from dubious sources.
For me, the final straw was really when I uploaded an avatar while administering and writing for the eSports site. Once I did this I found the avatar had made its way to my self-hosted Wordpress account, Github account and even my Plex account. I found this particularly disturbing and hardly respectful of privacy.
For those that want a great Wordpress install guide, I have found the Digital Ocean ones to be brilliantly explanatory.
For those that are looking for something faster than Wordpress with almost none of the insecurities, a static site generator may be of more interest…
Hugo
Hugo is a Static Site Generator and takes a completely different approach to creating a website. Wheras Wordpress is encumbered by database queries, Hugo does not have a database at all! Instead, pages are created in markdown and it is Hugo’s job to compile them as a series of html files. This has huge security implications (no database to attack, no php to poke holes in) and a web server is far faster simply serving the pages than querying a database.
Hugo still has to be served by something, so a LAMP stack is not entirely abandoned, but once the the static files are generated, it is simply a case of copying them to the web server. This process can even be automated- tools like Nextcloud can be used to sync your site folder and a web server need only be pointed at the “public” where Hugo generates the static files.
The downsides of this approach really come from a user standpoint. I have found that markdown editors vary hugely in quality, and they are certainly not intuitive. I love using the MacOS - only Atom text editor with some markdown plugins to make formatting a little easier. However, this is still not as intuitive as the Wordpress method.
Additionally, editing templates can be fairly scary to a newbie. I use the Hugo-Coder theme for this site, but I had to make some modifications from the base template. This meant looking through the various CSS files and trying to work out what options did what on the generated page. I used Firefox’s Web Inspector to try and work this out, but it was a tricky process for someone who has never done much more than dabble in HTML. That said, I suspect it far less tricky than the clunky experiences I have had editing Wordpress PHP templates.
Hugo is not as well documented as Wordpress, but the documentation that does exist is pretty great. I have found the following resources hugely useful:
-
The Hugo quickstart guide on the project website is an invaluable resource. Many themes are also there with demo sites to try them out.
-
The Davd.io blog. In particular the posts about Hugo, although this guy writes impressively about other technology and projects he has worked on.
-
The Github pages of the various themes for Hugo are also a huge mine of information as the authors often explain how to use and modify their themes.
Despite enduring a bit of a learning curve coming from the Wordpress/PHP application paradigm of website creation, I really enjoy Hugo and learning the bits and pieces that will make it work. I think that this will probably be my method of choice in the future for hosting sites given how simple it makes it.
I know it sounds a bit corny, but the feeling of self-hosting a page on the internet is hugely powerful. While it is increasingly not for the fainthearted given concerns over security, there is something magical to me at being able to view a page served by a computer in my apartment while I am on the other side of the world. The idea that you don’t have to rely or give in to companies offering the same services feels quite powerful. I understand the tradeoffs that this brings, but for now it reminds me of that time in University (increasingly long ago…) where I was amazed that you could do this sort of thing yourself.