Self-Hosting Analytics with Plausible and Umami

Team 5 min read

#webdev

#analytics

#privacy

#self-hosting

Overview

Self-hosted analytics give you data ownership, flexibility, and stronger privacy controls for your sites. Plausible and Umami are two popular open-source options that are designed to be lightweight, privacy-conscious, and relatively easy to operate on a modern server. This post walks through the core ideas, how they compare, and practical steps to get both up and running so you can choose the approach that fits your needs.

Why self-host analytics

  • Data ownership and control: you own the data, not a third party.
  • Privacy-minded by default: disclosures, retention, and anonymization can be tuned to your policy.
  • Vendor independence: no platform lock-in and easier future migrations.
  • Cost predictability: after initial setup, hosting costs scale with your needs.

Plausible vs Umami: a quick comparison

  • Plausible
    • Focuses on a clean, modern analytics UI with privacy in mind.
    • Tends to appeal to teams that want a polished experience and straightforward integration.
    • Uses a self-hosted stack that’s commonly deployed via Docker Compose and a reverse proxy for TLS.
  • Umami
    • Known for being lightweight and easy to self-host, with flexible deployment options.
    • Often favored by teams that prefer a simple, low-friction setup and quick onboarding.
    • Again, Docker-based deployment is common, with a database backend and a Node-based app.

Both options prioritize privacy and avoid heavy tracking by default. The right pick depends on your UI preferences, the level of customization you need, and how much you want to tweak the deployment stack.

Planning and prerequisites

  • Domain and TLS: you’ll want a domain for your analytics dashboards and a TLS certificate (Let’s Encrypt is a common choice).
  • Server: a small VPS or a modest VM works (2–4 GB RAM is a typical starting point for light traffic).
  • Docker and Docker Compose: both projects offer Docker-based deployments, which simplify setup and upgrades.
  • Backups: plan regular backups of the database and any persistent volumes.
  • DNS and reverse proxy: configure a reverse proxy (Nginx, Traefik, or Caddy) to terminate TLS and route to the analytics services.

Getting started with Plausible self-hosted

  • Prepare the server with Docker and Docker Compose:
    • Update and install dependencies.
    • Ensure your firewall allows HTTPS traffic.
  • Obtain the official Plausible self-hosted stack:
    • The Plausible hosting repository provides a Docker Compose-based setup.
  • Bring up the services:
    • Clone the repository, configure environment variables, and start the stack with Docker Compose.
  • Configure a reverse proxy and TLS:
    • Point your domain to the server and set up TLS via Let’s Encrypt.
    • Route traffic to the Plausible services (web app and API).
  • Integrate your site:
    • Replace your website’s analytics snippet with Plausible’s snippet.
    • Start collecting data and verify dashboards load correctly.

Tips:

  • Follow the official Plausible self-hosted documentation for exact repo URLs and env file names.
  • Start with a single-domain setup to validate the flow before scaling to multiple sites.

Getting started with Umami self-hosted

  • Prepare the server similarly (Docker and Docker Compose installed).
  • Use Umami’s Docker-based deployment:
    • Clone the Umami repository and use the provided docker-compose.yml.
    • Configure environment variables for the backend (database connection, secrets) and the frontend.
  • Start the stack:
    • Bring up the services with Docker Compose.
  • TLS and proxy setup:
    • Configure a reverse proxy and TLS as with Plausible to secure access to the dashboards.
  • Integrate your site:
    • Use Umami’s analytics snippet on your site and verify data begins to appear in the dashboards.

Tips:

  • The Umami repo includes a straightforward docker-compose setup that many folks adopt for quick trials.
  • As with Plausible, start small (one domain) and expand as you validate reliability.

Deployment options and stack

  • Docker Compose (recommended for simplicity): quick to set up, straightforward upgrades, great for small teams.
  • Kubernetes or other orchestration: offers scale and resilience for higher-traffic sites but requires more operational overhead.

Common components you’ll encounter:

  • A web application container (the Plausible or Umami frontend/backend).
  • A database container (PostgreSQL or similar).
  • A caching/queue layer if the stack uses one (Redis is common).
  • A reverse proxy container or an external proxy to manage TLS and routing.

Data privacy and security considerations

  • Use TLS from day one to protect data in transit.
  • Minimize stored data: configure anonymization and retention policies to your comfort level.
  • Access controls: restrict who can view the dashboards and who can modify configurations.
  • Regular updates: keep the application, base images, and dependencies current to mitigate vulnerabilities.
  • Backups and disaster recovery: schedule regular backups of databases and any persistent volumes; test restore procedures.
  • Monitoring: implement basic uptime and health checks to catch issues early.

Maintenance and updates

  • Schedule periodic upgrades for both Plausible and Umami stacks to benefit from security patches and new features.
  • Automate backups: store copies in a separate location or object store.
  • Clean up old data as needed: adjust retention policies to balance insights with storage costs.
  • Check logs and resource usage: ensure CPU, memory, and disk space remain healthy; tune database connections if needed.
  • Security auditing: review exposed ports, firewall rules, and proxy configurations after upgrades.

Conclusion

Self-hosting Plausible or Umami empowers you to own your analytics, tailor data collection to your privacy standards, and avoid long-term vendor lock-in. Both stacks offer approachable Docker-based deployments, clear paths to production with TLS, and sensible defaults for privacy. Choose the option that best fits your team’s workflow, perform due diligence with backups and security, and you’ll gain reliable insights while keeping control of your data.