# Install Matomo - Self-Hosted Google Analytics Alternative - on Windows

## What is Matomo?

Matomo is the ethical alternative where you won't make privacy sacrifices or compromise your site. Matomo's the Google Analytics alternative that protects your data and your customer's privacy. A powerful web analytics platform with 100% data ownership. - https://matomo.org

## Installation

1. Download XAMPP Download
2. Download Matomo Download
3. Download Microsoft Visual C++ Download
4. Install Microsoft Visual C++
5. Right click the downloaded XAMPP file > Extract All...
6. Right click the downloaded Matomo .zip file > Extract All...
7. Cut the matomo folder inside the XAMPP/htdocs directory
8. Copy the extracted XAMPP directory to a safe location to run from, C:\Program Files for example
9. Run XAMPP/setup_xampp.bat to update the configuration files with the new server location
10. Run XAMPP/xampp-control.exe
11. Click the Start button next to Apache and MySQL
12. Navigate to XAMPP/mysql/bin
13. Hold the SHIFT key and right click in the white space > Open PowerShell windows here...
14. Type the following in the PowerShell window to setup the database
    .\mysql -u root
    CREATE DATABASE analytics DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    CREATE USER 'analytics_rw'@'localhost' IDENTIFIED BY 'An@lyt1c$!';
    GRANT ALL ON analytics.* TO 'analytics_rw'@'localhost';
    FLUSH PRIVILEGES;
    exit;
15. Open a web browser and navigate to http://DNSorIP/matomo
16. Click the Next button on the Welcome screen
17. Click the Next button on the System Check screen
18. Fill in the database connection form as follows and click the Next button

    Database Server: 127.0.0.1
    Login: analytics_rw
    Password: An@lyt1c$!
    Database Name: analytics
    Table Prefix:
    Adapter: MySQLI

19. Click Next on the Creating the Tables page
20. Enter a Superuser login, password and email > Click Next
21. Complete the form to setup the first site to start tracking analytics > Click Next
22. Click Next then Continue to Matomo
23. Login with the Superuser username and password created earlier
24. Welcome to Matomo

## Installing Dark Theme (Optional)

1. Click the gear icon in the top right
2. Select Platform > Marketplace from the left navigation menu
3. Change the Show dropdown to Themes and search for Dark Theme
4. Find Dark Theme and click the Install button
5. Type the admin password to confirm the installation
6. Click the Activate Theme button

Source: https://matomo.org/docs/installation/#getting-started