Repolode
arp242

arp242/goatcounter

Open source, privacy-friendly web analytics that you can use as a hosted service or self-host, as an alternative to Google Analytics.

Open-source alternative to:Google AnalyticsMatomo

Stars
6,082
Forks
284
Open issues
51
Last commit
25 days ago

What is it?

GoatCounter is a web analytics platform that tracks page views without collecting personal data or using unique user identifiers. It can be used as a hosted service at goatcounter.com or self-hosted on your own server, using SQLite or PostgreSQL as its database.

The JavaScript snippet is around 3.5K and is added with a single script tag. For sites that cannot run JavaScript, there is an image-based tracking pixel, and data can also be sent through the HTTP API from backend middleware. Logs from nginx, Apache, Caddy, CloudFront and other HTTP servers can be imported as well.

Self-hosting is distributed as statically compiled binaries and Docker images, with built-in TLS and automatic ACME certificate generation. Unique visits are counted without cookies using a non-identifiable hash.

Key features

  • 01Counts unique visits without cookies or personal identifiers.
  • 02Adds a single lightweight script tag, with a JavaScript-free image tracker option.
  • 03Imports data from nginx, Apache, Caddy, CloudFront and other server logs.
  • 04Records browser, location, screen size, referrers and campaigns.
  • 05Supports SQLite and PostgreSQL, and can be run as a binary or in Docker.
  • 06Lets you export all data at any time.

Use cases

  • Adding privacy-friendly page view statistics to a personal blog or project website.
  • Running a self-hosted analytics server to keep visitor data on your own infrastructure.
  • Analyzing historical traffic by importing existing web server logs.
  • Tracking pageviews from a backend application through the HTTP API.

Quick start

  1. 1

    Run GoatCounter in Docker with a data volume

    docker run -p 8080:8080 -v goatcounter-data:/home/goatcounter/goatcounter-data arp242/goatcounter
  2. 2

    Open http://localhost:8080 and use the setup wizard to create your first site

Things to know

  • The license could not be determined from the metadata, so check the repository's license terms before use.
  • SQLite may be slow for sites with very many distinct pages; PostgreSQL is recommended for larger sites.

Topics

FAQ

What is goatcounter?
Open source, privacy-friendly web analytics that you can use as a hosted service or self-host, as an alternative to Google Analytics. GoatCounter is a web analytics platform that tracks page views without collecting personal data or using unique user identifiers. It can be used as a hosted service at goatcounter.com or self-hosted on your own server, using SQLite or PostgreSQL as its database.
Is goatcounter free to use? What license does it have?
goatcounter is open source under the Other license. Check the license terms before using it in commercial products.
Is goatcounter still maintained?
Actively maintained. The last commit to goatcounter was on Sep 27, 2026.
What can I use goatcounter for?
Adding privacy-friendly page view statistics to a personal blog or project website. Running a self-hosted analytics server to keep visitor data on your own infrastructure. Analyzing historical traffic by importing existing web server logs. Tracking pageviews from a backend application through the HTTP API.
How do I install goatcounter?
Run GoatCounter in Docker with a data volume: docker run -p 8080:8080 -v goatcounter-data:/home/goatcounter/goatcounter-data arp242/goatcounter Open http://localhost:8080 and use the setup wizard to create your first site
Where can I get goatcounter?
The source code and installation instructions are on GitHub: https://github.com/arp242/goatcounter

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects