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
- How to Install Matomo Analytics
- How to Install Docker Compose on Ubuntu & Debian
- How to Install Nginx Proxy Manager with Docker
Browse more articles in Popular Self-Hosted Applications.
