How to Install Umami Web Analytics on Ubuntu 20.04
Self-hosted open-source, Umami Web Analytics is an alternative to Google Analytics. It is an easy-to-use, self-hosted web analytics tool. The main objective of this tool is to provide you with a more user-friendly, privacy-protected solution. All metrics are displayed on one page and only the ones you care about.
If you do not already have a VPSie account, you will need to create one in order to register Ubuntu systems.
Now open your terminal and run the following commands to update your system.
# apt-get update && apt-get upgrade -y
So let’s start the installation process:
Step 1: Install NVM and Node.JS
Install the NVM with the following command:
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Reload your ~/.bashrc to activate NVM after installation.
# source ~/.bashrc
Verify the version:
# nvm -v
Now install the Node.js using the following command:
# nvm install node
Verify the version:
# node -v
Step 2: Install Umami Packages
Run the following commands to clone the umami repository and install the packages:
# git clone https://github.com/mikecao/umami.git
Navigate to Umami folder:
# cd umami
Now install it:
# npm install
Step 3: Install MariaDB
Use the following command to install MariaDB database:
# sudo apt install mariadb-server -y
Run the following commands in mysql terminal to create a database for umami(change the credentials with your options):
# sudo mysql
> create database umami1; > grant all privileges on umami1.* to 'umami'@'localhost' identified by '12345'; > flush privileges; > exit
Import the database structure for Umami by running the command below:
# mysql -u umami -p umami1 < sql/schema.mysql.sql
Enter the password you chose for the umamidb user when prompted.
The next step is to create a .env configuration file and open it with any text editor:
# nano .env
Now enter the database connection configuration details and hash salt:
DATABASE_URL=mysql://umami:12345@localhost:3306/umami1 HASH_SALT=randomstring
Save the file and exit.
Step 4: Build and Start
Run the following command build:
# npm run build
Now start the Umami:
# npm start
It process is done, The default port is 3000. Access http://{YOUR-SERVER-IP}:3000 or http://localhost:3000.
The default login credential is admin/umami.
Currently there are no website configured on Umami, you can configure it anytime.
The server can be stopped by pressing CTRL+C. Changing the port number(for eg: 3010) can be achieved using the following command:
# npx next start -p 3010
Additionally, you can also add SSL/TLS certificates and reverse proxy for this server. That session will not be covered here, but you should check it out.
That’s it, the Umami Web Analytics are successfully running. Hope this article was helpful to you.
FAQ
Umami is a self-hosted, open-source web analytics platform that provides insights into your website’s traffic, user behavior, and performance. It is designed to be fast, lightweight, and easy to use, with a modern and customizable interface.
To install Umami on Ubuntu, you can use a package manager like Snap or manually download and install the software. If you’re using Snap, you can run the command “sudo snap install umami” to install the latest version. If you prefer to install it manually, you have to download the source code from the official Umami website and follow the installation instructions.
Umami requires a web server (such as Apache or Nginx), PHP 7.3 or later, and a MySQL or PostgreSQL database. It is recommended to have at least 512MB of RAM and a dual-core processor for optimal performance.
After installation, you can access Umami using a web browser and follow the setup wizard to configure the software. You’ll need to create an admin account, connect to a database, and customize the settings to suit your needs.
Yes, Umami provides a range of customization options, including themes, logos, and color schemes. You can also modify the CSS and HTML code directly to create a completely custom interface.
Umami is designed with user privacy and security in mind. It uses modern web technologies like LocalStorage and does not rely on cookies or third-party tracking scripts. It also allows you to control which data is collected and stored and provides options to anonymize user data and IP addresses.
Umami provides a range of built-in reports and dashboards to help you visualize your website’s data, including traffic, referrers, devices, and goals. You can also create custom reports and dashboards using the intuitive drag-and-drop interface.
Yes, Umami provides a REST API that allows you to integrate with other tools and platforms, such as marketing automation software, CRM systems, and content management systems. You can also use third-party plugins and extensions to extend the functionality of Umami.