Skip to content
$_ setuptracking
Web Analytics

Self-Hosted Google Analytics Alternatives: Pick & Deploy

17 min read
Self-hosted Google Analytics alternatives compared by RAM, database and monthly cost

A self-hosted Google Analytics alternative is a web analytics tool you run on your own server — your VPS, your database, your data — instead of pushing visitor data into Google’s cloud. The intent behind that search is almost always the same: you want the numbers without handing the raw data to Google, and you’re willing to run something yourself to get there. This page is the decision layer for that choice: self-hosted analytics, picked properly. Pick the right tool for your traffic and skill level, then jump straight to the recipe that deploys it.

I’ll be blunt about one thing up front, because most listicles dodge it: there is no “self-hosted Google Analytics.” GA4 is SaaS-only. What you’re actually choosing is a Google Analytics alternative that happens to be open source and runnable on your own box — Plausible, Matomo, Umami, PostHog, or GoatCounter. They each cost something real to run, and that number is the part nobody quotes. So that’s where we’ll spend the time.

Why people search for a self-hosted Google Analytics alternative

The pull toward self-hosted analytics clusters around three motivations, and they overlap more than they conflict.

Data ownership. With GA4, the raw hit-level data lives in Google’s BigQuery export at best, and in Google’s sampled UI at worst. You don’t get the rows; you get Google’s aggregation of them. Self-hosting flips that: the events land in your ClickHouse or MariaDB, queryable with SQL, exportable, deletable, yours. That’s the core decision driver, and it’s the one GA4 can’t answer at any price.

GDPR and EU compliance. Since the 2022 CNIL and Austrian DSB rulings against Google Analytics, EU site owners have been nervous about sending visitor data across the Atlantic. A self-hosted tool on an EU VPS keeps the data in-region and, for the cookieless ones, never sets a tracking cookie in the first place — which sidesteps the consent-banner problem entirely. More on that below, because “GDPR-compliant by default” is a claim that needs an asterisk.

Cost and control at scale. GA4 is “free” until you hit the 10M-events-per-month sampling ceiling or want the un-sampled BigQuery export, and the privacy-first cloud tools (Plausible Cloud, Fathom) bill per pageview — fine at small scale, a real line item once you’re past a few hundred thousand pageviews a month. Self-hosting trades a monthly SaaS bill for a fixed VPS bill that doesn’t scale with traffic the same way.

If those three resonate, you’re in the right place. If you just want a privacy-friendly tool and don’t care about running a server, you don’t need this page — a cloud tier will serve you better, and I’ll say so again in the “wrong call” section.

First, the honest correction: you can’t self-host GA4 itself

This trips up a surprising number of searches — “self hosted google analytics,” “google analytics on premise” — so let’s clear it once. Google Analytics 4 is a closed, hosted SaaS product. There is no on-premise edition, no source code, no downloadable server, no license you can buy to run it in your own datacentre. Universal Analytics never had one either. When people say “self-hosted Google Analytics,” they mean one of two things:

  • A Google Analytics alternative that is open source and self-hostable — the real answer, and the rest of this page.
  • A self-hosted tag manager or server-side proxy that still forwards data to Google’s cloud. That’s a different problem (server-side tagging), and it doesn’t give you data ownership — the data still ends up in GA4.

So the corrected question is: which open-source analytics tool do I self-host to replace what GA4 does for me? Owning that correction matters — it’s the difference between chasing a product that doesn’t exist and shipping one that does.

GA4 cannot be self-hosted; privacy-first tools can What you cannot self-host GA4 itself — no on-premise build exists, at any price tier the data lives on Google infrastructure What you can self-host Plausible CE · Umami · Matomo GoatCounter · Counter.dev · PostHog every byte stays on your box So the real question is not “how do I self-host GA4” it is which replacement gives you the numbers you actually read

What “self-hosted analytics” actually buys you

Strip away the marketing and self-hosted analytics buys you exactly three things that a cloud GA4 cannot. Every one of these open-source tools is built on the same bargain, so it’s worth being precise about what the bargain actually is.

Read:  10 Open-Source Google Analytics Alternatives Worth Self-Hosting in 2025

First-party data, full fidelity. Every event hits your own server first. No sampling thresholds, no “this report is based on N% of sessions,” no data-retention caps imposed by someone else’s pricing tier. You hold the first-party data and you decide how long it lives. For anyone who’s watched a GA4 report quietly switch to sampled mode at the worst moment, this alone is the reason.

Real GDPR posture. Data on an EU VPS never leaves the EU, so the cross-border-transfer problem that sank GA4 in several DPA rulings simply doesn’t arise. Several of these tools (Plausible, Umami, Fathom, Matomo in cookieless mode) are also cookieless — no persistent identifier, no consent banner legally required in most EU interpretations. You own the processing, so you’re the data controller end to end. (The asterisk: self-hosting doesn’t make you compliant automatically — you still configure IP anonymization and retention. It removes the hardest problem, not all of them.)

Control of the stack. Open source means you can read the code, patch it, query the database directly, and never get held hostage by a pricing change or a sunset email. The trade is that you’re now the ops team. That’s the whole bargain of self-host: you swap a vendor’s risk for your own maintenance.

The candidates, by what they cost to run

Here’s the self-hosted analytics field, sorted roughly from cheapest-to-run to heaviest. Each one maps to a tested deploy recipe on this site — the blocks below tell you what it takes to run it yourself, not how to click around the dashboard. For the actual install, follow the recipe link.

Tool License RAM floor Where it runs Real cost Best for
Umami MIT ~256 MB Vercel + Neon (serverless) or any VPS €0/mo Personal sites, side projects
GoatCounter EUPL-1.2 ~128 MB Tiny VPS (single Go binary) ~$5/mo Hobby + minimal footprint
Plausible CE AGPL-3 ~2 GB (incl. ClickHouse) Hetzner CX22, Docker €3.79/mo The sensible default for most sites
Matomo GPLv3 ~2–4 GB Hetzner CX32, PHP + MariaDB €6.80/mo GA4 feature parity (goals, funnels, ecommerce)
PostHog MIT ~16 GB Hetzner CX42, Docker (ClickHouse + Postgres + Redis) €16.40/mo Product analytics, not just web stats

Plausible CE — the cheap, lightweight default

Plausible Community Edition is what I recommend to most people, and not by accident: it gives you the privacy-first, cookieless, single-screen analytics that 90% of sites actually use, with a resource footprint small enough to run on the cheapest serious VPS. It’s AGPL-3 licensed, so the self-hosted Community Edition is genuinely free — the catch with AGPL is that if you modify the code and offer it as a service, you owe those changes back, which doesn’t affect normal self-hosters at all.

To run it yourself you need a box with about 2 GB of RAM, because Plausible CE bundles ClickHouse under the hood. A Hetzner CX22 (2 vCPU / 4 GB) at €3.79/mo (Hetzner Cloud pricing) handles any site under roughly 5M events a month comfortably — that’s the cheapest credible self-host on the market. You stand it up with Docker Compose behind Caddy for auto-HTTPS. When you’re ready, follow the recipe to install Plausible on a Hetzner box; it’s about 20 minutes start to finish.

Matomo — the GA4 feature-parity heavyweight

If you came to self-hosting because you’d miss GA4’s features — goals, multi-touch attribution, funnels, ecommerce revenue, the GA4 data importer, even heatmaps via a paid plugin — Matomo is the open-source tool that matches them one for one. It’s GPLv3, PHP 8.3 + MariaDB, and it’s the heaviest of the “web analytics” options (PostHog is heavier but it’s a different category). Budget 2–4 GB of RAM depending on traffic.

The honest trade is operational weight: PHP + a relational database means more moving parts to patch and tune than Plausible’s appliance-like Docker stack. A Hetzner CX32 at €6.80/mo is the practical floor. If you genuinely need conversion attribution or ecommerce reporting and Plausible’s deliberately-minimal feature set won’t cut it, this is the pick — here’s how to self-host Matomo with MariaDB and Caddy.

Umami — minimal, fastest to stand up

Umami is the smallest tracker in the field: a sub-21 KB script, a clean dashboard, MIT licensed, written by a single maintainer. Its party trick is that you don’t even need a server — it deploys to Vercel’s free tier with a Neon Postgres database (also free), which means €0/mo at indie scale. That makes it the lowest-friction self-host setup that exists.

The trade-offs are real, though, and they’re the reason it’s not my universal default. On Vercel’s free tier your data sits on US infrastructure unless you pay for EU edge, which dents the EU-residency angle; the feature set is deliberately spartan; and you’re trusting two SaaS providers for hosting even though the code and data remain portable. For a personal site or a side project where you want pageviews and sources and nothing else, it’s perfect. Here’s how to deploy Umami on Vercel + Neon in about five minutes.

Read:  Plausible CE on Hetzner: 20-Minute Self-Host Setup with Caddy (€4.51/mo)

PostHog — product analytics, not just web stats

PostHog is the odd one out, because it isn’t a Google Analytics alternative in the pageviews sense — it’s product analytics: cohorts, funnels with conversion windows, session replay, feature flags, A/B tests, surveys, and SQL access to your event data. MIT licensed. Choose it only if you’re tracking product behaviour in an app or SaaS, not just measuring a content site.

The cost of that power is resources. PostHog’s self-host stack is ClickHouse + PostgreSQL + Redis + the app, which wants around 16 GB of RAM. A Hetzner CX42 at €16.40/mo is the realistic floor, and it’s the heaviest recipe in the library. If “I want to replace GA4 on my blog” is the job, this is overkill; if “I want Amplitude/Mixpanel but on my own server” is the job, this is exactly it — run PostHog in Docker.

GoatCounter — the $5 hobby-tier pick

GoatCounter deserves a mention as the genuine minimalist option. It’s a single Go binary (EUPL-1.2 licensed), so the RAM floor is tiny — it’ll run happily on the smallest VPS you can rent, around $5/mo. No Docker, no database server to babysit beyond an optional Postgres; SQLite works for small sites. It does pageviews, referrers, and basic breakdowns and stops there by design. If your goal is “the absolute cheapest, lightest self-hosted counter and I will never need funnels,” GoatCounter is the answer. For most people Plausible CE is a better default, but the cheapest-tier slot is GoatCounter’s.

Self-hosted analytics tools by RAM and monthly server cost Sized on real boxes — RAM drives the bill TOOL RAM FLOOR HETZNER PLAN PER MONTH GoatCounter SQLite, single binary 1 GB smallest VPS ~5 USD Plausible CE bundles ClickHouse 2 GB CX22 3.79 EUR Matomo MySQL + archiving cron 2-4 GB CX32 6.80 EUR PostHog ClickHouse + Postgres + Redis 16 GB CX42 16.40 EUR

Decision matrix: traffic, budget, skill, compliance

The list above is useless without a decision. Choosing self-hosted analytics comes down to four variables; here’s how each one maps to a pick. Read across your row.

Your situation Pick Why
Content site, <5M events/mo, want it done right Plausible CE Cookieless, cheap, low-maintenance default
Personal site / side project, want it free Umami (or GoatCounter) €0–$5/mo, minutes to stand up
Need goals, funnels, ecommerce, attribution Matomo Only open-source tool with GA4 feature parity
Tracking product behaviour in an app/SaaS PostHog Cohorts, replay, flags — not just pageviews
EU site, consent-banner-free is the priority Plausible CE or Umami on EU VPS Cookieless + in-region = simplest GDPR posture

If your row still feels ambiguous — say you’re between Plausible and Matomo — the tie-breaker is almost always features versus simplicity. Don’t take on Matomo’s operational weight for features you won’t use. When in doubt, run the Stack Picker; it asks six questions and scores the five tools against your answers.

Where do you run it? (VPS sizing in one table)

“Self-hosted” means you must run it somewhere, and the somewhere is almost always a VPS. The good news: these tools are light enough that a cheap European VPS covers nearly every case. The figures below are the floors I’d actually deploy on, mapped to real Hetzner SKUs.

Tool VPS floor Spec €/mo Deploy method
Umami Vercel free tier Serverless + Neon Postgres €0 Git push, no server
GoatCounter Smallest VPS 1 vCPU / 1 GB ~$5 Single Go binary
Plausible CE Hetzner CX22 2 vCPU / 4 GB €3.79 Docker Compose + Caddy
Matomo Hetzner CX32 4 vCPU / 8 GB €6.80 PHP + MariaDB (or Docker)
PostHog Hetzner CX42 8 vCPU / 16 GB €16.40 Docker Compose (multi-service)

Two practical notes. Shared hosting is mostly a no — see the FAQ — because these stacks want Docker or a long-running process, neither of which typical cPanel shared plans allow. And pick an EU region (Falkenstein, Helsinki, Nuremberg) if data residency is part of why you’re doing this in the first place.

The real 3-year cost vs GA4 “free”

GA4 is free in cash and expensive in everything else. The fair comparison is total cost of ownership over three years, because self-hosting front-loads setup time and then runs cheap. Rough numbers, Plausible CE as the example default:

  • VPS: €3.79/mo × 36 = ~€136 over three years.
  • Setup: ~20–30 minutes once, following a recipe. Call it an hour with DNS propagation.
  • Maintenance: a Docker pull and restart every couple of months for updates — minutes, not hours.
  • GA4 equivalent: €0 cash, but sampled data, US data residency, consent-banner overhead, and zero ownership of the raw rows.

So the self-host bill is roughly €160 over three years for full data ownership and a clean GDPR posture — less than a single month of most paid privacy-analytics cloud plans at moderate traffic. For the full breakdown across all five tools, including the heavier PostHog math, use the 3-year self-hosted cost calculator. The point isn’t that self-hosting is always cheaper — at tiny scale a cloud free tier wins on cash — it’s that the cost is fixed and predictable, and you know exactly what you’re paying for.

Read:  How to Add GA4 Tracking Code to Your Website
Three-year cost of self-hosting compared with GA4 Three years, both columns filled in honestly Self-hosted on a CX22 ~136 EUR over 36 months 3.79 EUR/mo server, all data yours plus 1-6 hrs/month of upkeep the hours are the real price GA4 “free” 0 EUR cash sampled data · US data residency consent-banner overhead · no ownership paid for in data, not in euros Price your own hour before calling either one cheaper at 3 hrs/month, the 136 EUR box stops being the budget option

When self-hosting is the WRONG call

I’ll lose some readers here, and that’s the point — nobody else in these search results will tell you not to do it. Self-hosting is the wrong call when:

  • You’re under ~10k events/month with no GDPR pressure. A free cloud tier (Plausible Cloud’s small plan, Fathom’s trial, even GA4 if compliance isn’t your problem) is genuinely fine. You’d be spinning up a server to save a problem you don’t have.
  • Nobody on the team can SSH into a box. Self-hosting means you own uptime, backups, and security patches. If a broken analytics server on a Sunday is a crisis with no one to fix it, the maintenance burden outweighs the ownership win — pick a managed tool.
  • You need GA4’s ad-platform integrations. If your reporting depends on Google Ads conversion import or the Google Ads audience handshake, no self-hosted tool replicates that — it’s the one thing GA4’s lock-in actually buys you.
  • Your traffic is genuinely huge and spiky. Above tens of millions of events a month, the ops effort to keep ClickHouse healthy under load is real engineering work. At that scale, do the math honestly — managed might win on total effort.

If none of those describe you, self-hosting is the right call and the rest is just picking a tool and following a recipe.

Your next step: pick → recipe → cost

The whole point of this page is that it ends in an action, not a list. Here’s the path:

  1. Pick using the decision matrix above — or run the Stack Picker if you want it scored for you.
  2. Deploy with the matching recipe: install Plausible on a Hetzner box, self-host Matomo, deploy Umami, or PostHog in Docker. Browse the full install-recipe library for the complete set.
  3. Know the cost before you commit with the 3-year self-hosted cost calculator.

If consent and cookies are the heart of why you’re moving off GA4, read the cookieless tracking patterns next — that’s where the GDPR story gets concrete. Otherwise: pick one, deploy it, own your data.

FAQ

What is the best self-hosted Google Analytics alternative?

For most sites, Plausible Community Edition is the best self-hosted Google Analytics alternative: it’s cookieless, AGPL-3 open source, light enough to run on a €3.79/mo VPS, and covers the pageviews-and-sources reporting that the majority of sites actually use. “Best” is conditional, though. If you need GA4-style goals, funnels, and ecommerce attribution, Matomo is the better fit. If you want the cheapest, lightest possible setup, Umami (free on Vercel) or GoatCounter (~$5/mo) win. And if you’re tracking product behaviour in an app rather than web stats, PostHog is a different category entirely. The right answer depends on traffic, budget, required features, and how much server maintenance you’re willing to own — the decision matrix on this page maps each situation to a pick.

Is there a free open-source alternative to Google Analytics?

Yes — several, and all the major self-hosted options are open source. Umami (MIT) is genuinely free to run on Vercel’s free tier with a Neon database: €0/mo at indie scale. Plausible CE (AGPL-3), Matomo (GPLv3), PostHog (MIT), and GoatCounter (EUPL-1.2) are all free software too — you don’t pay a license fee, you only pay for the server you run them on. So “free” splits in two: the software is free; the hosting is the cost, and it ranges from €0 (Umami serverless) to €16.40/mo (PostHog on a 16 GB box). Open source also means you can read, patch, and query the code and data directly, which is the deeper kind of “free.”

Can you actually self-host Google Analytics itself?

No. Google Analytics 4 is a closed, hosted SaaS product — there is no on-premise edition, no source code, and no license you can buy to run GA4 on your own server. Universal Analytics never had one either. When people search for “self-hosted Google Analytics,” they actually want an open-source alternative to GA4 that they can run themselves: Plausible, Matomo, Umami, PostHog, or GoatCounter. The only thing you can self-host that still touches Google’s stack is a server-side tag manager or proxy — but that forwards data to GA4, so it doesn’t give you data ownership. If owning your data is the goal, the answer is always an alternative tool, never GA4 itself.

How much does it cost to self-host analytics vs GA4?

GA4 costs €0 in cash but charges you in sampled data, US data residency, and zero ownership of the raw rows. A self-hosted alternative costs a fixed, predictable VPS bill instead. Plausible CE on a Hetzner CX22 is ~€3.79/mo — about €136 over three years — plus an hour of one-time setup and a few minutes of maintenance per quarter. Umami can be €0/mo on Vercel’s free tier; GoatCounter runs around $5/mo; Matomo wants ~€6.80/mo for a bigger box; PostHog ~€16.40/mo because it runs ClickHouse, Postgres, and Redis together. The honest summary: at tiny scale GA4 or a cloud free tier wins on cash, but self-hosting buys fixed costs and full data ownership. The 3-year cost calculator on this site breaks down every tool.

Is self-hosted analytics GDPR-compliant by default?

Mostly, but not automatically — it removes the hardest problem rather than every problem. Hosting on an EU VPS keeps visitor data in-region, which sidesteps the cross-border-transfer issue that led the CNIL and Austria’s DSB to rule against Google Analytics in 2022. Several tools (Plausible, Umami, Fathom, Matomo in cookieless mode) also set no tracking cookie and store no persistent identifier, which means no consent banner is legally required under most EU interpretations. But you’re now the data controller, so you still configure IP anonymization, set a sane data-retention period, and document your processing. Self-hosting hands you the levers; compliance is you pulling them. It’s a far stronger starting posture than GA4, just not a checkbox.

Which self-hosted analytics tool is easiest to run?

Umami is the easiest by a wide margin because it doesn’t need a server at all: you deploy it to Vercel’s free tier with a Neon Postgres database, push from git, and you’re live in about five minutes with no Docker, no TLS config, and no cron. The trade-off is that your data sits on US infrastructure unless you pay for EU edge. After Umami, Plausible CE is the easiest real-server option — one Docker Compose file behind Caddy for automatic HTTPS, about 20 minutes on a Hetzner box. Matomo (PHP + MariaDB) and especially PostHog (a multi-service Docker stack) are meaningfully more work to stand up and keep healthy, which is the price of their bigger feature sets.

Do I need a VPS to self-host analytics, or can I use shared hosting?

You almost always need a VPS, not shared hosting. These tools run as long-lived processes (Plausible, PostHog, GoatCounter) or expect Docker (Plausible, PostHog) or a PHP runtime you control (Matomo) — and typical cPanel shared plans block long-running processes, Docker, and root access, so they can’t run the stack properly. The cheapest path that does work is a small European VPS: a Hetzner CX22 at €3.79/mo runs Plausible CE comfortably for any site under ~5M events a month. The one exception is Umami, which dodges the question entirely by deploying serverless to Vercel’s free tier with a Neon database — no VPS, no shared hosting, no server at all.


Found this useful?

Try the Stack Picker to get a personal recommendation, or browse the install recipe library.