Skip to main content

How to self-host Matomo

Self-host Matomo for free and gain GDPR-compliant website analytics. This simple guide covers installation, database setup, and Docusaurus integration.

· 2 min read
View raw
Christophe
Markdown, WSL and Docker lover ~ Insatiable curious.
Cet article existe aussi en français — lire la version française.

This article is over a year old but was reviewed on July 30, 2026 — the content is still accurate.

How to self-host Matomo

⚡
TL;DR

This article walks through self-hosting Matomo, a GDPR-compliant web analytics tool, on a subdomain: downloading and unzipping the release over SSH, creating a MySQL database, running the installation wizard, and finally wiring up the tracking script — including the docusaurus-plugin-matomo plugin for Docusaurus sites.

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 the self-hosted solution (because it's free) so that my traffic figures remain 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 https://matomo.org/faq/on-premise/installing-matomo/.

On my side, here are the actions I took:

  • Create a subdomain matomo.avonture.be pointing to a specific folder on my host.
  • Create an SSL certificate for the sub-domain.
  • Connect to that new folder using SSH
    • Run wget https://builds.matomo.org/matomo.zip to download the latest version
    • Run unzip -o matomo.zip to unzip and get files
    • Run rm -f matomo.zip "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 https://my.planethoster.com and there, I created a new MySQL db and its user.

Finally, I just need to start the wizard on https://matomo.avonture.be/index.php and follow the guide.

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

When done, I get my dashboard on https://matomo.avonture.be/index.php and I just need to add my tracking script to my pages as explained in the wizard.

Docusaurus​

On this blog, I'm using Docusaurus so I've installed a plugin for this: https://github.com/karser/docusaurus-plugin-matomo.


Was this article helpful?
Did you try the steps in this article?