Google Analytics 4 will tell you almost anything about your visitors except the one thing that matters most: whether you are allowed to collect it. GA4 needs a cookie banner, a consent management platform, a privacy policy that names Google as a processor, and — in parts of the EU — a legal basis that regulators keep litigating. For a personal blog, that is an absurd amount of overhead for a pageview count.

Plausible Analytics is the alternative built for that gap. It is a single-page, cookie-free tracker, open source, and self-hostable. It collects no personal data, needs no consent banner, and produces one clean dashboard with the numbers that actually inform content decisions. This guide covers a real Docker deployment, the reverse-proxy configuration, custom events, and the legal details worth knowing before you rely on it.

Plausible counts visitors without storing anything on the device. It derives a daily-changing hash from IP address plus user agent plus a rotating salt, keeps no raw IP, and discards the salt every 24 hours. The consequence: a visitor is counted once per day, cannot be re-identified across days, and no cookie is set at all.

In practice that means:

  • No consent banner. Under GDPR and the ePrivacy Directive, consent is required for storing or reading information on a device. Plausible does not do that, so the banner is not needed — the reason its own site has no cookie popup.
  • No data sales, no third-party requests. The script is served from your domain, so visitor IPs never reach Google, and no adtech signal is generated.
  • A dashboard you can read in ten seconds. Pageviews, unique visitors, referrers, top pages, countries, devices. No attribution models, no funnel builder, no sampling.
  • It is tiny. Around 1 KB of script versus ~45 KB for GA4, which is a real Core Web Vitals difference on mobile connections.

The trade-off is equally honest: no cross-site tracking, no user-level funnels, no ad-network integration, and a hard daily deduplication limit. If you need to follow one specific user through a checkout, Plausible is not that tool.

Prerequisites

  • Docker and Docker Compose v2 — see Docker basics for the homelab.
  • At least 1 GB RAM and about 1–2 GB of disk for a small site. Plausible ships Postgres and ClickHouse, so it is heavier than a static-service container but still modest.
  • A reverse proxy for HTTPS — Caddy is two lines, or any proxy you already run.
  • A domain for the dashboard, e.g. stats.example.com.

Step 1: Docker Compose deployment

Plausible’s self-hosted edition needs three backing services: Postgres for accounts and site config, ClickHouse for the event store, and Redis for caching. Create a directory and a .env first:

# openssl rand -hex 32 for each of these
BASE_URL=https://stats.example.com
SECRET_KEY_BASE=***
TOTP_VAULT_KEY=***

POSTGRES_PASSWORD=***
CLICKHOUSE_PASSWORD=***

Then docker-compose.yml:

services:
  plausible_db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    volumes:
      - db-data:/var/lib/postgresql/data
    restart: unless-stopped

  plausible_events_db:
    image: clickhouse/clickhouse-server:24.3-alpine
    environment:
      - CLICKHOUSE_SKIP_USER_SETUP=1
    volumes:
      - event-data:/var/lib/clickhouse
      - event-logs:/var/log/clickhouse-server
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    restart: unless-stopped

  plausible:
    image: ghcr.io/plausible/community-edition:v2
    command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
    ports:
      - "127.0.0.1:8000:8000"
    depends_on:
      - plausible_db
      - plausible_events_db
    environment:
      - BASE_URL=${BASE_URL}
      - SECRET_KEY_BASE=${SECRET_KEY_BASE}
      - TOTP_VAULT_KEY=${TOTP_VAULT_KEY}
      - DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@plausible_db:5432/plausible_db
      - CLICKHOUSE_DATABASE_URL=http://plausible_events_db:8123/plausible_events_db
    restart: unless-stopped

volumes:
  db-data:
  event-data:
  event-logs:

Three details that prevent the classic failures:

  1. All three secrets must be generated. SECRET_KEY_BASE signs sessions; TOTP_VAULT_KEY encrypts 2FA seeds. Reusing a sample value from a tutorial is a real risk if the instance is public.
  2. ulimits.nofile on ClickHouse is not optional. Without it, ClickHouse refuses to start on many default Docker hosts with a cryptic “max file descriptors” error.
  3. Bind to 127.0.0.1 so port 8000 is not reachable from the network — traffic goes through your proxy only.

Start it:

docker compose up -d
docker compose logs -f plausible

The first boot runs migrations and takes a minute or two. When you see the health check succeed, the dashboard is live at http://127.0.0.1:8000.

Step 2: Reverse proxy with HTTPS

Caddy, matching the reverse-proxy guide:

stats.example.com {
    reverse_proxy 127.0.0.1:8000
}

Reload Caddy and visit https://stats.example.com. Create the first account immediately — on a fresh instance that registration form is open to anyone who arrives before you, exactly as with Dokploy’s admin panel. If the instance is public, disable further signups in the settings afterwards.

Step 3: Add your site and install the script

In the dashboard, add a site with your domain, e.g. devdailytips.com. For an Astro site, add the tracking snippet to the base layout so it loads on every page:

---
const domain = "devdailytips.com";
const scriptSrc = "https://stats.example.com/js/script.js";
---
<script is:inline defer data-domain={domain} src={scriptSrc}></script>

Put it in <head> or at the end of <body>; defer keeps it off the critical path. Then visit your site and confirm a pageview arrives in the dashboard within a few seconds.

If the site is behind Cloudflare, that works fine — but exclude the dashboard subdomain from the proxy or make sure websockets pass through, otherwise the live view will not update.

Pageviews are the baseline. The useful part is tracking actions, and Plausible does it with attributes rather than JavaScript calls:

<a href="/download" class="plausible-event-name=Download">Download</a>
<button class="plausible-event-name=Newsletter+Signup">Subscribe</button>

Or from code:

window.plausible?.("Signup", { props: { plan: "free" } });

The + becomes a space in the event name. You can pass up to 30 custom properties per event, each event counts against your plan’s event limit, and none of it touches device storage. For a blog, three events cover most needs: outbound link clicks, newsletter signups and search usage.

One caveat worth knowing: events are attributed to a session, and because there is no persistent identifier, a returning visitor starts a fresh session each day. Good for privacy, mildly annoying if you want long-term per-user funnels.

Step 5: Backups and maintenance

Two stateful pieces: Postgres (sites, users, settings) and ClickHouse (all the events). Nightly dumps:

docker exec -t plausible_db pg_dumpall -c -U postgres > /backup/plausible-db-$(date +%F).sql
docker exec -t plausible_events_db clickhouse-client --query \
  "BACKUP DATABASE plausible_events_db TO Disk('backups', 'events-$(date +%F).zip')"

The ClickHouse backup needs the backups disk configured in its config; the simpler alternative for a small site is a volume snapshot:

docker run --rm -v event-data:/data -v /backup:/backup alpine \
  tar czf /backup/plausible-events-$(date +%F).tar.gz -C /data .

Store both off the machine. Also plan updates deliberately: pin the image tag, read the release notes, and migrate on a schedule rather than tracking latest. ClickHouse upgrades occasionally need explicit steps, and a broken analytics database is at least not a broken website — but it does mean losing history.

Common problems

ClickHouse exits immediately. Missing ulimits.nofile, or the volume ownership is wrong after a manual copy. Check docker compose logs plausible_events_db.

Dashboard loads but shows zero visitors. The script domain does not match the site domain in settings, or an ad blocker is blocking the script in your own browser. Test in a private window with blockers off.

Registering the first account fails with a 500. Migrations did not finish. Confirm the db migrate step in the logs completed before the app started.

Events missing but pageviews fine. Custom events need the same script and a page reload after deployment; also check the event name has no reserved characters.

Memory grows steadily. ClickHouse caching plus long retention. Set a retention period in the dashboard settings if the VPS is small.

Plausible vs the alternatives

  • vs Google Analytics 4: no cookies, no consent banner, no sampling, far simpler. You lose user-level attribution and ad-platform integration. For a content site, that trade is clearly worth it.
  • vs Umami: Umami is lighter (single Postgres, no ClickHouse) and easier to run; Plausible has a more polished UI and better event tooling. For a low-traffic blog, Umami is the simpler pick — self-hosting both and comparing takes an afternoon.
  • vs Matomo: Matomo is the most feature-complete self-hosted option and can do full cookie-based tracking if legally configured. It is also considerably heavier and more complex than most personal sites need.
  • vs the hosted Plausible plan: around €9/month removes all maintenance. Self-hosting is a deliberate act of ownership, not a cost saving at that scale.

Worth the three containers?

For a blog, yes — with a caveat. Plausible is heavier than every other service in a typical homelab stack because of ClickHouse, and if all you want is “which posts are read”, Umami gives you 80% of the value in one container.

Where Plausible earns its weight: you want cookie-free analytics and custom events, you care about a dashboard you can hand to a non-technical collaborator, or you are running several sites and want one instance for all of them. In those cases the setup cost is paid back in the first week of not arguing with a consent banner — and in the small satisfaction of seeing your traffic numbers without a Google script anywhere near your privacy-focused stack.