Looking for self-hosted Google Analytics alternatives? You are not short of choice: there are now more than a dozen open-source analytics tools you can run on your own server, from a 256 MB single binary to a full product-analytics suite. The hard part is picking the one that matches your site, your server and your patience for maintenance.
This guide compares nine open-source options we list on Hostly, with the licence, the stack you will have to run, the official install path and the trade-offs each project is upfront about. Everything below was checked against each project's own repository and documentation in November 2026.
Why Move Away From Google Analytics?
Google Analytics 4 is free on the standard tier and very capable, so "it costs money" is not the reason. The reasons people give are more practical:
- You do not hold the data. When Google retired Universal Analytics, standard properties stopped processing hits on July 1, 2023, and from July 1, 2024 the interface and API were switched off and the historical data deleted. Anyone who had not exported it lost it.
- Retention is capped. On standard GA4 properties, user-level and event-level data can be kept for 2 or 14 months. Longer periods are reserved for Analytics 360. Google notes that this setting affects explorations and funnel reports, not the standard aggregated reports, but it still limits how far back you can dig.
- It is heavy for what most sites need. If you want to know which pages are read and where visitors come from, GA4's event model and interface are a lot of machinery.
- Cookies and consent. Most of the tools below are designed to work without cookies, which is the main reason their makers say you can run them without a consent banner. Whether that holds for your site depends on your jurisdiction and configuration, so treat it as a design goal, not legal advice.
Self-hosting solves the first two completely: the database sits on your disk, and you decide how long to keep it.
Quick Comparison
| Tool | Licence | What you run | Best for |
|---|---|---|---|
| Plausible CE | AGPL-3.0 | Docker Compose stack with ClickHouse | Clean, simple traffic dashboards |
| Umami | MIT | Node.js app + PostgreSQL | Best all-rounder on a small server |
| Matomo | GPL-3.0-or-later | PHP + MySQL/MariaDB | Closest to classic Google Analytics |
| PostHog | MIT (except ee/) | Docker "hobby" deployment | Product analytics for apps |
| Rybbit | AGPL-3.0 | Docker Compose stack with ClickHouse | Modern UI with replays and funnels |
| GoatCounter | EUPL 1.2 (modified) | Single binary, SQLite or PostgreSQL | Blogs and personal sites |
| GoAccess | MIT | CLI tool reading server logs | Zero-JavaScript log analysis |
| Swetrix CE | AGPL-3.0 | Docker Compose stack with ClickHouse + Redis | Traffic plus performance monitoring |
| Medama | Apache-2.0 (tracker MIT) | Single binary or one container | Tiny VPS, minimal footprint |
1. Plausible Community Edition
Plausible Analytics is the tool that made "simple, cookie-free analytics" a category. One page shows visitors, sources, top pages, countries and devices, and there is very little to learn. The self-hosted build is called Plausible Community Edition (CE) and is licensed under AGPL-3.0, with the JavaScript tracker released separately under MIT so that embedding it does not affect your site's licence.
The official prerequisites are Docker with Docker Compose, a CPU that supports SSE 4.2 or NEON (a ClickHouse requirement), and at least 2 GB of RAM. Installation follows the community-edition repository:
git clone -b v3.2.1 --single-branch https://github.com/plausible/community-edition plausible-ce
cd plausible-ce
touch .env
echo "BASE_URL=https://plausible.example.com" >> .env
echo "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .env
docker compose up -d
To expose it directly, the README has you add HTTP_PORT=80 and HTTPS_PORT=443 to .env and publish those ports in a compose.override.yml, which also turns on automatic Let's Encrypt certificates. Behind an existing reverse proxy you would pick other ports instead.
Plausible CE: What to Know
- ✅Raw data is yours: you can query the ClickHouse database directly
- ✅Automatic HTTPS built into the official Compose setup
- ✅Custom events and goals for conversion tracking
- ❌CE is a long-term release published twice a year, so it trails the cloud version
- ❌Marketing funnels, ecommerce revenue goals, SSO and the sites API are cloud-only
- ❌Bot filtering is basic (User-Agent and referrer-spam lists) compared with the cloud
2. Umami
Umami is MIT-licensed and, for most self-hosters, the easiest serious option. It needs only Node.js and a PostgreSQL database, so it fits comfortably next to other containers on a small machine. The project describes itself as a web and product analytics platform that works without cookies, and the documentation covers goals, funnels, user journeys, retention, UTM campaigns, revenue and attribution reports, plus teams, shareable dashboards and an API.
The repository ships an official docker-compose.yml. Its core looks like this (simplified: the health checks and the optional two-factor key are left out, so use the file from the repository for production):
services:
umami:
image: ghcr.io/umami-software/umami:latest
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://umami:umami@db:5432/umami
# Generate with: openssl rand -hex 32
APP_SECRET: ${APP_SECRET:?Set APP_SECRET in your .env file}
depends_on:
- db
init: true
restart: always
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: umami
volumes:
- umami-db-data:/var/lib/postgresql/data
restart: always
volumes:
umami-db-data:
Change the database password, put a random APP_SECRET in a .env file next to it and run docker compose up -d. Umami listens on port 3000. The first login is admin / umami, and you are asked to change that password straight away. If Compose is new to you, our Docker Compose basics guide explains each of these keys.
Trade-offs: the current README lists PostgreSQL (12.14 or newer) as the only database requirement, so check the migration notes first if you run an older install on another database. The project also ships releases frequently, so read the release notes before upgrading.
3. Matomo
Matomo, formerly Piwik, is the veteran. It is a PHP and MySQL/MariaDB application released under GPL v3 or later, and the project says it is used on more than 1.4 million websites. If you or your client expect something that looks and behaves like classic Google Analytics, with a visits log, user segmentation, goal tracking, ecommerce analytics and a tag manager, this is the closest match. It can also import server logs and, according to its feature list, your historic Google Analytics data.
Because it is a traditional PHP application, Matomo also runs where Docker does not: you can upload it to ordinary web hosting, point your browser at the directory and follow the installer. Matomo recommends the latest PHP 8.x with MySQL 8+ or MariaDB.
Matomo: What to Know
- ✅The On-Premise Community edition is free, with unlimited users and hits
- ✅Runs on plain PHP hosting as well as on a VPS
- ✅The deepest feature set of the classic web-analytics tools here
- ❌Funnels, Heatmaps & Session Recording, Form Analytics, SEO Web Vitals and Custom Reports are paid premium plugins on self-hosted installs
- ❌The interface is dense; expect a learning curve
4. PostHog
PostHog answers a different question. Instead of "how many people visited", it is built for "what do users do inside my product": product analytics, session replay, heatmaps, error tracking, feature flags, experiments and surveys sit in one platform. The repository is MIT-licensed apart from the ee/ directory, which has its own licence.
PostHog is very clear about where self-hosting fits. There is an open-source "hobby" deployment that installs with one script on Linux with Docker, with 4 GB of memory recommended:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)"
The project states that open-source deployments should scale to roughly 100,000 events per month, that it recommends moving to PostHog Cloud beyond that, and that it offers no customer support or guarantees for self-hosted instances. Take that at face value: PostHog is a good self-hosted choice for a side project or an internal tool, and the wrong one for a busy content site that only needs page views.
5. Rybbit
Rybbit is the fast-growing newcomer, with more than 13,000 GitHub stars at the time of writing. It is AGPL-3.0 licensed and aims to be as approachable as Plausible while going further: the feature list includes session replays, funnels, user journeys, retention, custom events with JSON properties, country-region-city location data and a real-time dashboard, all without cookies.
The documented path is a VPS with at least 2 GB of RAM (the guide was tested on Ubuntu 24 LTS) and a domain pointing to it. HTTPS is mandatory, because browsers block tracking scripts served over plain HTTP, and the setup script starts a Caddy web server that obtains the certificate for you:
git clone https://github.com/rybbit-io/rybbit.git
cd rybbit
chmod +x *.sh
./setup.sh your.domain.name
Once DNS has propagated, you create the admin account at https://your.domain.name/signup. On ARM servers, note that the docs require ARMv8.2-A or newer for ClickHouse. Rybbit is younger than Plausible, Umami and Matomo, so expect faster change and plan your backups accordingly.
6. GoatCounter
GoatCounter is deliberately small. It is distributed as a statically compiled binary whose only dependency is somewhere to keep a SQLite file (PostgreSQL is supported for larger sites), and it is licensed under a slightly modified EUPL 1.2. The project puts its tracking script at about 3.5 KB, and if you do not want JavaScript at all you can use a tracking pixel, call the API from your backend, or import nginx, Apache, Caddy or CloudFront log files.
The official Docker command is a one-liner:
docker run \
-p 8080:8080 \
-v goatcounter-data:/home/goatcounter/goatcounter-data \
arp242/goatcounter
You then create your site with goatcounter db create site inside the container, as described in the README. GoatCounter does not try to do funnels or replays. It shows what a personal site or blog needs, and its author treats accessibility of the dashboard as a priority feature.
7. GoAccess
GoAccess is the odd one out, and that is its strength. It does not add a script to your pages. It reads the access logs your web server already writes and turns them into a live report, either in the terminal or as a self-contained HTML dashboard. It is written in C, MIT-licensed, and needs only ncurses.
# Interactive report in the terminal
goaccess access.log
# Generate an HTML report
goaccess access.log -a > report.html
Predefined log formats cover Apache, Nginx, Amazon S3, Elastic Load Balancing and CloudFront, and recent versions break down UTM campaigns and classify bots and AI crawlers separately from search engines. Because nothing runs in the browser, ad blockers cannot hide visitors from it. The flip side: you see requests, not behaviour. There are no custom events, and if a CDN serves your pages you need the CDN's logs. If your site sits behind Nginx Proxy Manager or Caddy, you already have the logs GoAccess needs.
8. Swetrix Community Edition
Swetrix is an AGPL-3.0, cookieless platform whose tracking script is under 5 KB. Beyond traffic it monitors site speed and lets you analyse sessions and user flows. The self-hosted Community Edition lives in a dedicated repository and runs as a Docker Compose stack: frontend, API, ClickHouse, Redis and an nginx proxy.
git clone https://github.com/swetrix/selfhosting
cd selfhosting
./configure.sh
docker compose up -d
The docs recommend at least 2 GB of RAM and support x86_64 and arm64. Two things to plan for: releases often include database migrations that you apply yourself, and session replays in the Community Edition need a private S3-compatible bucket, which you can provide with a self-hosted object store.
9. Medama
Medama Analytics targets the smallest servers. The project describes a single binary with no external dependencies that can run on a VM with 256 MB of memory for most small websites, and a tracker under 1 KB that uses no cookies and no IP addresses. The server and dashboard are Apache-2.0 licensed; the tracker is MIT.
docker run -d -p 8080:8080 -v medama-data:/app/data ghcr.io/medama-io/medama:latest
Log in with admin / CHANGE_ME_ON_FIRST_LOGIN and, as the password says, change it. Medama is still pre-1.0 (v0.6.2 at the time of writing), so it suits personal projects better than a business that needs long-term stability guarantees.
In the same single-binary spirit, Liwan (Apache-2.0) bundles its dashboard and database into one executable or container and supports single sign-on through OpenID Connect. It is a much smaller project, but worth a look if Medama appeals to you.
How to Choose
Pick by Situation:
- 🟢Blog or personal site on a tiny VPS: GoatCounter or Medama
- 🟢Several sites, one small server, room to grow: Umami
- 🟢You want the simplest possible dashboard: Plausible CE
- 🟢Session replays and funnels without paying for plugins: Rybbit or Swetrix CE
- 🟢Clients who expect a Google Analytics-style tool, or PHP-only hosting: Matomo
- 🟢A web app where you care about in-product behaviour: PostHog, within its 100k events/month guidance
- 🟢No JavaScript on your pages at all: GoAccess, or GoatCounter's log import
Stay on a Hosted Service When:
- 🔵You rely on the Google Ads integration, which is built around Google's own tag
- 🔵Nobody on the team will apply updates or test backups
- 🔵You want the cloud-only features of Plausible or the scale of PostHog Cloud; paying those projects also funds the open-source code
Practical Tips Before You Switch
- Run both for a month. Add the new tracker alongside Google Analytics and compare. The numbers will not match exactly: cookieless tools count unique visitors differently, and bot filtering varies from tool to tool.
- Serve it over HTTPS on its own subdomain. A tracker loaded over plain HTTP is blocked on an HTTPS site. Our Nginx Proxy Manager guide covers the reverse proxy and certificate.
- Back up the database, not only the container. For Umami that is the PostgreSQL volume, for Plausible, Rybbit and Swetrix it is ClickHouse, and for GoatCounter and Medama it is a single data directory.
- Size the server for the database. The ClickHouse-based tools ask for 2 GB of RAM or more on their own. If analytics has to share a 1 GB VPS with other services, stay with Umami, GoatCounter or Medama.
- Watch it. An analytics server that is down silently loses data you cannot recover. Point an uptime monitor at it; Uptime Kuma is the usual choice.
Frequently Asked Questions
What is the best self-hosted Google Analytics alternative?
For most small and medium sites, Umami: permissive licence, light requirements and enough reports to grow into. Choose Plausible CE if you value simplicity above everything, and Matomo if you need the breadth of classic Google Analytics.
Do these tools need a cookie banner?
Plausible, Umami, Rybbit, GoatCounter, Swetrix and Medama are all designed to work without cookies, and GoAccess does not touch the browser at all. That removes the most common trigger for consent banners, but the final answer depends on the law that applies to you and on what else your site loads.
Can I import my Google Analytics history?
Matomo lists a Google Analytics importer among its features. For the other tools it depends on the version, so check the current documentation of the one you pick before you rely on it. Whatever you choose, export your GA4 data first: the Universal Analytics shutdown showed that history you do not hold can disappear.
How much server do I need?
From the projects' own guidance: Medama states 256 MB for most small sites; Plausible CE, Rybbit and Swetrix each recommend at least 2 GB; PostHog's hobby deployment recommends 4 GB. The Umami and GoatCounter READMEs give no fixed RAM figure; each is a single application process with a small database, so they are the usual picks for a shared small VPS.
The Bottom Line
Replacing Google Analytics is one of the easier self-hosting wins: the tools are mature, most install with a single Compose file, and the result is a dashboard you will open more often because it is readable. Start with Umami or Plausible CE, run it next to GA4 for a few weeks, and remove the Google tag once you trust the numbers.
You can browse every open-source option we track on the Google Analytics alternatives page. If this is your first service on a server of your own, start with our beginner's guide to self-hosting, and see the 15 best self-hosted apps for a home server for what to install next.