Plausible Analytics Self-Hosted: VPS Specs
To self-host Plausible Analytics, your VPS needs at least 1 GB of RAM, 1 vCPU, 20 GB of disk space, and a public IP address. These are the minimum requirements to run the official Docker Compose setup with PostgreSQL and ClickHouse, which is the recommended deployment method. For a small to medium-sized site (up to 100k monthly pageviews), this setup will work fine; for larger traffic, you’ll want more CPU and RAM.
What Plausible Analytics Is and Why Self-Host
Plausible is a lightweight, open-source web analytics tool that focuses on privacy. Unlike Google Analytics, it does not use cookies and is compliant with GDPR, CCPA, and PECR out of the box. It tracks page views, unique visitors, referrers, and custom events with a simple dashboard. Self-hosting gives you full control over your data, avoids per-pageview fees, and lets you customize the installation. The official documentation provides a Docker Compose file that bundles the Plausible server, PostgreSQL database, ClickHouse database, and an event ingestion service. This is the standard way to run it on a VPS.
Minimum VPS Requirements
The official Plausible docs state that a small VPS with 1 GB of RAM and 1 vCPU is sufficient for most websites. The main resource consumers are ClickHouse (for storing analytics events) and PostgreSQL (for metadata). Here’s a breakdown of what each component needs:
- RAM: 1 GB is the absolute minimum. The two databases plus the app can use ~700 MB under normal load. If you have less than 1 GB, the system will swap heavily and become unresponsive.
- CPU: 1 vCPU is fine for up to ~100k monthly pageviews. Each request triggers a small insert into ClickHouse, which is CPU-light. For higher traffic, 2 vCPUs are recommended.
- Disk: 20 GB of SSD storage is a safe starting point. The databases start small (a few hundred MB) but grow with your traffic. ClickHouse compresses data well, so 1 million pageviews take roughly 1-2 GB.
- Network: A public IPv4 address is required. The server must be reachable on port 80 (HTTP) and 443 (HTTPS) for the dashboard and script. A 1 Gbps uplink is typical on most VPS plans.
- OS: Ubuntu 20.04 or 22.04 LTS is the most common choice. Any 64-bit Linux distribution with Docker support works.
How the Self-Hosted Stack Works
The Docker Compose setup runs four services: plausible (the main app), clickhouse (analytics database), postgres (metadata database), and event-listener (ingests events). When a visitor loads your site, the JavaScript snippet sends a POST request to your server’s /api/event endpoint. That request is buffered by the event-listener and then inserted into ClickHouse. The dashboard queries ClickHouse to display charts. PostgreSQL stores your site definitions and user accounts. All services communicate over an internal Docker network. The official docker-compose.yml file sets up environment variables for your domain, secret key, and database credentials. You need to set up a reverse proxy (like Caddy or Nginx) to handle TLS certificates and forward traffic to the Plausible container on port 8000.
How to Choose the Right VPS Provider
When selecting a VPS for Plausible, consider these factors:
- Memory vs. CPU: RAM is the bottleneck. A plan with 2 GB RAM and 1 vCPU will outperform a 1 GB/2 vCPU plan for this workload.
- Disk type: Always choose NVMe SSD. ClickHouse does a lot of random reads/writes; HDD will cause slow dashboard loading.
- Bandwidth: Most VPS plans include 1-2 TB of transfer. Each pageview sends a small request (~1 KB), so 100k pageviews use ~100 MB. Bandwidth is rarely an issue unless you have millions of hits.
- Location: Choose a data center close to your audience. This reduces latency for the analytics script, which affects your site’s load time.
- Managed vs. unmanaged: Plausible requires Docker and command-line knowledge. A managed VPS (like those with a control panel) is easier, but unmanaged is cheaper. You can use a one-click Docker image from your provider if available.
Common Problems and How to Avoid Them
Here are the most frequent issues people run into when self-hosting Plausible:
- Out of memory (OOM) kills: The Linux kernel may kill the ClickHouse process if RAM is exhausted. Fix: add swap space (2 GB) or upgrade to 2 GB RAM.
- ClickHouse not starting: Often due to insufficient memory or misconfigured
CLICKHOUSE_MAX_MEMORY_USAGEenv var. The default is 1 GB, which can be too high for a 1 GB VPS. Set it to 500 MB. - HTTPS certificate issues: If you use Caddy, it automatically gets Let’s Encrypt certificates. If you use Nginx, you must configure certbot manually. A misconfigured reverse proxy will cause the script to load over HTTP, which modern browsers block as mixed content.
- Database growth: ClickHouse stores data indefinitely by default. Over months, disk usage grows. You can set up a retention policy (e.g., delete events older than 12 months) using a cron job.
- Slow dashboard: If you have millions of events, queries can become slow. Add an index on
domainandtimecolumns in ClickHouse, or increase RAM to 4 GB.
Cost Comparison: Self-Hosted vs. Plausible Cloud
Plausible Cloud pricing starts at $9/month for 10k pageviews. Self-hosting on a VPS typically costs $5-$10/month for a 1 GB RAM instance. If you have more than 100k pageviews, the cloud cost rises to $49/month, while a $20/month VPS (2 GB RAM) can handle millions of pageviews. However, self-hosting requires your time for maintenance: updates, backups, and monitoring. The official Plausible docs provide a script for automatic updates, but you are responsible for running it. For a hobby site with low traffic, self-hosting is cheaper. For a business with high traffic, the cloud may be worth the cost to avoid operational overhead.
Security and Backup Considerations
When self-hosting, you are responsible for securing the server. Key steps include:
- Keep the OS and Docker images updated. Plausible releases updates monthly; you should pull the latest images.
- Use a firewall (UFW) to restrict ports to 80, 443, and SSH (22). Do not expose the databases to the internet.
- Set up automatic backups of PostgreSQL and ClickHouse. The official docs provide a
backup.shscript that dumps both databases. Store backups off-site (e.g., S3 or another VPS). - Use a strong password for the admin user and enable two-factor authentication if available.
- Limit SSH access to key-based authentication only. Disable root login.
If you are not comfortable with server administration, consider using a managed hosting service that offers Plausible as a one-click app, or stick with the cloud version.
Alternatives to Self-Hosting Plausible
If you want privacy-friendly analytics but don’t want to manage a VPS, consider these options:
- Plausible Cloud: The official hosted service. No maintenance, but costs per pageview.
- Umami: Another open-source, privacy-focused analytics tool. It uses a single database (PostgreSQL or MySQL) and is lighter on resources. A 512 MB VPS can run it.
- Matomo: A full-featured Google Analytics alternative. It is heavier and requires more RAM (at least 2 GB).
- GoAccess: A real-time log analyzer that runs on your web server. It does not require a database and is very lightweight, but it only analyzes server logs, not JavaScript events.
Each has trade-offs in features, resource usage, and ease of setup.
Frequently Asked Questions
Can I run Plausible on a Raspberry Pi?
Yes, but with limitations. A Raspberry Pi 4 with 4 GB RAM can run the Docker Compose stack, but the ARM architecture is not officially supported by Plausible. You may need to build the images manually or use a community fork. Performance will be fine for low traffic, but you must be comfortable with troubleshooting.
How much RAM does Plausible actually use?
With default settings, the stack uses about 600-800 MB of RAM. ClickHouse uses ~400 MB, PostgreSQL ~150 MB, and the app ~100 MB. If you have 1 GB RAM, you should set CLICKHOUSE_MAX_MEMORY_USAGE=500000000 (500 MB) to avoid OOM kills.
Can I use SQLite instead of PostgreSQL?
No, Plausible requires PostgreSQL for metadata. SQLite is not supported. You must run PostgreSQL as a separate container or service.
How do I migrate from Plausible Cloud to self-hosted?
You can export your data from the cloud dashboard as a CSV file (for stats) or use the API to pull raw events. However, the self-hosted version does not have a built-in import tool for cloud data. You would need to write a script to insert historical events into ClickHouse. For most users, it’s easier to start fresh.
Is self-hosting Plausible legal under GDPR?
Yes, self-hosting is actually more compliant because you have full control over data processing. Plausible does not use cookies, so you don’t need a cookie consent banner. However, you must still have a privacy policy that mentions the analytics tool and your server location.
What if my VPS runs out of disk space?
ClickHouse will stop accepting new events, and the dashboard will show errors. You can free space by deleting old events with a SQL command, or increase the disk size on your VPS provider. Many providers allow live disk expansion without downtime.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.