Self Hosting a Blog With Ethical Analytics

Self Hosting a Blog With Ethical Analytics

Having figured out where and how I'm going to host my personal services, it was time to get started. When it came to my blog, I had picked Ghost, as discussed earlier, due to its rich Activity Pub support that's currently in rapid development and beta. But before I picked it, I did have a good look at the alternatives.

WordPress has been around forever and still drives nearly half of all websites. It even has Activity Pub support available via a plugin! But the code base for Wordpress is old, originating in 2003 - which alone isn't necessarily bad. But having worked with it myself in the past (including for this blog in the past), I wasn't a big fan of how it worked, and the recent drama surrounding the community in general didn't help. So I quickly ruled WP out.

Could I just add Activity Pub to my current static site? Whilst it's possible, it does require running a server to assist with things such as subscription requests and comments. Rolling a custom implementation was far beyond the time commitment I was ready to commit to. If you're interesting in this, Maho Pacheco did a fantastic series of posts on how he achieved it which is a great read.

Plume looked like a decent option, but its lack of current maintenance (and direct discouragement for use) made me put it aside. Continuing to rummaging through the list of Fediverse Blog platforms was a fun task, but ultimately the allure of Ghost, with its great user experience, current rapid development and growth, gave me the best peace of mind for the next decade of use.

Ghost: The best open source blog & newsletter platform
Beautiful, modern publishing with email newsletters and paid subscriptions built-in. Used by Platformer, 404Media, Lever News, Tangle, The Browser, and thousands more.

It is worth keeping in mind, that Ghost is primarily an alternative to the popular Substack service - designed not for personal blogging, but for paid independent newsletter services, which have become rather popular in the last decade. It's packed with functionality for monetising these newsletters with integrations with Stripe (for taking subscription payments) and 'lead gen' analytics relating to which posts caused signs ups and tracking the finances. All of which are irrelevant to me.

However it also is perfectly suited for a small personal blog such as mine too, with the added bonus of allowing people to sign up and subscribe, to receive new posts via email - whilst also including the ability to participate in conversations via commenting. Combined with the upcoming Activity Pub support, which was my primary desire, it seemed like a good choice.

Ghost is super easy to set up on Dokku, and indeed Daniil Okhlopkov had done just that back 2021 with a how to blog post - my setup pretty much followed this, except hosting via Binary Lane in Melbourne - so there's no reason to duplicate this great work - go check out his guide!

The only other difference is that I decided early on that I did want my own Dockerfile in the mix, for everything I self-host - to allow me to customise things if desired. So instead of just telling dokku to directly use the ghost image, I could keep my own repo, including a cheat setup guide in the readme for future myself. This 'code', which is what I send to dokku by pushing up the repo, can be found at https://gitlab.bednarz.au/bed/ghost-dokku.


With any blog, one would also want like some basic analytics, just for curiosity's sake. Ghost doesn't come with anything built in (apart from lead gen and monetisation) and they suggest that people use the standard Google Analytics solution. No thanks - all I wanted was simple page views, referral sources, countries and devices. I also wanted something that would respect people's privacy, I don't want tracking cookies, to store identifiable data and I certainly don't want to send the analytics data I am capturing anywhere other than my own server. Plausible fit the bill perfectly for this.

Plausible: Self-Hosted Google Analytics alternative
Plausible Analytics is a privacy-friendly and open source Google Analytics alternative that you can install and self-host on your server.

Whilst Plausible can be a paid service (a commercial offering based and hosted in the EU), it is open source and can be self hosted. They store less identifiable data than even traditional server logs would (which record IP addresses of individual visits) - it doesn't track individual journeys, it only keeps track of aggregate data. It is fully compliant with the EU's GDPR without needing any consent popups - because it simply doesn't track that much.

Whilst it can still offer commercial businesses additional tracking such as the much loved utm campaign tags to help one 'optimise the sale funnel' and advertising dollars - its all anonymised and aggregated (and of no use to me). For my simple curiosity needs - it's everything I need. They even offer and encourage the ability to make your site data publicly available for transparency purposes - which I've done here: https://plausible.bednarz.au/bednarz.au

A screenshot of Plausible Analytics showing a chart of unique visitor counts, top sources and top pages.
A screenshot of Plausible Analytics showing counties and devices

Like Ghost, someone had already offered a setup example of running Plausible on Dokku, which I have adopted and manage in a very similar manner to Ghost - though its Dockerfile does has some configuration assistance in the mix: https://gitlab.bednarz.au/bed/plausible-dokku

Having got the basics sorted, it was time to figure out how I can possibly replace Facebook Groups and Events for my annual camping trips with mates that we've been doing for over 20 years (with the last 15 or so of those years being organised with photos shared on Facebook). All of which have probably been used to train Meta's AI now 😠. It was time to jump off that train wreck. Stay tuned...

Top Photo by Bee Felten-Leidel / Unsplash