Instalación Matomo · 8 min read · Nov 30, 2025
Cómo instalar Matomo Web Analytics en Debian 11

Matomo, anteriormente conocido como Piwik, es una aplicación de análisis web gratuita y de código abierto desarrollada por una comunidad de desarrolladores. Se utiliza para rastrear su sitio web y proporcionar información detallada sobre su sitio web y sus visitantes, incluyendo los motores de búsqueda y las palabras clave que utilizaron, el idioma que hablan, qué páginas les gustan, los archivos que descargan y mucho más. Ofrece muchas características, incluyendo Google AdWords, Facebook Ads, Yahoo, Marketing de Búsqueda, API de Seguimiento e Informes, y Costo Por Clic (CPC).
En este tutorial, le mostraré cómo instalar Matomo en Debian 11 con un servidor web Apache2 y un certificado SSL gratuito de Let’s Encrypt.
Requisitos previos
- Un servidor que ejecute Debian 11.
- Un nombre de dominio válido apuntado a la IP de su servidor.
- Una contraseña de root configurada en el servidor.
Instalar Apache, MariaDB y PHP
Primero, necesitará instalar el servidor web Apache, el servidor de base de datos MariaDB, PHP y otras extensiones de PHP en su servidor. Puede instalar todos ellos ejecutando el siguiente comando:
apt-get install apache2 mariadb-server php libapache2-mod-php php-cli php-fpm php-fpm php-json php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath curl unzip -yDespués de instalar todos los paquetes, inicie y habilite el servicio de Apache y MariaDB usando el siguiente comando:
systemctl start apache2 mariadb
systemctl enable apache2 mariadbUna vez que haya terminado, puede proceder al siguiente paso.
Crear una base de datos MariaDB para Matomo
Matomo utiliza MariaDB como backend de base de datos. Así que necesitará crear una base de datos y un usuario para Matomo.
Primero, inicie sesión en MariaDB con el siguiente comando:
mysqlUna vez que haya iniciado sesión, cree una base de datos y un usuario con el siguiente comando:
MariaDB [(none)]> CREATE DATABASE matomodb;
MariaDB [(none)]> CREATE USER 'matomo'@'localhost' IDENTIFIED BY 'password';A continuación, otorgue todos los privilegios a la base de datos de Matomo con el siguiente comando:
MariaDB [(none)]> GRANT ALL ON matomodb.* TO 'matomo'@'localhost' WITH GRANT OPTION;A continuación, limpie los privilegios y salga de la consola de MariaDB con el siguiente comando:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;Después de configurar la base de datos de MariaDB, puede proceder al siguiente paso.
Descargar Matomo
A continuación, visite el sitio web oficial de Matomo y descargue la última versión de Matomo con el siguiente comando:
wget http://builds.matomo.org/matomo-latest.zipUna vez que se complete la descarga, descomprima el archivo descargado con el siguiente comando:
unzip matomo-latest.zipA continuación, mueva el directorio extraído al directorio raíz de Apache:
mv matomo /var/www/html/matomoA continuación, cambie la propiedad y los permisos del directorio de Matomo:
chown -R www-data:www-data /var/www/html/matomo
chmod -R 755 /var/www/html/matomoUna vez que haya terminado, puede proceder al siguiente paso.
Configurar Apache para Matomo
A continuación, necesitará crear un archivo de configuración de host virtual de Apache para alojar Matomo en Internet. Puede crearlo con el siguiente comando:
nano /etc/apache2/sites-available/matomo.confAgregue las siguientes líneas:
ServerAdmin [email protected]
ServerName matomo.example.com
DocumentRoot /var/www/html/matomo/
DirectoryIndex index.php
Options FollowSymLinks
AllowOverride All
Require all granted
Options None
Require all denied
Options None
Require all granted
Options None
Require all denied
Options None
Require all denied
ErrorLog ${APACHE_LOG_DIR}/matomo_error.log
CustomLog ${APACHE_LOG_DIR}/matomo_access.log combined
Guarde y cierre el archivo cuando haya terminado, luego active el host virtual de Matomo y el módulo de reescritura de Apache con el siguiente comando:
a2ensite matomo.conf
a2enmod rewriteA continuación, reinicie el servicio de Apache para aplicar los cambios:
systemctl restart apache2También puede verificar el estado de Apache con el siguiente comando:
systemctl status apache2Obtendrá la siguiente salida:
? apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-03-06 06:33:24 UTC; 5s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 55482 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 55486 (apache2)
Tasks: 6 (limit: 4679)
Memory: 12.4M
CPU: 108ms
CGroup: /system.slice/apache2.service
??55486 /usr/sbin/apache2 -k start
??55487 /usr/sbin/apache2 -k start
??55488 /usr/sbin/apache2 -k start
??55489 /usr/sbin/apache2 -k start
??55490 /usr/sbin/apache2 -k start
??55491 /usr/sbin/apache2 -k start
Mar 06 06:33:24 debian11 systemd[1]: Starting The Apache HTTP Server...
Mar 06 06:33:24 debian11 apachectl[55485]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 209>
Mar 06 06:33:24 debian11 systemd[1]: Started The Apache HTTP Server.
Acceder a la interfaz web de Matomo
Ahora, abra su navegador web y acceda a la interfaz web de Matomo usando la URL http://matomo.example.com. Serás redirigido a la siguiente página:

Haga clic en el botón Siguiente. Debería ver la página de verificación de configuración de PHP:

Asegúrese de que todas las configuraciones estén bien y luego haga clic en el botón SIGUIENTE. Debería ver la página de configuración de la base de datos de MariaDB:

Proporcione su servidor de base de datos, nombre de usuario, nombre de la base de datos, contraseña y luego haga clic en el botón SIGUIENTE. Debería ver la siguiente página:

Haga clic en el botón SIGUIENTE. Debería ver la página de creación de Super Usuario:

Proporcione su nombre de usuario de administrador, contraseña, correo electrónico y haga clic en el botón SIGUIENTE. Debería ver la página de configuración del sitio web:

Proporcione el nombre de su sitio web, URL, zona horaria y haga clic en el botón SIGUIENTE. Debería ver la siguiente página:


Haga clic en el botón SIGUIENTE. Debería ver la página de verificación de configuración:

Haga clic en el CONTINUAR A MATOMO. Debería ver la página de inicio de sesión de Matomo:

Proporcione su nombre de usuario de administrador, contraseña y haga clic en el botón INICIAR SESIÓN. Debería ver el panel de control de Matomo en la siguiente página: ahora puede copiar el código de seguimiento que se muestra en la imagen anterior y pegarlo en cada página de su sitio web.

Asegurar Matomo con Let’s Encrypt SSL
A continuación, necesitará instalar el cliente Certbot para instalar el SSL de Let’s Encrypt para su sitio web. Puede instalarlo con el siguiente comando:
dnf install epel-release -y dnf install certbot python3-certbot-apacheA continuación, obtenga e instale un certificado SSL para su dominio con el siguiente comando:
certbot --apache -d matomo.example.comSe le pedirá que proporcione su dirección de correo electrónico y acepte los términos del servicio:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): [email protected]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for matomo.example.com
Performing the following challenges:
http-01 challenge for matomo.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/httpd/conf.d/matomo.conf
Redirecting all traffic on port 80 to ssl in /etc/httpd/conf.d/matomo.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://matomo.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subscribe to the EFF mailing list (email: [email protected]).
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/matomo.example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/matomo.example.com/privkey.pem
Your certificate will expire on 2022-05-09. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again with the "certonly" option. To non-interactively
renew *all* of your certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-leConclusión
¡Felicidades! ha instalado con éxito Matomo en Debian 11. Ahora puede agregar el código de seguimiento a su sitio web y comenzar a monitorearlo desde el panel de control de Matomo. No dude en preguntarme si tiene alguna pregunta.
Recibe nuevas publicaciones en tu bandeja de entrada.
No spam. Cancela la suscripción en cualquier momento.