Self-hosted

Self-hosted product analytics on one Go binary

Run Pug on your own servers and every event stays in your infrastructure. It is the same build as Pug Cloud, under AGPL-3.0, with no license fee and no event limit.

Why self-host

Why teams run analytics themselves

Events stay on your servers

Events are written to your own ClickHouse and never sent to a third party.

Your region, your access rules

You choose where the servers run and who can reach them, which simplifies GDPR and data-residency requirements.

Code you can audit

Under AGPL-3.0 you can read every line, check how events are processed, and change what you need.

No per-event bill

Self-hosting is free. You pay for your own hardware, and nothing per event.

The stack

One binary and three dependencies

One Go process runs the API and every worker. PostgreSQL, ClickHouse, and NATS are the only other services to run.

SDK track() and identify()
API Connect RPC ingest
NATS Queues every event
Workers Write events and profiles
ClickHouse Stores the events
Dashboard Insights and profiles
Your infrastructure
  • Go binary The API and every worker, in one process
  • PostgreSQL Accounts, projects, and config
  • ClickHouse Every event
  • NATS The event queue
What you get

The full product on your servers

Self-hosted Pug is the build Pug Cloud runs, not a reduced edition.

  • Autocapture: page views, clicks, scrolls, form submits, rage and dead clicks
  • Six insight types: Trends, Funnels, Retention, Segmentation, User flow, Top K
  • Unified profiles: identify() merges anonymous activity into one person
  • Dashboards with a shared time window, period-over-period comparison, and public links
  • The MCP server, at /mcp on the same host as the API
  • SSO through Google Workspace or your own OIDC identity provider, with verified domains and Require SSO
FAQ

What people ask about self-hosting

What is self-hosted analytics?

Analytics software you run on your own servers, so all visitor and event data stays inside your infrastructure instead of being sent to a third-party cloud. Pug is built to be self-hosted this way under AGPL-3.0.

What do I need to run Pug?

Pug is a single Go binary backed by PostgreSQL (config), ClickHouse (events), and NATS (the queue). One process runs the API and every worker, so the operational footprint is small. See the setup guide for specifics.

Is self-hosting really free?

Yes. Free forever under AGPL-3.0, with no event limits or licensing fee. You provide the infrastructure; Pug provides the software.

Can we sign in with our own identity provider?

Yes. Org admins connect Okta, Microsoft Entra ID, Keycloak or any other OIDC provider from the dashboard, or the operator adds one for the whole server. An identity provider on your internal network works too, and a server that can’t see public DNS verifies domains from the command line. SSO ships in the same AGPL-3.0 build as everything else, not in a paid edition.

Can I move between Pug Cloud and self-hosting?

Both run the same code, and on either one a private key reads every raw event back through the API. There is no built-in migration between the two yet.

How is this different from Google Analytics?

Google Analytics is free but Google-hosted. Your data lives on their infrastructure. Self-hosted Pug keeps every event on your servers, unsampled, and open source.

Try it before you deploy it.

The live demo is the dashboard you would run, on a sample pet shop. Or start on Pug Cloud, which runs the same code.

Questions? Email hello@pug.sh