Privacy-respecting analytics with GoAccess

2 minutes

Recently, I decided to put some analytics on my website. Would be nice to see what view number are like and what pages get the most traffic.

Most people would just stick Google Analytics on and be done with. But the privacy implications off that are huge and terrible, not to mention any self-respecting privacy extension would block it almost immediately.

A quick internet search shows a plethora of alternatives which respect privacy, but they don’t quite fit my needs.

  • Matomo is bulky, and overkill for what I need. Not to mention tracks way too much!
  • Fathom used to be great, but is now closed source, and the previous “community edition” codebase has little support and is pretty buggy
  • GoatCounter is one instance per site, and is a bit weird to work with. And then there’s the name.

#Enter GoAccess

GoAccess is an amazing tool to find and analyse log files, and build a report. The report is just simple boring analytics, nothing complex, plain and simple! The reports can either be in the form of a terminal ncurses-line interface, or an HTML report. This HTML report is a single file, so there’s no complex server required. The HTML report also supports live update through websockets.

Unfortunately, this websocket functionality requires GoAccess to be exposed on a fixed port relative to the report, which wasn’t ideal to my use case. It’d be yet another service to expose, ports to map, firewall rules to open, far too much hassle.


To solve my albeit niche, problem, I created a docker container. This container wraps the existing goaccess container, but with a custom entrypoint which generates a static report at interval, rather than websockets. This means it’s live updating (or close enough), but without the need to expose a websocket server.

version: "2.3"

    image: nginx:latest
    restart: unless-stopped
      - ./access.log:/var/log/nginx/access.log
      - ./report.html:/usr/share/nginx/html/stats/index.html:ro

    image: theorangeone/goaccess-static:latest
    restart: unless-stopped
      - ./report.html:/var/www/goaccess/report.html
      - ./access.log:/goaccess/access.log:ro

#Does it work?

Yes, quite well actually! I’ve got an incredibly simple analytics tool which gives just the information I need. It’s performant, it’s simple, and has almost 0 runtime overhead.

You can see it in action here:


GoAccess isn’t the perfect tool for everyone. Because it’s so simple, it’s not especially customizable. Either you use the reporting it gives you, or you find something else.

I’ve also heard GoAccess can get slow to generate with incredibly large sites, which whilst unlikely to affect me, could happen to someone!

Besides that, this was a great success!

Update August 2020: I recently decided to deploy a fully-featured yet still private analytics solution using Plausible.

Share this page

Similar content

View all →

Self hosting my website

2 minutes

A few days ago, I was sharing a blog post to someone on the self-hosted podcast discord, and they asked if I was self-hosting my website. Unfortunately, and rather ironically, I had to answer no. I’ve been intending to move it over to my own server for a while, so…

Observing Traefik with InfluxDB

2 minutes

Traefik’s dashboard is a great tool to diagnose routing issues, and check services are being detected correctly, but it can’t do much more than that. It doesn’t show any metrics. Instead, it relies (arguably correctly) on external monitoring tools for metrics. Traefik supports 4 metric backends: Datadog, Prometheus, StatsD and…

Damn nature

Website deployment process

4 minutes

My website is a very important project to me. I’ve written a lot of content over the years, useful both to me and other internet folks. Currently, my website is a static site, powered by Hugo. Because it’s static, the content is served insanely quickly and handles any insane load…