Self-hosted Plausible: lightweight, cookie-free analytics on your VPS
Tutorial · · 7 min read
Plausible is the web analytics tool many people pick when they leave Google Analytics but don't want to fly blind: a single-page dashboard, no cookies, no personal data and a tiny script. Its paid cloud version is convenient, but the project also publishes Plausible Community Edition, the same application for you to host yourself.
Hosting it yourself comes with a catch: Plausible isn't a single container. It needs Postgres for users and sites, and ClickHouse for events, which is what keeps it fast with millions of pageviews. In this guide you'll see what it takes and how to get it running on your VPS with the SecuryBlack template.
What you need
- A VPS with at least 2 GB of free RAM. ClickHouse is demanding; with less memory it can crash from running out of RAM. The CPU must support SSE 4.2 (x86) or NEON (ARM), which any current VPS does.
- The server connected to SecuryBlack with CromoForge, the agent that deploys your apps, and Docker.
- A subdomain for the dashboard, for example
plausible.yourdomain.com. - Ports 80 and 443 free for the HTTPS proxy.
Step 1: point the subdomain at the server
Create an A record (and AAAA if you have IPv6) named plausible with your VPS's public IP. Do it before creating the app: the HTTPS certificate is requested on first start.
dig +short plausible.yourdomain.com
Step 2: create the app from the template
In the panel, go to Apps → New app → Template, choose Plausible and fill in name, server and domain. If you're signed in, this link opens the panel with the Plausible template selected.
The domain isn't a detail: Plausible uses it as its BASE_URL to build links and the tracking script, so the template requires it from the start.
Step 3: what gets set up on your server
This is what you'd normally do by hand with the community-edition repository and its compose.yml:
- Three containers on a private network: Plausible, Postgres (
db) and ClickHouse (events). Only Plausible is reachable, and only from127.0.0.1. Neither Postgres nor ClickHouse publishes ports. - ClickHouse tuned for a small server. The template applies the same low-resource configuration as the official project (fewer threads, logs that expire after 30 days), but without XML files on your server to maintain.
- Generated secrets: the Postgres password and
SECRET_KEY_BASEare generated when the app is created and stored encrypted as environment variables. - Persistent data in Docker volumes: Postgres's, ClickHouse's and the app's own. They survive every deployment.
- Automatic HTTPS with a Caddy proxy in front that requests and renews the certificate.
The first start takes a bit longer than the rest: Plausible creates its database and runs its migrations before answering. The deployment waits up to five minutes for the healthcheck.
Step 4: create the admin account right away
Open https://plausible.yourdomain.com. Plausible asks you to sign up: the first account to register becomes the admin. Do it as soon as the deployment finishes, before sharing the link with anyone. You can invite more people from Plausible afterwards.
Step 5: add your site
Click Add a website, type your domain and Plausible gives you the script snippet to paste into your site's <head>. Copy it as is: it already points at your instance. As soon as you publish it, the first visit shows up on the dashboard.
If you use WordPress, the official Plausible plugin also works with a self-hosted instance: it only asks for its URL.
Updating and maintaining Plausible
- Update: click Deploy on the app. It pulls the latest Plausible 3 release and runs its migrations on startup. Your data stays in its volumes.
- Watch the memory: ClickHouse is the first thing a tight server notices. The server monitoring agent alerts you when RAM or disk get close to the limit.
- Watch availability: an uptime monitor on
https://plausible.yourdomain.com/api/healthalerts you if the app stops responding. - Delete it: from Settings → Danger zone. Deleting the app also deletes its volumes, with all your stats.
Umami or Plausible?
Both are good cookie-free options. Umami is lighter (Postgres only) and fits on a 1 GB server. Plausible needs more memory because of ClickHouse, but handles heavy traffic better and its dashboard is even simpler. If your server is tight, start with self-hosted Umami; both have a template.
Conclusion
Plausible Community Edition gives you clear, privacy-friendly analytics with the data on your server. The hard part, orchestrating Postgres, ClickHouse and HTTPS, is handled by the template. All that's left for you is the DNS record and your account. Start free on SecuryBlack.