How to install Umami on Linux
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.
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 repository 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 that 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 APP_SECRET variable 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 variable 'server_name' with your domain name.
Save the new site configuration file, then create a symbol link to '/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.
You should read it
- 5 reasons to install Linux on old computers
- How to install Kali Linux on macOS
- How to install NVIDIA drivers on Kali Linux
- Steps to install Webex for Linux
- How to install Kali Linux on Android using Linux Deploy
- How to install Windows Game on Linux with Winepak
- Instructions for installing basic Arch Linux
- How to install Kali Linux on your computer
May be interested
- How to install Spotify on Linuxspotify has actually supported linux for a long time. although most distributions do not include this application in the repository for license reasons, it is not really difficult to install this official player on a linux pc.
- How to Install VirtualBox on Linuxsetting up a virtual machine can be a great way to test alternative software or operating systems on a computer without altering or putting the existing system at risk.
- How to install Deepin Linuxdeepin linux is an excellent distribution. so why not experience it on your computer? deepin has a variety of high-quality layouts / interfaces and great software.
- How to Install Asahi Linux on an Apple Silicon Macasahi linux is a project to port the linux kernel and related software to macs powered by apple silicon. it is still under development, but it has made significant progress in a short period of time.
- How to install and use TeamViewer on Linuxteamviewer is a powerful tool that allows teams to collaborate and share their screens in real time. it is also extremely useful in remote technology support.
- How to Install Linuxlinux is the foundation of thousands of open source operating systems designed to replace windows and mac os. linux allows users to download and install it for free on any computer. because this is an open source platform, the number of available versions or distributions is very diverse and is developed by many different organizations. follow the basic instructions below to install all linux versions, especially some of the most popular distributions.
- Should I install Arch Linux?arch linux is one of the most popular linux operating systems. arch linux is even easier to install than arch-based distributions like manjaro and antergos.
- How to install Handbrake on Linuxhandbrake is a powerful open source tool for encoding and editing videos. it includes a graphical control panel to manage encryption and even preview the results.
- How is Arch Linux different from other Linux versions?arch linux is arguably the most misunderstood linux distribution. many people find arch difficult to install and maintain.
- How to install and remove fonts on Linuxthe linux system has many integrated fonts but you still can't find the font you need. downloading and installing new fonts is very easy on linux and we will show you how to do this in the following article.