Back to Blog
analyticsprivacyplausibleself-hostingtutorial

Self-Host Plausible Analytics with InfraPilot — Privacy-First Website Stats

I

InfraPilot Team

March 16, 2026

Why Self-Host Plausible?

Plausible Cloud costs $9–19/mo depending on traffic. The self-hosted Community Edition is free. More importantly, self-hosting means all your analytics data stays on your own server — no third-party SaaS has access to your visitor data. For GDPR-conscious teams and privacy-first products, this is a significant advantage.

Prerequisites

  • VPS with at least 2 GB RAM (Plausible's ClickHouse dependency is memory-hungry)
  • Docker installed
  • InfraPilot installed: curl -fsSL https://infrapilot.org/install.sh | bash
  • A domain for your analytics dashboard (e.g. analytics.yourdomain.com)

Step 1 — Get the Official Compose File

Plausible maintains an official self-hosted repository:

git clone https://github.com/plausible/community-edition plausible
cd plausible

Copy and configure the environment file:

cp plausible-conf.env.example plausible-conf.env

Edit plausible-conf.env and set the required values:

BASE_URL=https://analytics.yourdomain.com
SECRET_KEY_BASE=$(openssl rand -base64 48)
TOTP_VAULT_KEY=$(openssl rand -base64 32)

Step 2 — Start the Stack

docker compose up -d

The first start takes a few minutes — ClickHouse needs to initialise its database. Check progress with:

docker compose logs -f plausible

Wait until you see Access PlausibleWeb.Endpoint at http://localhost:8000.

Step 3 — Expose via InfraPilot

  1. InfraPilot dashboard → Traffic → Proxy Hosts → Add Proxy Host
  2. Domain: analytics.yourdomain.com
  3. Forward host: plausible, port: 8000
  4. Enable Let's Encrypt SSL and force HTTPS
  5. Save — certificate issued automatically

Navigate to your analytics domain and create your admin account on first visit.

Step 4 — Add the Tracking Script to Your Site

In Plausible admin, add your website. You'll get a tracking snippet:

<script defer data-domain="yoursite.com"
  src="https://analytics.yourdomain.com/js/script.js"></script>

Add this to your site's <head>. Because it's self-hosted, the script is served from your own domain — bypassing most ad blockers and requiring no cookie consent banner for GDPR compliance.

Monitoring Plausible with InfraPilot

Plausible runs three containers: the main Elixir application, ClickHouse (the analytics database), and PostgreSQL. InfraPilot shows all three in your container dashboard with live memory and CPU stats. ClickHouse is the heaviest — watch its RAM usage and set an alert if it exceeds 1.5 GB to avoid OOM kills.

Plausible also exposes an API you can query for custom reports — useful for embedding stats in internal dashboards.