Case study · Stack

How Plausible built a lightweight Google Analytics alternative

Plausible is an open source, cookie-free analytics tool run by a tiny bootstrapped team in the EU. Its stack is an Elixir and Phoenix monolith, with PostgreSQL for app data and ClickHouse for the stats, running on servers in Germany.
Copy this stackplausible.io Privacy-friendly web analytics · Estonia · founded 2018

Plausible Analytics's stack

Open in the stack builder

Language

  • Elixirserokell.io

    Main language for the whole backend, from event ingestion to the web app.

    Why: It handles stateful work well, so active sessions stay in memory instead of hitting the database on every event.

  • TypeScriptgithub.com

    Language of the dashboard's front-end code.

UI library

  • Reactgithub.com

    Powers the interactive stats dashboard.

Hosting

  • Hetznerplausible.io

    Server infrastructure in Germany for the cloud product.

  • Bunnyplausible.io

    CDN, DNS and DDoS protection in front of the app.

Database

  • PostgreSQLplausible.io

    Stores accounts, sites, settings and other app data.

    Why: Täht saw it as the safe default because it is mature and battle-tested.

  • ClickHouseplausible.io

    Stores every pageview and event and answers the dashboard's stats queries.

    Why: Columnar storage is much faster for analytics queries and still keeps the raw data for ad-hoc questions.

Payments

Email

  • Postmarkplausible.io

    Sends transactional emails and the scheduled stats reports.

Styling and UI kit

  • Tailwind CSSplausible.io

    Styles the dashboard and the rest of the site.

    Why: After the learning curve, Täht found it produced better-looking designs in less time than anything else he had tried.

Data fetching

  • Obangithub.com

    Runs background jobs inside the Elixir app.

Backend framework

  • Phoenixgithub.com

    Web framework for the app, including its server-rendered pages and LiveView.

Security

  • Friendly Captchaplausible.io

    Blocks spam on the registration and login pages.

AI model

  • Anthropicplausible.io

    Optionally drafts support replies and powers AI answers in the docs search.

Error monitoring

Support chat

  • Help Scoutplausible.io

    Stores and manages customer support conversations.

How they built it

One developer, a favorite stack

Uku Täht started Plausible alone in December 2018 and picked tools he already trusted: Elixir and Phoenix on the server, PostgreSQL for storage, Tailwind for styling and plain server-rendered pages. His argument was that fewer moving parts keep a small project fast and simple.

The early setup ran on Heroku, with Sentry for errors, Mailgun for email and Cloudflare in front. His one worry was whether Elixir could keep up with heavy traffic, and he admitted he would only find out by trying.

Sources:plausible.io plausible.io

When PostgreSQL got slow: the move to ClickHouse

Every pageview went into a single PostgreSQL table, and the numbers were added up at query time. After the traffic spike of spring 2020, loading the demo dashboard could take more than 6 seconds. Täht's diagnosis was that a row-oriented database is not built for this kind of analytics query.

Instead of pre-aggregating the data, the team moved the stats to ClickHouse, a columnar database that keeps the raw events and still answers ad-hoc queries fast. The co-founders later said ClickHouse came out on top in both performance and features, and that it lets them serve customers with around 150 million pageviews a month.

Sources:plausible.io clickhouse.com

Elixir held up, and the hosting moved to Germany

By the time of a later interview, Plausible was handling 60 million pageviews a month on Elixir without trouble. Täht pointed to its strength with stateful work: active visitor sessions live in memory in a GenServer, so the app skips a database lookup on every event.

The hosting changed along the way. The team left Heroku for a DigitalOcean server running Docker, and today the visitor data sits on Hetzner servers in Germany, with Bunny in front for CDN, DNS and DDoS protection and UpCloud for database hosting.

Sources:serokell.io plausible.io

Open source, and few outside services

The same codebase powers the paid cloud product and the free self-hosted edition on GitHub. The dashboard is a React app written in TypeScript, while the rest of the web app stays in Phoenix.

The list of vendors is short and mostly European-friendly: Paddle for payments, Postmark for email with open and link tracking turned off, Help Scout for support and Friendly Captcha on the sign-up and login pages. Anthropic is listed as an optional tool for drafting support replies and answering questions in the docs.

Sources:github.com plausible.io

Also detected on their website

Found on the homepage with the open Wappalyzer rules (HTML, scripts and headers). It shows what runs in the browser, not the whole backend.

  • Alpine.js
  • Jekyll
  • Ruby