What Is Plausible?
Plausible is a lightweight, open-source web analytics tool that is privacy-focused and GDPR-compliant. It is a popular alternative to Google Analytics, offering simple dashboards without cookies or personal data collection.
Requirements
- A Breeze with at least 2 GB RAM
- Docker and Docker Compose installed
- A domain name with DNS configured
Step 1: Clone the Repository
git clone https://github.com/plausible/community-edition /opt/plausible
cd /opt/plausibleStep 2: Configure Environment
cp .env.example .env
nano .envSet these values:
BASE_URL=https://analytics.yourdomain.com
SECRET_KEY_BASE=$(openssl rand -base64 48)
TOTP_VAULT_KEY=$(openssl rand -base64 32)
DISABLE_REGISTRATION=invite_onlyStep 3: Start the Services
docker compose up -dStep 4: Set Up Nginx Reverse Proxy
server {
server_name analytics.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Step 5: Add SSL
sudo certbot --nginx -d analytics.yourdomain.comAdding the Tracking Script
Add this to your website's <head>:
<script defer data-domain="yourdomain.com" src="https://analytics.yourdomain.com/js/script.js"></script>Why Self-Host?
- Full data ownership — no third-party access
- No cookie banners required
- Lightweight script (under 1KB)
- No visitor tracking or personal data