Knowledgebase › Self-Hosting › Plausible analytics on a LYLIX VPS - privacy-friendly replacement for Google Analytics

Plausible analytics on a LYLIX VPS - privacy-friendly replacement for Google Analytics

Plausible is a privacy-focused web analytics tool: no cookies, no personal data collection, GDPR/CCPA-compliant by design. It self-hosts cleanly on a single VPS. This article covers the install and the operational considerations.

Why self-host instead of using their SaaS

  • Cost: hosted Plausible scales with page-view volume. Self-hosted is fixed.
  • Data residency: your analytics data stays on your server.
  • No third-party in the request path of your visitors.
  • You can leave the script-blocker-bypass tricks unconfigured if you don't need them.

Trade-offs: you operate the thing. For very small sites (a few hundred visits/month), SaaS Plausible at $9-19/month is less work than self-hosting.

Sizing

  • Small (a few sites, <100k page views/month): 2 GB RAM, 1 CPU, 20 GB disk.
  • Medium (multiple sites, 1M+ page views/month): 4 GB RAM, 2 CPU, 50+ GB.
  • Large: ClickHouse memory grows with query volume — scale RAM, watch query performance.

The footprint is dominated by ClickHouse (the columnar DB Plausible uses). PostgreSQL is small by comparison.

Install via Docker

The recommended path. Plausible publishes a docker-compose.yml that includes all the dependencies:

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

# Generate a secret key base
openssl rand -base64 48

Edit .env:

BASE_URL=https://analytics.example.com
SECRET_KEY_BASE=<the-rand-base64-output>
TOTP_VAULT_KEY=<another-32-byte-secret>

# Optional: SMTP for invite emails
SMTP_HOST_ADDR=smtp.mailgun.org
SMTP_HOST_PORT=587
SMTP_USER_NAME=postmaster@example.com
SMTP_USER_PWD=<password>
MAILER_EMAIL=plausible@example.com

Start:

docker compose up -d

Plausible listens on port 8000. Reverse-proxy nginx in front for TLS.

First-time setup

Open https://analytics.example.com/register. The first registered user becomes the admin. After creating the admin, disable open registration:

# In .env
DISABLE_REGISTRATION=true

Restart the container.

Adding a site

  1. Plausible UI → Sites → Add site.
  2. Enter domain.
  3. Plausible gives you a script tag to add to your website's <head>:
    <script defer
        data-domain="example.com"
        src="https://analytics.example.com/js/script.js">
    </script>
  4. Deploy that to your site.
  5. Wait a few minutes; events flow into the dashboard.

Bypassing ad-blockers

Many ad-blockers (and some browsers natively) block requests to known analytics paths. Plausible's script is sometimes caught. Options:

  • Proxy through your own domain. Serve the Plausible script and event endpoint from your main site's domain. nginx proxy_pass to the analytics host. Ad-blockers can't tell it's analytics.
  • Custom event names. Less effective in 2026 as blockers improve at fingerprinting.

The proxy approach feels uncomfortable to some site owners who'd rather respect the user's blocker. That's a values decision, not a technical one.

Goals and custom events

Plausible tracks pageviews by default. For more:

  • Goals — track when users hit a specific URL or complete a custom event. Useful for funnels.
  • Custom events — call plausible('Event Name') from your JS to track arbitrary events.
  • Outbound links / file downloads — built- in extensions enabled via UI.

API access

Plausible exposes a Stats API for programmatic access:

curl -H "Authorization: Bearer <api-key>" \
    "https://analytics.example.com/api/v1/stats/aggregate?site_id=example.com&period=30d"

Useful for building custom dashboards or embedding stats in your own admin UI.

Backup strategy

  • PostgreSQL — pg_dump nightly.
  • ClickHouse — clickhouse-backup utility, or replicated BACKUP/RESTORE commands for larger setups.
  • The Docker compose .env and config — version control.

For most self-hosted Plausible deployments, the data isn't mission-critical (you can lose a week of analytics and survive). Don't over-engineer backups; nightly to off-host is plenty.

Updates

cd /opt/plausible
git pull
docker compose pull
docker compose up -d

Plausible publishes minor version updates monthly, occasional major updates. Read the changelog for major versions — migrations can take a few minutes on large databases.

Compliance angle

Plausible is designed to not need a cookie banner under GDPR/CCPA because:

  • No cookies are set.
  • No personal data is collected.
  • IPs are hashed and discarded.

Verify with your own legal counsel for your jurisdiction — "likely doesn't need a banner" isn't "definitely doesn't need a banner." Most regulators have been fine with Plausible.

When Plausible isn't the right tool

  • You need ecommerce funnel analytics across many products — purpose-built tools (Mixpanel, Amplitude) are deeper.
  • You need session replay or heatmaps — different category.
  • You want to do SEO keyword research from your own analytics — not Plausible's strength.

For "how many visits did my pages get, where from, what was popular?" Plausible answers it with very little operational burden.

Related Articles

Ready to deploy? Spin up a VPS at LYLIX — instant provisioning, full root, self-service portal.
Deploy a VPS for self-hosting →

← All Self-Hosting articles