whatisgithub

What is goatcounter?

arp242/goatcounter — explained in plain English

Analysis updated 2026-06-26

5,690GoAudience · generalComplexity · 2/5LicenseSetup · easy

In one sentence

GoatCounter is a privacy-friendly website analytics tool that shows page views, browsers, locations, and referrals, without tracking individual users or needing cookie consent banners. Run it on goatcounter.com or self-host on your own server with a single binary.

Mindmap

mindmap
  root((GoatCounter))
    Tracking Methods
      JS snippet
      Server API
      Log file import
      No-JS image pixel
    Data Collected
      Page views
      Browser types
      Geographic locations
      Referral sources
    Self-Hosting
      Single binary
      SQLite storage
      PostgreSQL storage
      Docker support
    Privacy
      No user profiles
      No cookies needed
      Data stays local
    Hosted Option
      goatcounter.com
      One line of code
      Instant setup
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add simple, privacy-safe analytics to your website without a cookie consent popup or GDPR headache.

USE CASE 2

Self-host your own analytics server so visitor data never leaves your infrastructure.

USE CASE 3

Track page views on a site built without JavaScript by using the image-based tracking option.

USE CASE 4

Replace Google Analytics on a small business or personal site and export your data anytime you want.

What is it built with?

GoSQLitePostgreSQLDockerJavaScriptnginx

How does it compare?

arp242/goatcountermjl-/moxprometheus/blackbox_exporter
Stars5,6905,6845,682
LanguageGoGoGo
Setup difficultyeasyhardmoderate
Complexity2/54/53/5
Audiencegeneralops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Hosted version needs just one line of JS. Self-hosted requires downloading a binary and running one command, SQLite works out of the box with no database setup.

Open source and free to use. You can run it yourself, modify it, and the source code is publicly available.

So what is it?

GoatCounter is a web analytics tool that tracks visits to your website without collecting personal data about your visitors. It is positioned as a privacy-respecting alternative to Google Analytics: you get page view counts, browser types, geographic locations, screen sizes, and referral sources, but no individual user profiles and no need for cookie consent banners. You can use it in one of two ways. The hosted version at goatcounter.com lets you sign up and add a single line of code to your website to start collecting statistics immediately. The self-hosted version lets you run the whole system on your own server, which means your data never leaves your infrastructure. The source code is fully open and free to use. For self-hosters, the setup is intentionally simple. You download a precompiled binary (no complex dependencies required), run one command to start the server, and use a web wizard or a command-line tool to create your first site. Storage uses either SQLite for smaller sites or PostgreSQL for larger ones. Docker is also supported for those who prefer container-based deployments. Automatic HTTPS certificate generation is built in. To get data into GoatCounter, there are three methods: add a small JavaScript snippet to your pages (about 3.5 kilobytes), call its API from your own server backend, or point it at your existing web server log files from nginx, Apache, or similar tools. A no-JavaScript image-based tracking option also exists for sites that avoid JavaScript. The project emphasizes accessibility in its own interface, with screen reader support noted as a priority. You can export all your data at any time and stop using the service whenever you want.

Copy-paste prompts

Prompt 1
I'm adding GoatCounter analytics to my website. Show me the JavaScript snippet I need to paste in and explain where exactly it should go in my HTML.
Prompt 2
I want to self-host GoatCounter on a Linux server. Walk me through downloading the binary, starting the server, creating my first site, and enabling automatic HTTPS.
Prompt 3
My website doesn't use JavaScript. How do I use GoatCounter's image-based tracking instead, and what data will I still be able to collect?
Prompt 4
I have existing nginx access log files and want to import them into GoatCounter. What command do I run and what format does GoatCounter expect?
Prompt 5
Compare GoatCounter to Google Analytics for a non-technical founder: what data do I get, what do I give up, and why does it matter for privacy?

Frequently asked questions

What is goatcounter?

GoatCounter is a privacy-friendly website analytics tool that shows page views, browsers, locations, and referrals, without tracking individual users or needing cookie consent banners. Run it on goatcounter.com or self-host on your own server with a single binary.

What language is goatcounter written in?

Mainly Go. The stack also includes Go, SQLite, PostgreSQL.

What license does goatcounter use?

Open source and free to use. You can run it yourself, modify it, and the source code is publicly available.

How hard is goatcounter to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is goatcounter for?

Mainly general.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.