12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Run Matomo - Google Analytics Alternative - in Docker</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="Browser Based,Docker Made Easy,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,Linux,MariaDB,MySQL,Ubuntu,Web Analytics,Web Traffic,Self-hosted Web Analytics,Matomo,Docker How To,Docker Container,Docker Made Simple,Homelab,Docker,Docker Simplified,Docker Tutorial,How To,Tutorial,i12bretro">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Run Matomo - Google Analytics Alternative - in Docker">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="revised" content="08/20/2023 08:08:15 PM" />
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Run Matomo - Google Analytics Alternative - in Docker</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>What is Matomo?</h2>
- <blockquote><em>Matomo is the leading Free/Libre open analytics platform. Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! -<a href="https://github.com/matomo-org/matomo" target="_blank">https://github.com/matomo-org/matomo</a></em></blockquote>
- <h2>Installing Docker</h2>
- <ol>
- <li>Log into the Linux based device</li>
- <li>Run the following commands in the terminal
- <div class="codeBlock"># install prerequisites<br />
- sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
- # add docker gpg key<br />
- curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -<br />
- # add docker software repository<br />
- sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"<br />
- # install docker<br />
- sudo apt install docker-ce docker-compose containerd.io -y<br />
- # enable and start docker service<br />
- sudo systemctl enable docker && sudo systemctl start docker<br />
- # add the current user to the docker group<br />
- sudo usermod -aG docker $USER<br />
- # reauthenticate for the new group membership to take effect<br />
- su - $USER</div>
- </li>
- </ol>
- <h2>Running Matomo</h2>
- <ol>
- <li>Continue with the following commands in a terminal window
- <div class="codeBlock"># create a working directory<br />
- mkdir ~/docker/matomo -p && mkdir ~/docker/mariadb -p<br />
- # set owner of working directories<br />
- sudo chown "$USER":"$USER" ~/docker -R<br />
- # allow the container to write to working directories<br />
- sudo chmod a+rwx -R ~/docker/matomo<br />
- # run the mariadb docker container<br />
- docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=r00tp@$$ -e MYSQL_USER=matomo_rw -e MYSQL_PASSWORD='M4tom0!' -e MYSQL_DATABASE=matomo -v ~/docker/mariadb:/var/lib/mysql -p 3306:3006 --restart=unless-stopped mariadb:latest<br />
- # start the matomo container<br />
- docker run -d --name matomo --link mariadb -p 80:80 -v ~/docker/matomo:/var/www/html -e MATOMO_DATABASE_HOST=mariadb -e MATOMO_DATABASE_USERNAME=matomo_rw -e MATOMO_DATABASE_PASSWORD='M4tom0!' -e MATOMO_DATABASE_DBNAME=matomo --restart=unless-stopped matomo</div>
- </li>
- <li>Open a web browser and navigate to http://DNSorIP</li>
- <li>Click Next at the Welcome screen</li>
- <li>Scroll to the bottom of the System Check screen > Click Next</li>
- <li>Verify the Database Setup form > Click Next</li>
- <li>Click Next on the Creating the Tables page</li>
- <li>Enter a Superuser login, password and email > Click Next</li>
- <li>Complete the form to setup the first site to start tracking analytics > Click Next</li>
- <li>Click Next then Continue to Matomo</li>
- <li>Login with the Superuser username and password created earlier</li>
- <li>Welcome to Matomo</li>
- </ol>
- <p>Additional Information: <a href="https://matomo.org/" target="_blank">https://matomo.org/</a></p> </div>
- </div>
- </body>
- </html>
-
|