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.
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.
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.git
Once the repository is cloned, navigate to the cloned directory by running the following command:
cd goatcounter
Install the dependencies by running the following command:
npm install
Create 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.yml
Edit the configuration file to match your setup by running the following command:
notepad config.yml
Replace the database settings with the following:
db_url: mysql://goat:mypassword@localhost/goatcounter
db_mask: 0x7FFFFFFFFFFFFFFF
Replace 'mypassword' with the password you set for the 'goat' user.
Start the GoatCounter server by running the following command:
npm start
You 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.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!