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.
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
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 :80git clone https://github.com/swetrix/selfhostingcd selfhosting./configure.sh # asks for the public URL (BASE_URL), generates SECRET_KEY_BASE and the ClickHouse password, writes DISABLE_REGISTRATION=truedocker compose up -d # → the BASE_URL you entered (nginx on port 80); the first sign-up is allowed despite DISABLE_REGISTRATION
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.