How to Install Plausible Analytics (Privacy-Friendly Web Analytics)

Plausible is a lightweight, privacy-focused, self-hosted web analytics platform — a cookie-free alternative to Google Analytics that doesn't require a cookie consent banner in most jurisdictions.

Prerequisites

  • Docker Engine and Docker Compose installed
  • A domain name for the Plausible dashboard
  • 2 vCPU, 2 GB RAM minimum

Step 1 — Clone the Official Docker Compose Configuration

git clone https://github.com/plausible/hosting.git plausible
cd plausible

Step 2 — Configure Environment Variables

cp plausible-conf.env.example plausible-conf.env
nano plausible-conf.env
BASE_URL=https://analytics.yourdomain.com
SECRET_KEY_BASE=GENERATE_A_LONG_RANDOM_STRING

Generate a secure secret key:

openssl rand -base64 64 | tr -d '\n'

Step 3 — Start Plausible

docker compose up -d

Step 4 — Add HTTPS via Nginx Proxy Manager

Route analytics.yourdomain.com to the Plausible container's port (typically 8000 by default in the official compose file) — see How to Install Nginx Proxy Manager with Docker.

Step 5 — Create Your Account

https://analytics.yourdomain.com/register

Step 6 — Add Your Website

In the dashboard, add your site's domain, then copy the provided tracking script.

Step 7 — Add the Tracking Script to Your Website

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

Add this to your website's <head> section — for WordPress, most SEO/analytics plugins support adding custom header scripts, or edit the theme header directly.

Step 8 — Verify Tracking Is Working

Visit your website, then check the Plausible dashboard for the recorded pageview — typically appears within seconds.

Why Plausible Doesn't Require a Cookie Banner

Plausible doesn't use cookies or collect personally identifiable information by design, which generally exempts it from cookie consent requirements under regulations like GDPR — though you should verify this aligns with your specific legal obligations, as this varies by jurisdiction and isn't legal advice.

Setting Up Goal Tracking

Configure custom events (button clicks, form submissions) for conversion tracking under your site's Goals settings in the dashboard.

Backing Up Plausible

docker exec plausible_events_db_1 clickhouse-client --query "BACKUP DATABASE plausible_events_db TO Disk('backups', 'backup.zip')"
docker exec plausible_plausible_db_1 pg_dump -U postgres plausible_db > plausible-postgres-backup.sql

Common Errors

No data appearing after adding the script — verify the script tag is correctly placed and data-domain matches exactly what you configured in the dashboard.

Registration disabled — by default, self-hosted Plausible may restrict new registrations after the first account; this is expected behavior for a single-owner instance.

Best Practices

  • Use a subdomain dedicated to analytics for clean separation
  • Back up both the ClickHouse and PostgreSQL databases regularly
  • Keep the platform updated for security and feature improvements

Continue Reading

Browse more articles in Popular Self-Hosted Applications.

  • plausible analytics, privacy analytics, google analytics alternative, self hosted analytics
  • 0 Bu dökümanı faydalı bulan kullanıcılar:
Bu cevap yeterince yardımcı oldu mu?

İlgili diğer dökümanlar

How to Install Nextcloud on a VPS with Docker

Nextcloud is a self-hosted file sync, sharing, and collaboration platform — a...

How to Install GitLab CE on a VPS

GitLab Community Edition is a full-featured, self-hosted DevOps platform — Git repository...

How to Install Ghost CMS on a VPS

Ghost is a modern, fast, purpose-built platform for blogging and newsletters — a lighter,...

How to Set Up a Minecraft Server on a VPS

Running your own Minecraft server gives you full control over mods, plugins, and world settings....

How to Install n8n for Workflow Automation

n8n is a self-hosted workflow automation tool — connecting apps and APIs through a visual...