Skip to main content

How to self-host Matomo

ยท 2 min read
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

How to self-host Matomo

Matomo is a GDPR-compliant tracking tool for your website. I've finally decided to install it so that I can get the blog's traffic figures; find out which articles are the most widely read, which topics are of most interest, etc., not just out of curiosity but also to get a better idea of the audience.

I've chosen for the self-hosted solution (because it's free) and like that my traffic figures remains on my own server.

The installation is a piece of cake: download a zip file, unzip and start the wizard. Really easy.

There is a nice tutorial on

On my side, here the actions I've done:

  1. Create a subdomain and pointing to a specific folder on my host.
  2. Create a SSL certificate for the sub-domain.
  3. Connect on that new folder using SSH
    1. Run wget to download the latest version
    2. Run unzip -o to unzip and get files
    3. Run rm -f "How to install Matomo" to remove two unneeded files

Since I know I should have a MySQL database, I went to my dashboard. For PlanetHoster, it's and there, I create a new MySQL db and his user.

Finally, I just need to start the wizard on and follow the guide.

The wizard is really well done and very easy to follow.

When done, I get my dashboard on and I just need to add my tracking script to my pages as explained in the wizard.


On this blog, I'm using Docusaurus so I've installed a plugin for this: