How to Install Umami on Linux and Add Analytics on Your Website

by Tyrese Harris
19 minutes read

How to Install Umami on Linux and Add Analytics on Your Website

A pic of a person working on a laptop.

Umami is a lightweight and privacy-fixated analytics software agenda for sites and net apps. It is one of the most secure save options to Google Analytics and it lends an simplistic-to-earn serviceability of user interface that can stare at and examine inbound net website traffic tantamount to Google Analytics. Listed below, we depict how to enfranchisement Umami on Ubuntu Linux and overview you via the process of adding analytics for your portal.

Web content
  • Why Utilise Umami for Security Places Analytics
  • Soliciting Docker and Docker Write for Umami
  • Mounting Umami
  • Curing Umami via an SSL Overturn Proxy
  • Adding Umami Analytics to Your Web site

Why Utilise Umami for Security Places Analytics

One of the greatest selling times of Umami is that it’s a portal analytics software agenda that anonymizes all documents about its users. This executes Umami annoyingly eye-catching to webmasters that pine to stare at their portal’s productivity without jeopardizing the privacy of their readers.

A screenshot showing sample analytics documents on the Umami control panel.

Another component to earn serviceability of Umami is that it’s GDPR-certified and it doesn’t rely on cookies to track a user’s session. As such, you wear’t have to transaction any kind of supplementary decide-in banners for your readers, obtaining your portal smoother and less complicated to navigate.

Lastly, Umami is flawlessly save of penalty and it doesn’t thieve the majority of mechanism resources to sprinted sufficiently. This approaches that you can enfranchisement Umami on your existing web server and gain save analytics for your sites.

Soliciting Docker and Docker Write for Umami

The initially interfere self-hosting your extremely own analytics via Umami is to attain both Docker and Docker Write for your Linux contraption. To do that, fetch the wrapping up secret from the Docker job’s portal:

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

Tab: This section concentrates on placing Docker for Ubuntu. If you’re obtaining earn serviceability of of a unalike distro investigate out our general overview to placing Docker on Linux.

Model a brand-newfangled repository document under “/and so on/apt/resources.listing.d/” obtaining earn serviceability of of your favorite message editor:

sudo nano /etc/apt/sources.list.d/docker.list

Paste the complying via spiel up of code within your brand-newfangled repository document:

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable

Render sure that your mechanism is flawlessly up-to-day and working duly:

sudo apt update && sudo apt upgrade

Mount Docker, Docker Write, and the supplementary dependences for Umami:

sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin nginx git

Mounting Umami

Navigate to your user account’s dwelling brochure, after that pull the Umami Git repository from the developer’s Github web page:

cd ~ && git clone https://github.com/umami-software/umami.git

Go within the Umami Git repository, after that open the prebuilt Docker Write document obtaining earn serviceability of of your favorite message editor:

cd ~/umami nano ./docker-compose.yml

Scroll down to the “feel:” style, after that replace the payoff of the APP_SECRET variable via a arbitrary string of temperaments.

A terminal underscoring the arbitrary string of message asserting as the app pivot for Umami.

Tab: You can accumulate your extremely own arbitrary string of letters and digits by sprinting: cat /dev/urandom | tr -dc 'A-Za-z0-9' | fold -w 32 | head -n 1.

Preserve your Docker Write document, after that sprinted the complying via command to design and enfranchisement the Umami cylinder:

sudo docker compose up -d

Agenda that your Umami instance is sprinting by listing the obtainable Docker Cans in your mechanism:

docker ps
A terminal underscoring the 2 Umami cyndrical tubes sprinting on the Ubuntu web server.

Good to recognize: find out how to oversee your Linux web servers and Docker cyndrical tubes via XPipe.

Curing Umami via an SSL Overturn Proxy

At this juncture, you now have a self-host Umami analytics instance sprinting on connector 3000 in your Linux mechanism. In edict to access this solution over the net, yet, you have to establish it initially via an SSL reverse proxy.

Prelude by adding a brand-newfangled “A” DNS record to your domain name registrar endeavoring to the IPv4 address of your Umami web server. In my shell, I will certainly kit my “A” record to “umami.myreallygreatserver.xyz.”

A screenshot showing the IPv4 address attributed via the umami subdomain.

Inspect if the “core” snap package is already in your web server:

sudo snap install core

Mount the Certbot snap package from the Electronic Frontier Cornerstone (EFF):

sudo snap install certbot --classic

Model a brand-newfangled website arrangement document for your SSL reverse proxy:

sudo nano /etc/nginx/sites-available/umami

Paste the complying via block of code within your brand-newfangled website config document:

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 payoff of the “server_name” variable via your domain name tag.

A terminal showing the habit subdomain within the Nginx reverse proxy config.

Preserve your brand-newfangled website config document, after that accumulate a symbolic affiliation to “/and so on/nginx/discolorations-permitted:”

sudo ln -s /etc/nginx/sites-available/umami /etc/nginx/sites-enabled/

Inspect your Nginx config documents for disadvantageous movings, after that sprinted systemctl to prelude your reverse proxy:

nginx -t<br>sudo systemctl reload nginx.service

Enroll your Umami web server to the EFF:

sudo certbot register --agree-tos -m YOUR@EMAIL.ADDRESS

Sprinted the complying via command to accumulate your website’s SSL certificate:

sudo certbot --nginx -d SUBDOMAIN.YOUR-ROOT.DOMAIN

Agenda that your Umami instance is working sufficiently by opening a net browser and surfing to your subdomain.

A screenshot underscoring the address nightclub for the Umami instance.

Adding Umami Analytics to Your Web site

By default, Umami kits your default username to “admin” and your password to “umami.” This can be annoyingly insecure and it is advisable to readjust it on the initially login.

To reconciling this, click the user symbol on the control panel’s upper right edge.

A screenshot showing the enfranchisement of the profile image symbol on the Umami control panel.

Click the Profile affiliation on the miniscule pop-up menu.

A screenshot showing the enfranchisement of the "Profile" menu thing in the Umami control panel.

Click the Adjust Password switch under the Password style.

A screenshot showing the enfranchisement of the "Adjust password" switch within the Profile supervise.

Kind “umami” on the Current Password textbox, after that transaction your brand-newfangled password on both the Neoteric Password and Agenda Password textboxes.

A screenshot showing the filled password textboxes.

Click Preserve to use your brand-newfangled password, after that choose Dashboard to readjust to Umami’s sizeable supervise.

Adding a Web site to Track in Umami

To contain a brand-newfangled portal to your Umami instance, click the Placements affiliation on the web page’s elevation navigation nightclub.

A screenshot underscoring the enfranchisement of the "Placements" menu on the Umami control panel.

Click the Consist of Web site switch on the web page’s right side.

A screenshot showing the enfranchisement of the "Consist of portal" switch within the Umami Placements supervise.

Executing this will certainly carry up a miniscule window whereby you can transaction the tag and the address of your portal. In my shell, I will certainly transaction “Web site” for the tag and “net.myreallygreatserver.xyz” for the domain name.

A screenshot showing the portal information for the Umami instance.

Click Preserve to tote out your readjusts, after that click Modify on your portal’s portal.

A screenshot showing the enfranchisement of the "Modify" switch within the Placements supervise.

Participate in the Security Code tab, after that photocopy the HTML fragment to your clipboard.

A screenshot showing the HTML code fragment for surveillance documents.

In your portal, paste the HTML fragment within the section of your document. You have to enfranchisement the surveillance code in every web page that you pine to track.

Agenda that Umami is now sufficiently surveillance your portal’s analytics by witnessing your portal, after that opening your Umami’s control panel web page.

A screenshot showing sample analytics documents on Umami.

Umami is not the lone save analytical software agenda you can earn serviceability of. Inspect out some of the most secure Google Analytics options here.

Image credit: Myriam Jessier via Unsplash. With one voice alterations and screenshots by Ramces Red.

Related Posts