Matomo is a versatile, open-source web analytics platform that provides comprehensive insights into website traffic and visitor behavior. It helps businesses and website owners track user interactions, conversion rates, and page performance while maintaining control over their data. Unlike proprietary services like Google Analytics, Matomo prioritizes data privacy and security, ensuring compliance with privacy regulations like GDPR. It’s useful for understanding user engagement, optimizing marketing efforts, and improving user experience. Matomo can be customized for individual or business needs, offering real-time analytics, heatmaps, and e-commerce tracking.
Step 1: Access the Dashboard
- Log in to your Shape.Host account and navigate to your Dashboard.
- Click the Create button located in the top-right corner.
- From the dropdown menu, select “Instances” to create a new cloud server.
Step 2: Select Location
- You will be prompted to select a data center location for your instance.
- Choose the location closest to your audience for optimal performance.
Step 3: Choose a Plan
- Scroll through the available pricing plans.
- Choose between Standard, CPU-Optimized, or Memory-Optimized based on your needs.
Step 4: Choose an Image
- Select the operating system for your instance, such as Debian 12.
Step 5: Authentication and Finalize
- Choose your authentication method, either via SSH keys or password.
- Set any additional configurations like hostname.
- Once ready, click Create Instance.
Step 6: Obtain IP Address
- Once your instance is created, return to the dashboard.
- Find your instance’s IP address under the Resources section and use it to access your server.
To connect to your instance on Shape.Host, follow these steps:
- Get the Instance IP: After creating your instance, find the public IP address in the Shape.Host dashboard under Resources.
- Open SSH Client: Use an SSH client like Terminal (Linux/macOS) or PuTTY (Windows).
- SSH into the Instance: Run the following command in your terminal:
ssh root@<your-instance-ip>
Replace <your-instance-ip>
with your actual instance IP address.
- Enter the Password: If prompted, enter your instance’s root password or use your SSH key if configured.
You are now connected to your instance!
Step 7: Update System and Install Required Packages
Run the following commands to update your system and install required packages:
apt update -y
apt install apache2 mariadb-server php php-cli libapache2-mod-php php-common php-curl php-gd php-mbstring php-mysql php-xml php-intl php-zip wget unzip -y
Step 8: Start and Enable Apache and MariaDB
Make sure Apache and MariaDB services are running and enabled:
systemctl is-enabled mariadb
systemctl status mariadb
systemctl is-enabled apache2
systemctl status apache2
Step 9: Check PHP Version
Verify PHP installation with the following command:
php -v
Step 10: Configure PHP Settings
Edit the php.ini
file for PHP configuration:
nano /etc/php/8.2/apache2/php.ini
Update the following settings:
date.timezone = Europe/Stockholm
memory_limit = 256M
upload_max_filesize = 16M
max_execution_time = 300
Restart Apache:
systemctl restart apache2
Step 11: Secure MariaDB
Run the secure installation script to enhance security:
mariadb-secure-installation
Step 12: Create Matomo Database
Log into MariaDB and create a database for Matomo:
mariadb -u root -p
Execute the following SQL queries:
CREATE DATABASE matomo;
CREATE USER 'matomo'@'localhost' IDENTIFIED BY 'p4ssword';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON matomo.* TO 'matomo'@'localhost';
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'matomo'@'localhost';
quit
Step 13: Download and Extract Matomo
Change to the /var/www/
directory and download Matomo:
cd /var/www/
wget https://builds.matomo.org/matomo.zip
unzip matomo.zip
Set the correct permissions:
chown -R www-data:www-data /var/www/matomo
Step 14: Configure Apache for Matomo
Create an Apache virtual host configuration file:
nano /etc/apache2/sites-available/matomo.conf
Add the following configuration, making sure to adjust the domain:
<VirtualHost *:80>
ServerAdmin contact@shape.hsot
ServerName debian.shape.host
DocumentRoot /var/www/matomo/
<Directory /var/www/matomo>
DirectoryIndex index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Files "console">
Options None
Require all denied
</Files>
<Directory /var/www/matomo/misc/user>
Options None
Require all granted
</Directory>
<Directory /var/www/matomo/misc>
Options None
Require all denied
</Directory>
<Directory /var/www/matomo/vendor>
Options None
Require all denied
</Directory>
ErrorLog ${APACHE_LOG_DIR}/matomo_error.log
CustomLog ${APACHE_LOG_DIR}/matomo_access.log combined
</VirtualHost>
Step 15: Enable Apache Site
Enable the Matomo site and restart Apache:
a2ensite matomo.conf
apachectl configtest
systemctl restart apache2
Step 16: Install SSL Certificates
Install Certbot and secure the site with SSL:
apt install certbot python3-certbot-apache
certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email contact@shape.host -d debian.shape.host
Step 17: Access Matomo in the Browser
Finally, visit https://debian.shape.host/
to complete the Matomo installation via the web interface.
On the System Check section, ensure your system is ready and click Next again.
Now input the details, including the MariaDB database name, user, and password, and then click Next to migrate the database.
Once migrated, click Next again.
Enter a new administrator username, email address, and password for Matomo web analytics.
Now enter information to create the first tracking with Matomo and click Next.
Copy the generated tracking code and click Next.
After the installation is complete, you’ll see the following messages:
If you visit the Matomo home page, you’ll be redirected to the matomo login page. Enter your admin user, and password, and click SIGN IN.
After logging in, you’ll see the following Matomo administration dashboard:
For optimal performance and security when hosting Matomo, consider using Shape.Host’s Linux SSD VPS services for reliable and fast server hosting.