Deploy Plausible Analytics | Open Source Google Analytics Alternative
Self-host Plausible Analytics — privacy-first, GDPR-Compliant Web Analytics
DBs
Just deployed
/var/lib/postgresql/data
clickhouse
Just deployed
/var/lib/clickhouse
plausible
Just deployed
Deploy and Host Plausible Analytics on Railway
This Railway template deploys a fully self-hosted Plausible Community Edition (CE) instance — a privacy-first, open-source Google Analytics alternative — with all three required services pre-wired and ready to go. The stack includes the Plausible CE app (ghcr.io/plausible/community-edition), a PostgreSQL database for user accounts and site settings, and a ClickHouse database for analytics event storage. Services communicate over Railway's private network, so no analytics data is exposed externally.

Getting Started with Plausible Analytics on Railway
Once all three services are healthy, navigate to your Railway-generated domain for the Plausible service. You'll be prompted to create your first admin account — do this immediately, then set DISABLE_REGISTRATION to true or invite_only to lock down signups. From the dashboard, add your first site by entering its bare domain (e.g. residues.in — no https:// or www). Copy the generated tracking snippet and add it to your site's ``. Stats will start appearing within seconds of your first pageview.

About Hosting Plausible Analytics
Plausible CE is the self-hosted, AGPL-licensed release of Plausible Analytics — a lightweight web analytics tool that collects no personal data, sets no cookies, and requires no consent banners. It's fully compliant with GDPR, CCPA, and PECR out of the box.
Key features:
- Tracking script under 1 KB — 75x smaller than Google Analytics, zero page-speed impact
- Cookieless tracking — no cookie banners required under GDPR
- Single-page dashboard with all essential metrics: visitors, pageviews, sources, top pages, devices, locations
- Custom events, goals, funnels, and UTM campaign tracking
- Google Search Console integration
- Real-time visitor view
- Weekly/monthly email reports
- Public dashboard sharing and embeds
Architecture: Plausible CE is an Elixir/Phoenix application. PostgreSQL stores users, sites, and settings. ClickHouse stores all analytics event data — its columnar architecture makes aggregation queries dramatically faster than Postgres at scale. On Railway, all three services communicate over the private .railway.internal network; only the Plausible web app is exposed publicly.
Why Deploy Plausible Analytics on Railway
Running Plausible yourself on a VPS means configuring Nginx, TLS certificates, firewall rules, Docker Compose, and keeping ClickHouse — a notoriously memory-hungry database — from eating your server. Railway eliminates all of that:
- Private networking: ClickHouse's port 8123 is never exposed publicly. Plausible reaches it over
clickhouse.railway.internal— zero extra config. - Auto-generated secrets:
SECRET_KEY_BASEand both database passwords are generated securely at deploy time via${{secret()}}. - Managed Postgres: Railway's Postgres service handles backups, restarts, and credentials — no
pg_hba.confto touch. - Environment variable UI: All cross-service references (
${{clickhouse.RAILWAY_PRIVATE_DOMAIN}},${{Postgres.PGPASSWORD}}) are resolved automatically — no.envfile management.
Common Use Cases
- Indie hackers and solo founders replacing Google Analytics on their SaaS or blog — one deploy gives you privacy-compliant analytics with no monthly SaaS fee beyond Railway hosting costs.
- Agencies managing client sites who need to prove GDPR compliance to EU clients without dealing with cookie consent infrastructure.
- Development teams who want raw access to their analytics event data via direct ClickHouse queries for custom reporting or data pipelines.
Dependencies for Plausible Analytics
- Plausible CE —
ghcr.io/plausible/community-edition:v2.1.5(GitHub Container Registry, public) - ClickHouse — deployed from
railwayapp-templates/plausible, root directorypackages/clickhouse; includes Railway-tuned XML config for IPv4-only mode and memory limits - PostgreSQL — Railway managed Postgres service
Deployment Dependencies
- Plausible CE GitHub: github.com/plausible/community-edition
- ClickHouse Railway template repo: github.com/railwayapp-templates/plausible
- Plausible self-hosting docs: plausible.io/docs/self-hosting-configuration
- Custom start command:
sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
Minimum Hardware Requirements for Plausible Analytics
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM (Plausible) | 512 MB | 1 GB |
| RAM (ClickHouse) | 1 GB | 2–4 GB |
| RAM (Postgres) | 256 MB | 512 MB |
| Storage (ClickHouse volume) | 5 GB | 20 GB+ (grows with events) |
| Storage (Postgres volume) | 1 GB | 5 GB |
> ⚠️ ClickHouse is the resource-intensive component. On Railway's Hobby plan, scale the ClickHouse service to at least 1–2 GB RAM to avoid OOM restarts. High-traffic sites (millions of monthly events) should provision 4 GB+.
Self-Hosting Plausible Analytics
To run Plausible CE on your own VPS with Docker Compose:
# Clone the community edition repo
git clone https://github.com/plausible/community-edition plausible-ce
cd plausible-ce
# Copy and edit the environment config
cp plausible-conf.env.example plausible-conf.env
# Set BASE_URL and SECRET_KEY_BASE at minimum:
# BASE_URL=https://analytics.yourdomain.com
# SECRET_KEY_BASE=$(openssl rand -base64 48)
# Start all services
docker compose up -d
The official compose.yml bundles Plausible, Postgres (postgres:16-alpine), and ClickHouse (clickhouse/clickhouse-server:24.3.3.102-alpine). For production, place Nginx or Caddy in front and terminate TLS there, or set HTTP_PORT=80 and HTTPS_PORT=443 to let Plausible request Let's Encrypt certificates automatically.
# Verify all three services are running
docker compose ps
# Check Plausible logs
docker compose logs plausible -f
Is Plausible Analytics Free?
Plausible Community Edition is free and open source under the AGPLv3 license — you only pay for your Railway infrastructure. On Railway, typical hosting costs for all three services run $5–$15/month depending on traffic volume and memory allocated to ClickHouse.
Plausible also offers a managed cloud service at plausible.io for teams that don't want to manage infrastructure. Cloud plans start at $9/month for 10k monthly pageviews (Starter), with Growth and Business tiers for larger teams, funnels, and ecommerce tracking.
Plausible Analytics vs Umami vs Matomo
| Plausible CE | Umami | Matomo | |
|---|---|---|---|
| Open source | ✅ AGPLv3 | ✅ MIT | ✅ GPL |
| Self-hostable | ✅ | ✅ | ✅ |
| Cookieless | ✅ | ✅ | ✅ (optional) |
| Script size | ~1 KB | ~2 KB | ~23 KB |
| Database | Postgres + ClickHouse | Postgres or MySQL | MySQL/MariaDB |
| Funnels & goals | ✅ (CE included) | Limited | ✅ Full |
| Heatmaps / session replay | ❌ | ❌ | ✅ (paid plugin) |
| Cloud tier | From $9/mo | From $9/mo | From $19/mo |
| Best for | Privacy-first simplicity | Lightweight self-hosting | GA4 replacement |
Plausible CE hits the sweet spot for teams that want a polished, privacy-compliant dashboard without Matomo's PHP complexity or ClickHouse-less tools that struggle at scale.
FAQ
What is Plausible Analytics? Plausible Analytics is an open-source, cookieless web analytics tool built as a privacy-respecting alternative to Google Analytics. It tracks pageviews, traffic sources, devices, and custom events — all without collecting personal data or requiring a cookie consent banner.
What does this Railway template deploy?
Three services: the Plausible CE app (Docker image from GitHub Container Registry), a Railway-managed PostgreSQL database for users and site config, and a ClickHouse instance deployed from the railwayapp-templates/plausible GitHub repo. All services are pre-wired via Railway's private network.
Why does Plausible need both PostgreSQL and ClickHouse? They serve different purposes. Postgres stores relational data — user accounts, site settings, goals. ClickHouse stores raw analytics events. ClickHouse's columnar format makes aggregation queries (e.g. "unique visitors over the last 30 days") orders of magnitude faster than Postgres, especially as event volume grows into the millions.
Why is ClickHouse deployed from a GitHub repo instead of the official Docker image?
The Railway template's ClickHouse Dockerfile bundles custom XML configuration that disables IPv6 (Railway's private network is IPv4-only) and tunes memory settings for Railway's environment. The official clickhouse/clickhouse-server image works too if you supply the config separately, but the repo approach is the easiest path.
Can I use this in production for a high-traffic site?
Yes. Scale up the ClickHouse service's memory allocation in Railway's resource settings (2–4 GB RAM for sites with millions of monthly events). Add a volume to ClickHouse at /var/lib/clickhouse before first deploy to persist event data across restarts. For critical production use, also set up Railway's sleep prevention and monitor ClickHouse memory usage.
Does Plausible CE track across multiple sites? Yes. You can add unlimited sites from a single Plausible CE instance. Each site gets its own tracking script and dashboard.
Template Content

