How to Install GoatCounter on Windows 11
GoatCounter is a simple web analytics service that is self-hosted and lightweight. In this tutorial, we'll guide you through the steps to install GoatCounter on Windows 11.
Prerequisites
Before you can install GoatCounter on your Windows 11 machine, you need to ensure that you have the following prerequisites:
Node.js installed on your machine. You can download Node.js from the official website.
MySQL server installed on your machine. You can download MySQL server from the official website.
Git installed on your machine. You can download Git from the official website.
Installing GoatCounter
Once you have the prerequisites installed, follow the steps below to install GoatCounter:
Open Command Prompt and navigate to the directory where you want to install GoatCounter.
Clone the GoatCounter repository by running the following command:
git clone https://github.com/zgoat/goatcounter.gitOnce the repository is cloned, navigate to the cloned directory by running the following command:
cd goatcounterInstall the dependencies by running the following command:
npm installCreate a new database for GoatCounter by running the following command:
mysql -u root -p -e "CREATE DATABASE goatcounter;"Create a new user for the GoatCounter database by running the following command:
mysql -u root -p -e "CREATE USER 'goat'@'localhost' IDENTIFIED BY 'mypassword';"Replace 'mypassword' with your desired password.
Grant the new user all privileges on the GoatCounter database by running the following command:
mysql -u root -p -e "GRANT ALL PRIVILEGES ON goatcounter.* TO 'goat'@'localhost';"Copy the configuration file by running the following command:
cp config_example.yml config.ymlEdit the configuration file to match your setup by running the following command:
notepad config.ymlReplace the database settings with the following:
db_url: mysql://goat:mypassword@localhost/goatcounter db_mask: 0x7FFFFFFFFFFFFFFFReplace 'mypassword' with the password you set for the 'goat' user.
Start the GoatCounter server by running the following command:
npm startYou should see the server starting up and displaying the URL for accessing the GoatCounter dashboard.
Access the GoatCounter dashboard by opening the URL displayed in the console.
That's it! You have successfully installed GoatCounter on your Windows 11 machine.