Plausible Analytics
Self-hosted, privacy-friendly web analytics. No cookies, no personal data, full GDPR compliance by design.
2GB RAM minimum / 4GB recommended
Ubuntu 22.04 / 24.04 LTS
Domain name with DNS access
Introduction
Plausible Analytics is a lightweight, open-source, privacy-friendly alternative to Google Analytics. It provides essential website traffic insights without using cookies, collecting personal data, or requiring complex configuration. The tracking script is approximately 75 times smaller than Google Analytics, resulting in faster page loads and reduced bandwidth.
Plausible Community Edition (CE) is the self-hosted, AGPL-licensed version that gives you complete control over your analytics data. By deploying on a RamNode VPS, you get full data ownership, GDPR/CCPA/PECR compliance by design, and significant cost savings compared to managed services.
Plausible CE requires at least 2 GB of RAM due to the ClickHouse database engine. RamNode VPS plans start at just $4/month, making self-hosted Plausible significantly more affordable than managed analytics services.
Part 1: Server Preparation
1Connect to Your VPS
ssh root@YOUR_SERVER_IP2Update the System
apt update && apt upgrade -y3Install Docker and Docker Compose
curl -fsSL https://get.docker.com | sh
# Verify installation
docker --version
docker compose versionDocker Compose v2 is included with modern Docker installations. If docker compose version fails, install the plugin separately: apt install docker-compose-plugin
4Configure the Firewall
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable5Configure DNS
Point a subdomain to your VPS by creating an A record:
| Type | Name | Value | TTL |
|---|---|---|---|
| A | analytics | YOUR_SERVER_IP | 300 |
DNS propagation can take up to 24 hours (typically minutes). Verify with: dig analytics.yourdomain.com
Part 2: Deploying Plausible CE
1Clone the Community Edition Repository
mkdir -p /opt/plausible && cd /opt/plausible
git clone -b v3.2.0 --single-branch \
https://github.com/plausible/community-edition.git .2Create the Environment File
touch .env
# Set your domain (replace with your actual domain)
echo "BASE_URL=https://analytics.yourdomain.com" >> .env
# Generate and set a secure secret key
echo "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .env
# Disable public registration after creating your account
echo "DISABLE_REGISTRATION=invite_only" >> .envThe BASE_URL must match the exact domain where Plausible will be accessible, including https://. No trailing slash or path.
3Configure HTTPS with Automatic TLS
# Add port configuration to .env
echo "HTTP_PORT=80" >> .env
echo "HTTPS_PORT=443" >> .envCreate a compose override to expose ports:
services:
plausible:
ports:
- "80:80"
- "443:443"Plausible handles TLS certificate provisioning and renewal automatically. No separate reverse proxy or Certbot setup required.
4(Optional) Configure Email / SMTP
For traffic reports, password resets, and team invitations:
echo "MAILER_EMAIL=plausible@yourdomain.com" >> .env
echo "SMTP_HOST_ADDR=smtp.yourmailprovider.com" >> .env
echo "SMTP_HOST_PORT=587" >> .env
echo "SMTP_USER_NAME=your_smtp_username" >> .env
echo "SMTP_USER_PWD=your_smtp_password" >> .env
echo "SMTP_HOST_SSL_ENABLED=true" >> .envPopular SMTP providers: SendGrid, Mailgun, Amazon SES, Postmark. Most offer a free tier sufficient for Plausible notifications.
5Launch Plausible
cd /opt/plausible
docker compose up -d
# Monitor startup
docker compose logs -fWait until you see log output indicating the web server is listening (typically 1–2 minutes on first launch).
6Create Your Admin Account
Navigate to your Plausible URL (e.g., https://analytics.yourdomain.com). Fill in the registration form to create your admin account.
With DISABLE_REGISTRATION=invite_only, no one else can register unless you explicitly invite them from the dashboard.
7Verify the Deployment
- HTTPS is active (lock icon in browser address bar)
- Dashboard loads without errors
- All containers are healthy:
docker compose psPart 3: Adding & Tracking Sites
Add a Website
From your dashboard, click "+ Add a website". Enter your domain exactly as visitors see it (e.g., yourdomain.com without https://). Select your timezone and click "Add snippet."
Install the Tracking Script
Add this snippet to the <head> section of every page:
<script defer data-domain="yourdomain.com"
src="https://analytics.yourdomain.com/js/script.js">
</script>Platform-Specific Installation
| Platform | Where to Add |
|---|---|
| WordPress | Insert Headers and Footers plugin, or edit header.php |
| Static HTML | Paste into the <head> tag of every page |
| Next.js | Add to Head component in _app.js or app/layout.tsx |
| Ghost | Settings → Code injection → Site Header |
| Hugo / Jekyll | Base template or partials/head.html |
| Gatsby | gatsby-plugin-plausible or gatsby-ssr.js |
Additional Measurement Options
Enable extra tracking by changing the script filename:
| Feature | Script Filename |
|---|---|
| Outbound Link Clicks | script.outbound-links.js |
| File Downloads | script.file-downloads.js |
| Custom Events (CSS) | script.tagged-events.js |
| Hash-Based Routing | script.hash.js |
| All Combined | script.outbound-links.file-downloads.tagged-events.js |
You can track as many websites as you want from a single Plausible instance. Each site gets its own dashboard and tracking snippet.
Part 4: Google Search Console Integration
Display the search keywords visitors use to find your site directly in your Plausible dashboard — no Google code on your website required.
1Set Up Google Search Console
- Navigate to search.google.com/search-console and sign in.
- Click "Add a property" and choose Domain or URL prefix verification.
- Follow Google's instructions to verify ownership (DNS TXT record or HTML file).
2Create Google Cloud OAuth Application
- Go to console.cloud.google.com and create a new project.
- Navigate to APIs & Services → OAuth consent screen. Select "External" and create.
- On the Scopes page, add the Google Search Console API with read-only access.
- Add your Gmail as a test user.
3Generate OAuth Client Credentials
- Click Credentials → + Create Credentials → OAuth client ID.
- Set type to "Web application".
- Under Authorized redirect URIs, add:
https://analytics.yourdomain.com/auth/google/callback - Copy the Client ID and Client Secret.
The redirect URI must exactly match your BASE_URL followed by /auth/google/callback.
4Enable the API & Add Credentials
In Google Cloud Console, search for and enable the "Google Search Console API". Then add credentials to Plausible:
cd /opt/plausible
echo "GOOGLE_CLIENT_ID=your_client_id_here" >> .env
echo "GOOGLE_CLIENT_SECRET=your_client_secret_here" >> .env
docker compose down && docker compose up -d5Connect in Plausible Dashboard
- Go to your site settings → Integrations / Search Console.
- Click "Continue with Google" and authenticate.
- Select your Search Console property and save.
Google Search Console data is updated every 24–48 hours. If your OAuth app is in "Testing" status, tokens may expire after 7 days — publish to Production to avoid this.
Part 5: Setting Up Goals
Goals track specific visitor actions beyond pageviews. The Goal Conversions section appears at the bottom of your dashboard once configured.
Pageview Goals
Track visits to specific pages (thank-you pages, pricing, etc.):
- Site settings → Goals → + Add goal
- Select "Pageview" and enter the page path (e.g.,
/thank-you)
Use wildcards to match multiple pages:
| Goal Path | What It Tracks |
|---|---|
| /blog* | All pages under /blog |
| /docs/* | All documentation pages |
| /products/*/reviews | Review pages for any product |
Custom Event Goals — CSS Class Method
Use the tagged-events script extension and add CSS classes:
<!-- Track a button click -->
<button class="plausible-event-name=Signup+Click">
Sign Up Now
</button>
<!-- Track a CTA link -->
<a href="/demo" class="plausible-event-name=Demo+Request">
Request a Demo
</a>Custom Event Goals — JavaScript API
<script>
window.plausible = window.plausible || function() {
(window.plausible.q = window.plausible.q || []).push(arguments)
}
</script>
// Track a form submission
document.getElementById('signup-form')
.addEventListener('submit', function() {
plausible('Form Submission');
});
// Track with custom properties
plausible('Purchase', {
props: { plan: 'Pro', price: '49' }
});Automated Tracking Goals
- Outbound Link Clicks — Tracks all external link clicks
- File Downloads — Tracks PDF, ZIP, DOCX, etc.
- 404 Error Pages — Monitors broken pages
- Form Submissions — Tracks form submissions site-wide
Part 6: Maintenance & Administration
Updating Plausible CE
cd /opt/plausible
git fetch --tags
git checkout v3.x.x # Replace with latest version
docker compose pull
docker compose down && docker compose up -dAlways check the Plausible release notes on GitHub before upgrading. Some releases may require database migrations or configuration changes.
Backing Up Your Data
# Backup PostgreSQL
docker compose exec plausible_db \
pg_dump -U postgres plausible > backup_pg_$(date +%F).sql
# Backup ClickHouse (data directory)
docker compose stop plausible_events_db
tar czf backup_ch_$(date +%F).tar.gz \
/var/lib/docker/volumes/*event*
docker compose start plausible_events_dbSchedule automated backups using cron. For production, consider offsite backup storage.
Monitoring Container Health
docker compose ps
docker compose logs --tail=50
docker stats --no-streamEnvironment Variables Reference
| Variable | Description |
|---|---|
| BASE_URL | Full URL where Plausible is hosted |
| SECRET_KEY_BASE | Secret key (64+ bytes, base64) |
| DISABLE_REGISTRATION | Control who can register (invite_only) |
| GOOGLE_CLIENT_ID | OAuth client ID for Search Console |
| GOOGLE_CLIENT_SECRET | OAuth client secret for Search Console |
| MAILER_EMAIL | FROM address for notifications |
| SMTP_HOST_ADDR | SMTP server hostname |
| SMTP_HOST_PORT | SMTP server port |
| HTTP_PORT / HTTPS_PORT | Ports for built-in server & auto TLS |
