Hi there!
In this small post, I want to show you how you can set up the privacy-focused website analytics tool umami on your Unraid server. Umami is a simple, fast, website analytics tool for those who care about privacy. It is open source, and you can host it yourself. This is especially useful if you need analytics from your websites but, don’t want to use Google Analytics or similar services.
Prerequisites
Before you can start to install your umami instance, you need to have the Community Applications plugin installed. If you don’t have it installed yet, you can find the installation instructions here. You also need to be able to access applications from the outside because each user looking at your website will need to send data to your umami instance. I recommend using a Reverse Proxy like NginxProxyManager or Traefik.
Setup
1. Setup Postgres
If you don’t have a Postgres instance running yet, set it up first. You can find the postgresql14
image in the Community Applications store. Attention: The Postgres version 12.5 and lower will cause issues while installing umami! Click install and choose password, username and initial database name for Postgres. Now click Apply and wait until the container is installed and started up. If this is done, you can connect to Postgres via an application like DBeaver or pgAdmin. I will go on with DBeaver.
2. Create umami user and database
First, we have to add a new connection in DBeaver by clicking the new connection button and then PostgreSQL.
Now fill out the connection details and click Test Connection. If the connection is successful, click OK. To create a new user, open the newly made connection and navigate to your initial database. Inside there should be a folder called Roles. Right-click on it and select Create Role…. Now fill out the details, choose Super User for now and click OK. After that, right-click on your connection and click Refresh. Now right-click on Databases and then on Create Database…. Choose a name and select the user you just created as the owner.
3. Install umami
Navigate to your Docker tab in Unraid and click on Add Container. Now choose a name for the container and add docker.umami.dev/umami-software/umami:postgresql-latest
as repository. For us to be able to access the web ui we need to forward a port to our host. You can do this by clicking on Add another Path, Port, Variable, Label or Device and choose Port as the config type. Name it WebUI for example, 3000 for the container port and any free port as host port.
We also need to specify the connection string for the database. This string looks like this: postgresql://user:password@ip:port/dbname
Now click on Add another Path, Port, Variable, Label or Device and choose Variable as the config type. Name it DATABASE_URL
and add the connection string as value. Now click Apply and wait until the container is installed and started up. Please set up the outside connection with your Reverse Proxy before you continue.
Before we start the configuration of umami, remove the Super User attribute from the database user we created after the container started up properly.
4. Configure umami
If you followed the database setup and installation of umami correctly, you can now access the web ui by navigating to https://umami-subdomain.domain in your browser. Please use the connection via the Reverse Proxy. Login with the username admin and password umami and navigate to the Settings tab. First change the password of the admin user. After that, we can add your first website. Click on Websites and then on Add website. Choose a name and add the domain of your website. Now click on Save and you are done. You can now copy the tracking code by clicking on the code symbol next to the edit symbol and paste it into the <head>
section of your website. Now you should start to see some data in your umami dashboard if someone navigates to your website. 🥳
Wrapping up 🌯
Thanks for reading this post. I hope you enjoyed it and learned something new. If you have any questions or suggestions feel free to contact me through my contact form. You can also join my mailing list to get notified when I publish a new post.
Have a nice day!☀️
~ Marco