Help Center/ Huawei Cloud Flexus_Huawei Cloud Flexus L Instance/ Best Practices/ Setting Up a Website/ Using Matomo to Build a Website Traffic Statistics System
Updated on 2026-08-27 GMT+08:00

Using Matomo to Build a Website Traffic Statistics System

Scenarios

Matomo is a powerful open-source network analysis platform that has full data ownership and ensures that the business complies with General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA). FlexusL provides a Matomo application image running on Ubuntu 24.04 and deployed with Docker. The image comes pre-installed with Nginx, MySQL, phpMyAdmin, and Docker. You can use this application image to analyze website data.

If your Matomo application image was purchased before August 28, 2026, see Using Matomo to Build a Website Traffic Statistics System (Historical Version) for instructions.

Resource Planning and Costs

Resource

Configuration

Description

Cloud server

  • vCPUs: 2
  • Memory: 2 GiB

Select appropriate instance specifications based on your service requirements.

Image

Matomo

Select the Matomo application image.

Network

EIP

By default, a fixed EIP and a fixed private IP address are assigned to a FlexusL instance.

Security group

Inbound rule:

  • Protocol/Application: TCP
  • Port: 80
  • Source: 0.0.0.0/0

80: Allows HTTP access to the website.

Procedure

Step

Description

Step 1: Purchase a FlexusL Instance

Purchase a FlexusL instance and select the Matomo application image.

Step 2: Configure Security Groups

Add inbound security group rules to ensure that the application pre-installed in the image can be accessed.

Step 3: Reset the Password and Log In to the FlexusL Instance

A FlexusL instance does not have an initial password. After creating a FlexusL instance, set a password for the FlexusL instance before logging in to it.

Step 4: Initialize Matomo

Install and initialize Matomo.

Step 5: Use Matomo to Monitor Websites

Add tracking code to the websites you want to monitor.

Step 1: Purchase a FlexusL Instance

  1. Log in to the FlexusL console and click Buy FlexusL.
  2. Specify required parameters for the FlexusL instance.

    Parameter

    Example Value

    Description

    Region

    CN-Hong Kong

    For low network latency and quick resource access, select the region nearest to your target users. After a FlexusL instance is created, the region cannot be changed. Exercise caution when selecting a region.

    Application Images

    Matomo

    Select the Matomo application image.

    Instance Specifications

    2 vCPUs | 2 GiB of memory and 60 GiB of the system disk

    Select instance specifications as needed.

    Instance Name

    Matomo-Example

    Customize an instance name that is easy to identify, for example, Matomo-Example.

    (Optional) Associated Services

    • Data Disk: 10 GiB
    • Host Security
    • Cloud Backup Vault: 70 GB

    You can bundle any of EVS, HSS (basic edition), and CBR to your FlexusL instances as needed and set specifications as needed.

    Required Duration

    1 month

    Set the required duration.

    FlexusL supports auto-renewal. Once enabled, FlexusL instances automatically renew before they expire. If you do not enable auto-renewal during purchase, you can still enable it after your FlexusL instances are created. For more information about auto-renewal rules, see Auto-Renewal Rules.

    Quantity

    1

    Set the number of FlexusL instances to be purchased.

  3. Click Next: Confirm.

    On the displayed page, confirm the order details, read and select the agreement, and click Submit.

  4. Select a payment method and complete the payment.
  5. Go back to the FlexusL console and view the purchased FlexusL instance.

Step 2: Configure Security Groups

Add inbound security group rules to ensure that the application pre-installed in the image can be accessed.

  1. Log in to the FlexusL console and click the target resource card or instance name to go to the instance details page.
  2. In the navigation pane on the left, choose Cloud Servers and click the target server name to view its details.

  3. On the Security Groups tab, click Add Rule to add the rules listed in the following table.

    The following only lists common rules. You can add more rules as needed.

    Table 1 Security group rules

    Priority

    Action

    Type

    Protocol & Port

    Source

    Description

    1

    Allow

    IPv4

    TCP: 80

    0.0.0.0/0

    Allows HTTP access to the application dashboard.

Step 3: Reset the Password and Log In to the FlexusL Instance

This section describes how to log in to a FlexusL instance. A FlexusL instance does not have an initial password. After creating a FlexusL instance, set a password for the FlexusL instance before logging in to it.

  1. In the Image area on the Overview page of the FlexusL console, click Access to go to the application dashboard and check whether the application has been up and running. If yes, go to the next step.

    Wait for several minutes until the application is up and running. Then, you can perform operations such as restarting or stopping the instance, or resetting the password. Otherwise, the initial password may become invalid and you cannot log in to the application dashboard.

    Figure 1 Access to the application dashboard

    After the application is started, the initialization wizard page of the dashboard is displayed.

    Figure 2 Initialization wizard page of the Matomo dashboard

    If the dashboard is not properly displayed, check the following causes:

    • The port for accessing the dashboard is not enabled. Enable it as needed.
    • The dashboard is being started. Try again later.
  2. Locate the resource card and choose > Reset Password. Alternatively, in the list view, click Reset Password in the Operation column to reset the password for the FlexusL instance.

    A FlexusL instance does not have an initial password. Set a password for the FlexusL instance before logging in to it. For details, see Resetting the Password for a FlexusL Instance.

    Figure 3 Resetting a password
  3. Locate the resource card and click Remote Login. Alternatively, in the list view, click Remote Login in the Operation column. In the displayed dialog box, click VNC Login and enter the username and password as prompted to log in to the FlexusL instance. For more login methods, see Login Modes.

    The username is root, and the password is the one you set in the previous step.

Step 4: Initialize Matomo

Application images use code-based Ubuntu. They provide graphical user interfaces to make your operations easier. You need to initialize the application dashboard upon the first login. Then you can directly log in to the dashboard from the FlexusL console afterwards.

  1. On the Overview page, click Access in the Dashboard field in the Image area.

    If the dashboard is not properly displayed, check the following causes:

    • The port for accessing the dashboard is not enabled. Enable it as needed.
    • The dashboard is being started. Try again later.
  2. Click NEXT.
    Figure 4 Initialization wizard page of the Matomo dashboard
  3. Wait until Matomo completes the system check and click NEXT.

    Matomo automatically checks whether the server meets the requirements for installing Matomo and displays the check result for each item.

  4. Set up the MySQL database and click NEXT.

    Matomo comes with MySQL pre-installed and a default database account already configured. The database account information is automatically obtained. Retain the default settings and click NEXT.

  5. After Matomo automatically creates data tables, click NEXT.
  6. On the Superuser page, set the username, password, and email address of the Matomo administrator, and click NEXT.

    The superuser is the user that you created when you installed Matomo. Each Matomo has only one superuser who has the highest permissions. Keep the username and password of the superuser secure.

  7. On the Set up a Website page, add the name and URL of the first website you want to track and analyze with Matomo and click NEXT.

    You can add more websites to track later.

  8. Learn about the JavaScript tracking code and click NEXT.

    To track your web traffic with Matomo, you need to make sure that some extra code is added to each of your webpages. Matomo automatically generates a JavaScript tracking code. After the installation is complete, you can check the tracking code in the Tracking Code admin section.

  9. After the initialization configurations are complete, click Continue to Matomo.
  10. Enter the username and password of the superuser and click SIGN IN.

After the Matomo application is initialized, you can monitor websites on the application dashboard.

Step 5: Use Matomo to Monitor Websites

  1. On the dashboard, click the TRACKING CODE tab and copy the tracking code in the Tracking Code area.

  2. Copy the tracking code to each page of the website you want to monitor.

    Matomo can collect real-time analysis data of the website with the tracking code.

    For details about how to install the Matomo tracking code, see the official documentation.

  3. Select All Websites to view the access to the monitored websites.