---
title: "I Replaced Google Analytics with Plausible and My Site Got Faster"
description: "Google Analytics was slowing my site down and selling my visitor data. Plausible is privacy-first, lightweight, and self-hosted."
author: "troysk"
pubDate: 2026-06-11T00:00:00.000Z
tags: ["guide", "analytics", "docker", "plausible", "privacy"]
canonical_url: "https://selfhostedapp.com/blog/privacy-analytics-with-plausible/"
source_url: "https://selfhostedapp.com/blog/privacy-analytics-with-plausible.md"
---

# I Replaced Google Analytics with Plausible and My Site Got Faster

import { Picture } from 'astro:assets';
import PlausibleHero from '../../assets/images/heroes/plausible-hero.jpg';

<Picture src={PlausibleHero} formats={['avif', 'webp']} widths={[400, 800, 1200]} sizes="(min-width: 1024px) 768px, 100vw" alt="Plausible" class="rounded-xl border border-cream-300 dark:border-ink-700" />

Google Analytics is on eighty-six percent of websites and it is also forty-five kilobytes of JavaScript that slows down every page load and tracks your visitors across the web to build advertising profiles. Plausible is a lightweight privacy-first alternative with a one-kilobyte script and no cookies and GDPR compliance built in, so your analytics are accurate without compromising your visitors' privacy.

The script size difference matters more than you might think. Google Analytics adds forty-five kilobytes to every page load, which translates to seconds of extra loading time on slower connections. Plausible adds one kilobyte, which is essentially nothing. And because Plausible does not use cookies and does not track across domains, ad blockers do not block it, which means your analytics are more accurate because visitors who use ad blockers are counted instead of being excluded from your data.

Plausible needs Postgres as its database because the default setup uses a separate database container for storing analytics data. You create a compose file with both services, set the environment variables for the database connection and a secret key base and your analytics domain, run docker compose up, and wait for the database migration to complete. Open the port, create an account, and add your site by entering your domain name. Plausible gives you a tracking script that you add to your site's head tag, and it starts counting visitors immediately.

```yaml
services:
  plausible:
    image: ghcr.io/plausible/community-edition:latest
    ports:
      - "8000:8000"
    environment:
      - BASE_URL=https://analytics.yourdomain.com
      - SECRET_KEY_BASE=replace_with_64_char_random_string
      - DATABASE_URL=postgres://plausible:plausible@db:5432/plausible
    depends_on:
      - db
    restart: unless-stopped

  db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_USER=plausible
      - POSTGRES_PASSWORD=plausible
      - POSTGRES_DB=plausible
    volumes:
      - db-data:/var/lib/postgresql/data
    restart: unless-stopped

volumes:
  db-data:
```

The SECRET_KEY_BASE needs to be a long random string because Plausible uses it to sign session cookies and any other cryptographic tokens, and reusing the default in this example would let anyone forge sessions against your instance. Generate one with openssl rand -base64 64 and paste it in. The database service uses the alpine variant of Postgres because the analytics workload is mostly writes and reads of small aggregated rows, and you do not need the full Postgres image sitting around.

The dashboard is clean and focused, one page shows unique visitors and page views and top pages and referrers and countries and devices. No nested menus or custom report builders or fifty-step setup wizards. It shows you the numbers that matter on one screen and that is it. Goals let you track link clicks and form submissions and page visits without Google Tag Manager or complex event configuration, you just enter the CSS selector or URL path.

Shared dashboards let you give anyone a public link to your real-time stats without requiring them to log in. I have a public dashboard for this blog so anyone can see how many visitors we get, and transparency builds trust with readers.

Plausible made my site faster and my analytics more accurate and my visitors' privacy intact. If you are using Google Analytics the switch takes about ten minutes and your page speed score will thank you.

If you like what you read do subscribe to the newsletter for more privacy-focused tech guides.
