Matomo - Getting Started Guide
Matomo is an open-source web analytics platform and a privacy-focused alternative to Google Analytics. It gives you full ownership of your analytics data - everything is stored on your server, not shared with third parties. Use Matomo to track website visitors, analyze traffic sources, measure conversions and understand user behavior.
Step 1 - Verify Matomo Works
Your server's IP address and root password are shown on the Server Details page in your client panel. Open your browser and go to:
http://your.server.ip
You should see the Matomo setup wizard welcome page. If the page loads, Matomo is working correctly - continue to Step 2 to collect database credentials before completing the wizard.
If you placed the server behind a VyOS router on a private network, set up port forwarding for ports 22 (SSH), 80 (HTTP) and 443 (HTTPS). Matomo must be reachable from the internet to receive tracking data from your websites.
Step 2 - Get Database Credentials
The database for Matomo is already created on your server. Connect via SSH to see the credentials:
ssh root@your.server.ip
Upon login, you will see a welcome message with the database credentials:
=== Matomo Web Analytics ===
Open http://your.server.ip to complete setup wizard
Database credentials for setup wizard:
Server: localhost
Login: matomo
Password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Database: matomo
Prefix: matomo_
Save these credentials - you will need them in the next step.
Step 3 - Complete the Setup Wizard
Return to the Matomo setup wizard in your browser. The wizard will guide you through the initial configuration:
System Check
Matomo verifies that all requirements are met. You may see an SSL warning - this is normal, SSL can be configured later. Click Next.
Database Setup
Enter the following connection details:
| Database Server | localhost |
| Login | matomo |
| Password | the password from the welcome message (Step 2) |
| Database Name | matomo |
| Table Prefix | matomo_ |
Creating the Tables
Matomo will create the necessary database tables automatically. Click Next.
Super User
Create your administrator account - enter a login, password and email. These are your credentials for logging in to Matomo.
Set Up a Website
Add your first website to track - enter the site name and URL. You can add more websites later.
Tracking Code
Matomo will show you a JavaScript tracking code snippet. Copy it and paste it before the closing </head> tag on every page of the website you want to track. You can also do this later from the Matomo dashboard.
Congratulations
Setup is complete. Click Continue to Matomo and log in with the super user credentials you just created.
Step 4 - Configure Domain and SSL (Optional)
To use Matomo with your own domain and HTTPS:
- Create an A record in your DNS settings pointing your domain to the server IP
- Wait for DNS propagation (usually a few minutes to a few hours)
- Connect via SSH and run Certbot to obtain a free Let's Encrypt SSL certificate:
certbot --apache -d your-domain.com
Certbot will automatically configure Apache for HTTPS and set up certificate auto-renewal.
After obtaining the certificate, add your domain to the Matomo trusted hosts list: go to Administration → System → General Settings → Trusted Matomo hostname.
Post-Installation
Fail2Ban - Brute-Force Protection
Your server comes with Fail2Ban pre-configured to protect SSH from brute-force attacks.
| Rule | Max Attempts | Ban Duration |
|---|---|---|
| SSH | 5 failed logins | 10 minutes |
Useful commands:
# Check banned IPs
fail2ban-client status sshd
# Unban an IP
fail2ban-client set sshd unbanip 1.2.3.4
If you accidentally lock yourself out, connect via VNC console in your client panel and unban your IP.
Service Management
# Check service status
systemctl status apache2
systemctl status mysql
# Restart services
systemctl restart apache2
systemctl restart mysql
# Apache error log
tail -f /var/log/apache2/error.log
Adding More Websites
You can track multiple websites from a single Matomo instance. Go to Administration → Measurables → Manage → Add a new measurable to add additional sites. Each website gets its own tracking code and separate analytics data.
Managing Users
To add team members with different access levels:
- Go to Administration → System → Users
- Click Add a new user
- Set username, email and password
- Assign permissions: View, Write, Admin or Super User per website
Updates
Matomo shows update notifications in the admin dashboard. To update:
- Go to Administration → Platform → Marketplace
- If a core update is available, follow the on-screen instructions
To update system packages via SSH:
apt update && apt upgrade -y
Backups
To create a manual backup of your Matomo database:
mysqldump -u root matomo > /root/matomo-backup-$(date +%F).sql
The Matomo configuration file is located at /var/www/html/config/config.ini.php. Include it in your backups.
Software Included
| Component | Version |
|---|---|
| Ubuntu | 24.04 LTS |
| Matomo | Latest |
| Apache | 2.4 |
| MySQL | 8.0 |
| PHP | 8.3 |
| Certbot | Latest |
| Fail2Ban | 1.0.2 |
Troubleshooting
| Problem | Solution |
|---|---|
| Cannot access Matomo in browser | Check Apache status: systemctl status apache2. Restart if needed: systemctl restart apache2 |
| Forgot Matomo admin password | Reset via CLI: php /var/www/html/console user:reset-password --login=admin |
| SSL certificate not working | Verify DNS points to your server IP: dig your-domain.com. Re-run: certbot --apache -d your-domain.com |
| Tracking code not recording visits | Ensure the tracking snippet is placed before </head>. Check that the Matomo URL in the snippet matches your server address. Disable ad blockers for testing. |
| Database connection error | Check MySQL status: systemctl status mysql. Restart if needed: systemctl restart mysql |
| Blocked by Fail2Ban | Use VNC console in your client panel to unban your IP |
| Forgot root password | Use the VNC console in your client panel to reset it |