How to Install Matomo on Debian 11
Matomo (formerly known as Piwik) is an open-source analytics platform that lets you track visitors to your website or app with ease. It offers advanced reporting, visitor segmentation, and even personalization for your visitors. In this tutorial, we’ll be walking you through the process of installing Matomo on a Debian 11 server.
Prerequisites
Before you being, you’ll need the following prerequisites installed on your server:
- Apache or Nginx web server
- MySQL, MariaDB, or Postgresql Database
- PHP 7.3 or newer
- A domain name that resolves to your server IP
Step 1 – Download Matomo
First, we’ll need to download the Matomo files to your server. You can do this by downloading the latest version of Matomo from the Matomo website.
Once the download is complete, you will need to extract the files. You can do this by running the following command:
“`
tar -xzvf matomo-x.x.x.tar.gz
“`
Step 2 – Setup Database
Once you have extracted the files, you will need to create a database for Matomo to use. You can do this using your preferred database (MySQL, MariaDB, Postgresql) with the following command:
“`
CREATE DATABASE matomo;
“`
Step 3 – Configure Matomo
Now that your database is setup, you will need to configure Matomo to work with it. You can do this by running the following command from the Matomo directory:
“`
php setup/index.php
“`
This will open the Matomo setup wizard. Follow the on-screen instructions to configure your database and get Matomo up and running.
Step 4 – Setup Apache/Nginx
Once you have completed the setup, you will need to configure your Apache/Nginx webserver. You can do this by creating a new virtual host file. For example, if you are using Apache you can create the file in /etc/apache2/sites-available.
Step 5 – Access Matomo
Finally, you will be able to access your Matomo dashboard. Go to your configured website URL and you will be greeted with an authentication prompt. Enter your admin username and password to log in.
And that’s it! You now have Matomo installed and running on your Debian 11 server.