Self-Host Privacy Analytics Instead of Paying Per Pageview
Analytics vendors charge per pageview and hold your data. Here is how to self-host privacy analytics on a VPS, own the data, and pay a flat cost.
If you are paying an analytics vendor per pageview, or feeding your visitor data to a free tool that monetizes it, self-host a privacy-focused analytics app instead. Tools like Plausible and Umami are open source, run as a small container on a VPS, and give you clean traffic data without cookies, without a per-pageview meter, and without handing your users' behavior to a third party. The data lives on your box. The cost is flat. For most sites this is a strictly better deal than the SaaS version.
Why self-host analytics at all?
Three reasons, and they compound. First, cost: hosted privacy-analytics plans charge by monthly pageviews, so a site that grows gets a growing bill for what is fundamentally a cheap workload. Self-hosted, you pay for a small slice of a VPS you may already run, flat, regardless of traffic. Second, ownership: your analytics are your data about your users on your site, and renting that back from a vendor who can change terms or pricing is a weak position. I make the broader case in own your analytics data instead of renting Google's.
Third, privacy that is actually yours to promise. Cookie-less analytics tools do not track individuals across sites and do not need a consent banner in most jurisdictions. When you self-host, you can truthfully tell users their behavior never leaves your infrastructure, because it does not. That is a real trust signal, and it is only credible when you own the pipeline end to end.
How hard is it to self-host Plausible or Umami?
Not hard. Both ship as containers and drop into a Docker Compose stack. Umami is the lightest: a small app plus a Postgres database, which you may already be running for the app itself. Plausible is a bit heavier because it uses ClickHouse for its event store, but it is still a handful of containers in one Compose file with documented defaults.
The setup is the familiar pattern: add the services to your Compose stack, give the analytics app its own database, put it behind your reverse proxy on a subdomain, and let Caddy handle TLS. If you already run one reverse proxy for every app on the box, the analytics dashboard is just another upstream. Then you drop a tiny script tag on your site and data starts flowing. It is the same shape as self-hosting search instead of Algolia: a well-packaged open-source tool that runs fine on your own hardware.
What you get, and what you give up
What you get is a clean dashboard: top pages, referrers, countries, devices, and conversion goals, without the noise and complexity of the big analytics suites. For most sites that is exactly the data you actually use, and the lighter tools load a fraction of the JavaScript, so your pages stay fast. The privacy angle is a bonus that doubles as a feature you can market.
What you give up is the heavy machinery of enterprise analytics: deep funnel analysis across sessions, audience remarketing integrations, and the sprawling event models of the ad-driven platforms. If you are running paid acquisition at scale and need cross-channel attribution, self-hosted privacy analytics is not a full replacement. Be honest about which you need. Most site owners drastically over-estimate how much of the big-platform feature set they ever touch.
Back it up and keep it lean
The analytics database is data you care about, so it goes into the same backup routine as everything else on the box, off the machine and tested with a restore, per own your backups when you self-host. Analytics data is append-heavy and grows over time, so set a retention policy that matches how far back you actually look, and prune old raw events if the tool supports it. You rarely need per-visitor detail from three years ago.
Put a memory cap on the containers so an analytics spike during a traffic surge cannot starve your actual app, which shares the box. That is the standard discipline for running several apps on one VPS. Once it is set up, it runs quietly and costs you nothing per pageview ever again.
Owning your analytics is a small, high-leverage move. It cuts a recurring bill, removes a third party from your users' data, and keeps a clean record of your own traffic on your own box. Run it on HostSSH next to the site it measures, and stop paying a meter to learn about your own visitors.