For the last 2-3 years I have been using Umami.is to track the tiny bit of website analytics I am interested in. It has served me well, it's nice and easy, and I do like that it only collects anonymous information (as in: doesn't track client IPs), but after I moved all the images in the Photography section to its own website the limitations of the free tier was a bit frustrating. I don't need many of its features, but I want to track more than 1 website. I could of course just create multiple accounts, but that would be cheating, and I would need to swap between logins to view the different sites.
But! Because it's open source, we can just self host it instead. It can't be hard right?
Well, to be honest I found the docs a bit slim on the topic. Sure, there is information on how to run the frontend app on various cloud services, and a good article on configuring a virtual machine on Digital Ocean, but that wasn't what I was looking for. I prefer not to have to manage servers if I don't have to. I have spent my years of sysadmin-ing both physical (including many trips to the datacenter to replace faulty hardware) and virtual machines. I just want small and easy(-ish) to understand platform services. I don't need kubernetes to run a single container and a database, and I don't feel like signing up for yet-another-cloud-service to host a single app.
So instead: I made a repo for how to setup a self-hosted instance in Azure. Using Container Apps to run the app, Azure Database for PostgreSQL flexible server for the database, and Azure developer CLI (azd) to the deploy the whole thing.
In addition. I have added shell scripts to import data from cloud.umami.is, do a bit of bootstrapping to configure a managed identity with workload identity federation, and sync settings from a local azd environment to GitHub, and a GitHub workflow action to run deployments without getting everything to work on your own machine.
It's all available at github.com/sjovang/stats.liasis.dev
ps: It's probably not cost effective compared to cloud.umami.is. The pro tier costs $20/month and you're probably better off just using that, but I have Azure credits to use =)
ps ps: It's really dumb that the data export doesn't contain timezone information. If you decide to use the import script, take care to first check your data region under settings