{"id":3135,"date":"2025-08-18T20:24:54","date_gmt":"2023-04-09T12:53:47","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-matomo-web-analytics-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-matomo-web-analytics-on-ubuntu-22-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 Matomo Web Analytics on Ubuntu 22.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>Matomo (formerly Piwik) is an open-source web analytics platform that provides detailed reports on website traffic, user behavior, and more. It is a popular alternative to Google Analytics for users who want full control over their data. In this guide, we will walk you through the steps to install Matomo on Ubuntu 22.04. Whether you&#8217;re hosting Matomo locally or on a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS <\/a>, this tutorial will help you get Matomo up and running effectively.<\/p>\n<section>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before starting the installation, ensure that your Ubuntu 22.04 system is updated. Run the following commands to update and upgrade your system:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/pre>\n<p>This ensures that you have the latest software packages and security updates installed. Keeping your system updated is essential whether you&#8217;re deploying Matomo locally or on a <a href=\"https:\/\/ie.netcloud24.com\">UK Windows VPS<\/a>.<\/p>\n<\/section>\n<section>\n<h2>Step 2: Install LAMP Stack (Linux, Apache, MySQL, PHP)<\/h2>\n<p>Matomo requires a LAMP stack to function. You\u2019ll need to install Apache, MySQL, and PHP. Run the following commands to install the LAMP stack:<\/p>\n<pre><code>\r\nsudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-cli php-xml php-mbstring php-curl php-zip php-gd\r\n            <\/code><\/pre>\n<p>After the installation, enable the Apache and MySQL services:<\/p>\n<pre><code>\r\nsudo systemctl enable apache2\r\nsudo systemctl enable mysql\r\nsudo systemctl start apache2\r\nsudo systemctl start mysql\r\n            <\/code><\/pre>\n<p>This step sets up the necessary environment for running Matomo, whether you&#8217;re hosting locally or on a <a href=\"https:\/\/ie.netcloud24.com\">VPS Windows VPS Servers<\/a> platform.<\/p>\n<\/section>\n<section>\n<h2>Step 3: Secure MySQL Installation<\/h2>\n<p>After installing MySQL, it\u2019s important to secure the database. Run the following command to start the MySQL security script:<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>Follow the prompts to secure your MySQL installation. This includes setting a root password, removing anonymous users, and disabling remote root logins. This step is important for securing your database, whether you&#8217;re running Matomo on a local server or hosting it on a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS hosting UK<\/a>.<\/p>\n<\/section>\n<section>\n<h2>Step 4: Create a Database for Matomo<\/h2>\n<p>Next, create a MySQL database and user for Matomo. Log in to the MySQL shell:<\/p>\n<pre><code>sudo mysql -u root -p<\/code><\/pre>\n<p>Create a new database and user for Matomo:<\/p>\n<pre><code>\r\nCREATE DATABASE matomo_db;\r\nCREATE USER 'matomo_user'@'localhost' IDENTIFIED BY 'yourpassword';\r\nGRANT ALL PRIVILEGES ON matomo_db.* TO 'matomo_user'@'localhost';\r\nFLUSH PRIVILEGES;\r\nEXIT;\r\n            <\/code><\/pre>\n<p>This creates a database for Matomo and grants the necessary privileges to the user. This configuration works whether you are setting up Matomo locally or on a <a href=\"https:\/\/ie.netcloud24.com\">Microsoft SQL VPS Windows<\/a>.<\/p>\n<\/section>\n<section>\n<h2>Step 5: Download and Install Matomo<\/h2>\n<p>Now, you need to download the latest version of Matomo from the official website. Navigate to your web directory:<\/p>\n<pre><code>cd \/var\/www\/html<\/code><\/pre>\n<p>Download Matomo using <code>wget<\/code>:<\/p>\n<pre><code>wget https:\/\/builds.matomo.org\/matomo-latest.zip<\/code><\/pre>\n<p>Once downloaded, unzip the Matomo package:<\/p>\n<pre><code>sudo unzip matomo-latest.zip<\/code><\/pre>\n<p>Change the ownership of the Matomo directory to the Apache user:<\/p>\n<pre><code>sudo chown -R www-data:www-data \/var\/www\/html\/matomo<\/code><\/pre>\n<p>This will ensure that Apache can access the Matomo files, regardless of whether you&#8217;re hosting locally or on a <a href=\"https:\/\/ie.netcloud24.com\">UK VPS Windows<\/a> hosting solution.<\/p>\n<\/section>\n<section>\n<h2>Step 6: Configure Apache for Matomo<\/h2>\n<p>You now need to configure Apache to serve Matomo. Create a new virtual host file for Matomo:<\/p>\n<pre><code>sudo nano \/etc\/apache2\/sites-available\/matomo.conf<\/code><\/pre>\n<p>Add the following configuration, replacing <code>your-domain.com<\/code> with your domain:<\/p>\n<pre><code>\r\n\r\n    ServerAdmin admin@your-domain.com\r\n    DocumentRoot \/var\/www\/html\/matomo\r\n    ServerName your-domain.com\r\n    ServerAlias www.your-domain.com\r\n\r\n    \r\n        Options Indexes FollowSymLinks\r\n        AllowOverride All\r\n        Require all granted\r\n    \r\n\r\n    ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n    CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n\r\n            <\/code><\/pre>\n<p>Save and close the file. Enable the Matomo site and the Apache rewrite module:<\/p>\n<pre><code>\r\nsudo a2ensite matomo.conf\r\nsudo a2enmod rewrite\r\nsudo systemctl restart apache2\r\n            <\/code><\/pre>\n<p>This configuration enables Matomo to run on your domain or IP address, whether you&#8217;re deploying locally or on a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS hosting UK<\/a> solution.<\/p>\n<\/section>\n<section>\n<h2>Step 7: Complete the Matomo Web Installer<\/h2>\n<p>With Apache configured, you can now complete the installation through the Matomo web interface. Open your browser and navigate to:<\/p>\n<pre><code>http:\/\/your-domain.com<\/code><\/pre>\n<p>Follow the on-screen instructions to complete the setup. You will need to enter your MySQL database information and set up an admin account for Matomo.<\/p>\n<p>Once the setup is complete, Matomo will be ready to track and analyze your website traffic. This step is the same whether you&#8217;re hosting locally or using a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPSVirtual Private Server hosting<\/a> platform.<\/p>\n<\/section>\n<section>\n<h2>Step 8: Secure Your Matomo Installation with SSL<\/h2>\n<p>To ensure secure communication between your users and the server, it&#8217;s important to enable SSL. You can use Let\u2019s Encrypt to obtain a free SSL certificate. First, install Certbot:<\/p>\n<pre><code>sudo apt install certbot python3-certbot-apache<\/code><\/pre>\n<p>Then, run Certbot to obtain and configure the SSL certificate for your domain:<\/p>\n<pre><code>sudo certbot --apache -d your-domain.com<\/code><\/pre>\n<p>Follow the prompts to complete the setup. Certbot will automatically configure Apache to use the SSL certificate, ensuring secure access to your Matomo instance.<\/p>\n<\/section>\n<footer>\n<p>Matomo is now installed and running on your Ubuntu 22.04 server, providing a powerful and open-source web analytics platform. For reliable and scalable hosting, consider using <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS <\/a>. They offer various hosting solutions, including <strong>windows virtual private servers<\/strong>, <strong>windows vps hosting<\/strong>, and <strong>windows virtual dedicated server hosting<\/strong>. Whether you&#8217;re looking for a <strong>windows vps italy<\/strong> or <strong>uk vps windows<\/strong> solution, their hosting services provide the performance and flexibility needed to support your Matomo installation.<\/p>\n<\/footer>\n<\/article>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Matomo (formerly Piwik) is an open-source web analytics platform that provides detailed reports on website traffic, user behavior, and more. It is a popular alternative to\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-3135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=3135"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3135\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=3135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=3135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=3135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}