0239.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Install Matomo - Self-Hosted Google Analytics Alternative - on Linux</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Alternative To Google Analytics,Analytics,FOSS,Google Analytics,Google Analytics Alternative,Homelab,Linux,MariaDB,Matomo,MySQL,Self-hosted Web Analytics,Web Analytics,Web Traffic,Debian,Ubuntu,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Install Matomo - Self-Hosted Google Analytics Alternative - on Linux">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="10/28/2023 01:30:12 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Install Matomo - Self-Hosted Google Analytics Alternative - on Linux</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is Matomo?</h2>
  26. <p><em>Matomo is the ethical alternative where you won&#39;t make privacy sacrifices or compromise your site. Matomo&#39;s the Google Analytics alternative that protects your data and your customer&#39;s privacy. A powerful web analytics platform with 100% data ownership.</em> - <a href="https://matomo.org/" rel="noopener" target="_blank">https://matomo.org</a></p>
  27. <h2>Installing Matomo</h2>
  28. <ol>
  29. <li>Log into the Debian device</li>
  30. <li>Run the following commands in a terminal:
  31. <div class="codeBlock"># update software repositories<br />
  32. sudo apt update<br />
  33. # install available updates<br />
  34. sudo apt upgrade -y<br />
  35. # install Apache HTTPD and MySQL<br />
  36. sudo apt install apache2 mariadb-server mariadb-client -y<br />
  37. # install PHP components<br />
  38. sudo apt install php php-curl php-gd php-cli php-mysql php-xml php-mbstring -y<br />
  39. # configure the MySQL database<br />
  40. sudo su<br />
  41. mysql_secure_installation</div>
  42. </li>
  43. <li>Press Enter to login as root</li>
  44. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  45. <li>Type Y and press Enter to remove anonymous users</li>
  46. <li>Type Y and press Enter to disallow root login remotely</li>
  47. <li>Type Y and press Enter to remove the test database</li>
  48. <li>Type Y and press Enter to reload privilege tables</li>
  49. <li>Run the following command to login into MySQL:
  50. <div class="codeBlock">mysql -u root -p</div>
  51. </li>
  52. <li>Authenticate with the root password set earlier</li>
  53. <li>Run the following commands to create the Matomo database and database user
  54. <div class="codeBlock">CREATE DATABASE analytics;<br />
  55. GRANT ALL ON analytics.* to &#39;analytics&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;An@lyt1c$!&#39;;<br />
  56. FLUSH PRIVILEGES;<br />
  57. EXIT;<br />
  58. exit</div>
  59. </li>
  60. <li>Continue with the following commands to download and extract Matomo in the Apache webroot
  61. <div class="codeBlock"># download latest matomo build<br />
  62. wget https://builds.matomo.org/matomo.zip<br />
  63. # extract downloaded zip<br />
  64. sudo unzip matomo.zip -d /var/www/html<br />
  65. # move to webroot<br />
  66. sudo mv /var/www/html/matomo /var/www/html/analytics<br />
  67. # set the owner of the new analytics directory to www-data<br />
  68. sudo chown -R www-data:www-data /var/www/html/analytics</div>
  69. </li>
  70. <li>Open a web browser and navigate to http://DNSorIP/analytics</li>
  71. <li>Click the Next button on the Welcome screen</li>
  72. <li>Click the Next button on the System Check screen</li>
  73. <li>Fill in the database connection form as follows and click the Next button
  74. <p>Database Server: 127.0.0.1<br />
  75. Login: analytics<br />
  76. Password: An@lyt1c$!<br />
  77. Database Name: analytics<br />
  78. Table Prefix: <br />
  79. Adapter: MySQLI</p>
  80. </li>
  81. <li>Click the Next button</li>
  82. <li>Create an administrative logon and set the password &gt; Click the Next button</li>
  83. <li>Complete the form to add the first website to collect analytics on &gt; Click the Next button</li>
  84. <li>Copy the generated code into the header of the application to monitor</li>
  85. <li>Click Next &gt; Click Next on the Congratulations page</li>
  86. <li>Login with the admin logon created earlier</li>
  87. <li>Welcome to free self-hosted web analytics</li>
  88. </ol>
  89. <h2>Installing Dark Theme (Optional)</h2>
  90. <ol>
  91. <li>Click the gear icon in the top right</li>
  92. <li>Select Platform &gt; Marketplace from the left navigation menu</li>
  93. <li>Change the Show dropdown to Themes and search for Dark Theme</li>
  94. <li>Find Dark Theme and click the Install button</li>
  95. <li>Type the admin password to confirm the installation</li>
  96. <li>Click the Activate Theme button</li>
  97. </ol>
  98. <p>Source: <a href="https://matomo.org/docs/installation/#getting-started" target="_blank">https://matomo.org/docs/installation/#getting-started</a></p> </div>
  99. </div>
  100. </body>
  101. </html>