Matomo 5

One-Click Installation

Matomo 5 Initialization:

Overview:

This guide will walk you through initializing Matomo 5 on your AWS instance in just one click. The setup process is streamlined using our custom script, designed for ease of use and efficiency. Before starting the script, ensure the minimum requirement is met.

Pro Tip: We recommend associating an AWS Elastic IP with your instance before running the setup. This prevents your IP address from changing when the instance is stopped and restarted.

Step 1: Access Your AWS Instance

1. Launch Your AWS EC2 Instance:

  • Choose your desired AWS EC2 instance type. (Recommended: t3a.small / t3.small)
  • Once the instance is running, connect to it via SSH.

2. Connect to the Instance:

  • Open your terminal (Mac/Linux) or use an SSH client (e.g., PuTTY for Windows).
  • Run the following SSH command:
ssh ec2-user@<your-aws-public-ip>
  • When prompted for the login, enter:
[ec2-user@…]$ sudo -i

3. Run the Initialization Script:

  • To initiate the installation, run the following command:
[root@…]$ /usr/local/bin/egl_init.sh.x
  • Note: This script automates the entire installation process. While it runs, ensure your terminal remains active, and do not close the session.

Step 2: Instance Set Up and Installation 

1. Completion Confirmation:

  • Once the installation is finished, you will see a summary on the screen that includes all credentials.

 

2. Access the Web Interface:

  • Open your web browser and navigate to:
http://<your-public-ip>
  • You will be greeted by the welcome screen.

 

Step 3: Finalizing Installation  

1. Welcome Screen

  • Click Next to proceed to system check.

2. System Check

  • Hit Next since critical errors has been cleared by our initialization script. (You may ignore the optional warnings  “Forced SSL Connection” and “PHP SAPI” for now.)

3. Database Setup:

  • Get the database credentials from the summary of initialization script earlier and enter here.
  • Ensure “MariaDB” is selected as the Database Engine. Leave the rest as its default values.
  • Enter Next to start the set up.
  • You will see the green screen “Tables created“, when the database is setup successfully.
  • Enter Next again.

3. Administrator Account (SuperUser):

  • Fill up the Administrator (superuser) form.
  • You will use these credentials to access Matomo later.
  • Enter Next when it is done.

 

4. Set up a Website:

  • Fill up the website form accordingly.
  • We strongly recommend to use AWS IP for the “Website URL” field like http://<your-aws-public-ip>/ 
  • Note: It is http:// and not https://.

5. Login to Matomo:

  • Enter Next at the “Tracking code for Any Website” screen.
  • And the final “Congratulations” screen is waiting for you.

  • Enter “Continue to Matomo” to login.
  • Use the credential you created in the SuperUser section to log into Matomo.
  • Once logged in, get ready for the final touch up’s.

 

Step 4: Post Installation – Recommended by Matomo

1. Start the CRON

  • Open your terminal (Mac/Linux) or use an SSH client (e.g., PuTTY for Windows).
  • While our initialization script has already set up CRON, you will need to initiate the job and change to your preferred email address.
  • Run the following command to change email address for the report. Replace the [email protected] with the actual email address.
sudo sed -i 's/^MAILTO="[^"]*"/MAILTO="[email protected]"/' /etc/cron.d/matomo-archive
  • After that, run this command to start the CRON job:
/usr/bin/php /var/www/matomo/console core:archive --url=http://your-public-ip/
sudo systemctl restart httpd
  • To check whether you have entered the correct email address. Run commands below at the terminal or SSH client:
nano /etc/cron.d/matomo-archive
  • After making the necessary changes, save the file by pressing Ctrl + O, then press Enter to confirm. Exit the editor by pressing Ctrl + X.

 

2. Disable Archiving for Performance

  • Log into Matomo at http://<your-aws-public-ip>/
  • Go to Admistration, click Gear icon on the top right corner of the sreen.
  • Select System > General Settings on the left panel.
  • Set “Archive reports when viewed from the browser” to No
  • Set “Archive reports at most every X seconds” to 3600
  • Hit the “Save” button

 

  • Now, your Matomo system is ready for medium to high traffic handling.
  • You may follow this link to associate a domain with your IP. address.
  • Use Let’s Encrypt to set up SSL and https:// when you have the domain associated.

Important Notes:

Required Private Directories False Alarm:

To resolve occasional false alerts for the critical issue related to the tmp/cache/tracker/matomocache_general.php file, you can safely delete this cache file.
Afterward, restart Apache to ensure any changes take effect.

sudo rm /var/www/matomo/tmp/cache/tracker/matomocache_general.php
sudo systemctl restart httpd

This should clear the alert. If the file reappears without issues, it’s simply Matomo regenerating its cache, which is expected behavior.

 

Mail Sending Blockage:

AWS may have email-sending restrictions in place by default. If you wish to use AWS as SMTP server for email campaigns or sending, submit a request to AWS to lift the restriction on outbound email traffic.

CONTENTS