Plausible is a lightweight, cookie free web analytics tool. Hosting it yourself keeps visitor data on your server and removes the monthly subscription, in exchange for some upkeep.
Requirements#
Plausible Community Edition uses Postgres for application data and ClickHouse for events. ClickHouse is the hungry part. Plan for at least 2 vCPUs and 4 GB RAM for a small site, more for high traffic.
Setup outline#
- Point a subdomain such as
stats.example.comto your server. - Run the official Compose setup with a generated
SECRET_KEY_BASE, yourBASE_URL, and SMTP settings if you want emails. - Put it behind HTTPS with a reverse proxy.
- Create an account, add your site, and paste the script tag.
<script defer data-domain="example.com" src="https://stats.example.com/js/script.js"></script>
Ad blockers#
Some blockers block third party analytics domains. Serving the script from your own subdomain helps, and you can also proxy it through your main domain.
Maintenance#
- Back up both Postgres and the ClickHouse volume
- Watch disk usage, because event tables grow with traffic
- Update by pulling a new tagged release after reading its notes
- Disable open registration after you create your account
Is it worth it?#
If you have several sites and care about privacy or cost, yes. If you have one small blog, the hosted plan may be cheaper than your time.
Step by step instructions are in this guide to self-hosting Plausible Analytics.
Disclosure: I work on Peon, a self-hosted deployment platform that can run Plausible from a template.
Comments
No comments yet. Start the conversation.