Skip to content

Self-host Swetrix

updated Sep 2026prices checked · Jul 2026
We earn commissions when you shop through the links below. Full disclosure →

A cookieless, privacy-first Google Analytics alternative whose Community Edition bundles more than traffic: custom events, sessions and user flows, funnels, real-user performance monitoring and error tracking, with session replays available if you attach S3-compatible storage. The tracker script is under 5 KB. Licensed AGPL-3.0; the self-hosting repo's compose file runs the frontend, API, Redis and ClickHouse behind an nginx proxy. Alerts, email reports and the revenue/experiments/AI features are cloud-only.

Key facts

LicenseAGPL-3.0
StackTypeScript, Nest.js, ClickHouse, Redis
Min RAM2048 MB
Official imageyes
Difficulty
Our recommendation

Pick Swetrix when you want a cookieless Google Analytics replacement that also watches page performance and captures errors, in a compose file the project maintains for you — frontend, API, Redis and ClickHouse behind an nginx proxy. Read its Cloud-vs-Community table first: the self-hosted edition keeps traffic, events, sessions, funnels, performance and errors, and gives up alerts, email reports and the revenue/experiments/AI features.

What you need

  • Any VPS with at least 2048 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • Under an hour if you've used Docker before
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

Paid link — we earn a commission if you shop through it.

Install

Run these commands on your server:

# Swetrix Community Edition — the project's selfhosting repo: configure.sh writes .env, compose.yaml runs frontend + API + Redis + ClickHouse behind nginx on :80
git clone https://github.com/swetrix/selfhosting
cd selfhosting
./configure.sh    # asks for the public URL (BASE_URL), generates SECRET_KEY_BASE and the ClickHouse password, writes DISABLE_REGISTRATION=true
docker compose up -d   #  →  the BASE_URL you entered (nginx on port 80); the first sign-up is allowed despite DISABLE_REGISTRATION

What you take on

Swetrix is unusually clear about what the Community Edition leaves out, so the caveats are mostly its own words:

non-negotiableCloud-only, per the README's comparison table: revenue, experiments and AI features; alerts and notifications; weekly/monthly email reports. Teams are limited to direct project invites, password-protected links and public projects.
non-negotiableSession replays work in the Community Edition but require S3-compatible storage you provide (the SESSION_REPLAY_S3_* variables).
non-negotiableGeolocation in the Community Edition uses the DB-IP City Lite database (country/region/city only). The network panel — ISP, organisation, usage type — needs a paid MaxMind or DB-IP database pointed to by IP_GEOLOCATION_DB_PATH.
non-negotiableThe docs recommend at least 2 GB of RAM and support x86_64 or arm64. The compose file publishes only port 80; put your own TLS-terminating proxy in front for HTTPS.
non-negotiableconfigure.sh writes DISABLE_REGISTRATION=true into .env. Per the configuration docs that flag exempts the initial user, so your first sign-up works — but nobody else can register afterwards unless you flip it.

An alternative to

More in Web analytics

Web analytics

GoatCounter

The smallest serious web analytics server: a single statically compiled Go binary (or the project's own Docker image) writing to a SQLite file, with PostgreSQL optional for big sites. It counts unique visits without cookies or identifiers, tracks referrers, campaigns, browsers, locations and screen sizes, and offers a JavaScript-free tracking pixel, a backend API, and log-file import. Its own README says it doesn't need a GDPR notice. Licensed EUPL-1.2; the same author runs a free hosted service.
GoSQLite
easyRead guide →
Web analytics

Matomo

The full-featured Google Analytics alternative — goals, e-commerce tracking, and 100% data ownership, with funnels and heatmaps available as paid premium plugins. Heavier than Plausible, but the closest like-for-like replacement for GA's depth.
PHPMariaDB
moderateRead guide →
Web analytics

OpenPanel

An open-source web and product analytics platform that pitches itself as "the power of Mixpanel with the ease of Plausible": funnels, cohorts, user profiles, session history and replay, A/B tests, revenue tracking, real-time dashboards, and SDKs for web, iOS/Android and server-side events — cookieless. Licensed AGPL-3.0; the documented install clones a dedicated git branch, a setup quiz writes .env, and a start script brings up seven containers (Caddy, PostgreSQL, Redis, ClickHouse, API, dashboard, worker). Free to self-host with unlimited events, per its pricing page.
TypeScriptNext.jsFastifyPostgreSQLClickHouseRedis
moderateRead guide →
Web analytics

Plausible

Lightweight, privacy-friendly web analytics in a single dashboard — no cookies, no personal data, GDPR-friendly by default. The Google Analytics replacement you can actually read.
ElixirClickHousePostgreSQL
moderateRead guide →

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.