Umami is lightweight, privacy-focused analytics software for websites and web applications. This is one of the best free alternatives to Google Analytics and it offers an easy-to-use interface that can view and analyze incoming web traffic similar to Google Analytics. Today's article will show you how to install Umami on Ubuntu Linux.
Why use Umami to track website analytics?
One of Umami's biggest advantages is that its website analytics software anonymizes all data about its users. This makes Umami extremely attractive to webmasters who want to see their website's performance without compromising their visitors' privacy.

Another reason to use Umami is that the software is GDPR compliant and does not rely on cookies to track user sessions. Therefore, you don't need to provide any additional opt-in banners to your visitors, making your website smoother and easier to navigate.
Finally, Umami is completely free and does not take a lot of system resources to run properly. This means you can install Umami on your existing server and enjoy free analytics for your websites.
Download Docker and Docker Compose for Umami
The first step in hosting your own analytics with Umami is to download both Docker and Docker Compose for Linux computers. To do that, get the signing key from the Docker project website:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Note: This section focuses on installing Docker for Ubuntu. If you are using another distribution, see general instructions for installing Docker on Linux.
Create a new archive file in “/etc/apt/sources.list.d/” using your favorite text editor:
sudo nano /etc/apt/sources.list.d/docker.list
Paste the following line of code into the new repository file:
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable
Make sure the system is completely updated and working correctly:
sudo apt update && sudo apt upgrade
Install Docker, Docker Compose and additional dependencies for Umami:
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin nginx git
Install Umami
Navigate to your user account's home directory, then grab the Umami Git repository from the developer's Github page:
cd ~ && git clone https://github.com/umami-software/umami.git
Go inside the Umami Git repository, then open the pre-built Docker Compose file with your favorite text editor:
cd ~/umami
nano ./docker-compose.yml
Scroll down to the “environment:” category, then replace the value of the variable APP_SECRET with a random string of characters.

Note: You can generate your own random string of letters and numbers by running: cat /dev/urandom | tr -dc 'A-Za-z0-9' | fold -w 32 | head -n 1.
Save the Docker Compose file, then run the following command to build and install the Umami container:
sudo docker compose up -d
Confirm that your Umami instance is running by listing the available Docker Containers in the system:
docker ps

Protect Umami with SSL Reverse Proxy
At this point, you now have a self-hosted Umami analytics instance running on port 3000 in your Linux system. However, to access this service over the Internet, you first need to transfer this service through SSL Reverse Proxy.
Start by adding a new DNS “A” record to the domain registrar pointing to the IPv4 address of the Umami server. In the example case, the “A” record would be set to “umami.myreallygreatserver.xyz.”

Check if the “core” snap package is already present in the server:
sudo snap install core
Install the Certbot snap package from the Electronic Frontier Foundation (EFF):
sudo snap install certbot --classic
Create a new website configuration file for SSL Reverse Proxy:
sudo nano /etc/nginx/sites-available/umami
Paste the following code block into the new site configuration file:
server {
server_name SUBDOMAIN.YOUR-ROOT.DOMAIN;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
Replace the value of the “server_name” variable with your domain name.

Save the new website configuration file, then create a symbol link to it “/etc/nginx/sites-enabled:”.
sudo ln -s /etc/nginx/sites-available/umami /etc/nginx/sites-enabled/
Check the Nginx configuration file for errors, then run systemctl to start the reverse proxy:
nginx -t
sudo systemctl reload nginx.service
Register your Umami server with EFF:
sudo certbot register --agree-tos -m YOUR@EMAIL.ADDRESS
Run the following command to generate an SSL certificate for the website:
sudo certbot --nginx -d SUBDOMAIN.YOUR-ROOT.DOMAIN
Confirm that the Umami instance is working properly by opening a web browser and navigating to your subdomain.

Add Umami Analytics to your website
By default, Umami sets the default username to “admin” and the default password to “umami”. This can be extremely insecure and you should change your password when you log in for the first time.
To fix this, click on the user icon in the top right corner of the dashboard.

Click the link Profile on the small pop-up menu.

Click the button Change Password in the catalog Password.

Type “umami” into the text box Current Passwordthen provide your new password above the text box as well New Password and Confirm Password.

Click Save to apply your new password, then select Dashboard to return to the Umami home screen.
Add sites to track in Umami
To add a new site to your Umami instance, click the link Settings on the top navigation bar of the page.

Click the button Add Website on the right side of the page.

Doing this will open a small window where you can provide your name and website address. In this case, the example would provide “Website” for the name and “web.myreallygreatserver.xyz” for the domain.

Click Save to confirm your changes, then click Edit on site entry.

Go to tab Tracking Codethen copy the HTML snippet to your clipboard.

In your website, paste the HTML snippet into the section
of files. You need to put the tracking code on every page you want to track.
Confirm that Umami is currently properly tracking web analytics by visiting your site, then opening the Umami dashboard page.

Umami isn't the only free analytics software you can use. Check out some of the best Google Analytics alternatives here.