Deploy Plausible
Google analytics alternative. Privacy-first web analytics, custom events
Just deployed
/var/lib/postgresql/data
mailpit
Just deployed
/data
ClickHouse
Just deployed
/var/lib/clickhouse
plausible
Just deployed
/var/lib/plausible
plausible-storage
Bucket
Just deployed

Deploy and Host Plausible on Railway
Plausible is open source, privacy-friendly web analytics: a lightweight script that tells you how many people visited your site, where they came from and which pages they read — without cookies, cross-site tracking or personal data. It suits teams dropping Google Analytics who still need real numbers, and anyone answering a GDPR, CCPA or PECR question about their analytics.
Deploy Plausible Community Edition and self-host Plausible on Railway with its data layer already wired together: the app (ghcr.io/plausible/community-edition), PostgreSQL for accounts and settings, ClickHouse for the events, and Mailpit as the mail service that makes invitations and password resets work on day one. ClickHouse carries the configuration Plausible's own compose file recommends, baked into a source image at gridalpha/plausible-clickhouse-railway. The app is the only service on the public internet; both databases and SMTP stay private.

Getting Started with Plausible on Railway
Open the deployed app URL and you land on /register. Plausible has no default password: the first visitor creates the owner account and registration then closes itself, so do this as soon as the deploy finishes. Enter a name, email and a password of at least 12 characters to reach onboarding. Add the naked domain you want to measure — example.com, no https://, no www — pick a reporting timezone, and Plausible hands you a one-line script tag for your site's ``. Once traffic arrives the dashboard shows visitors, sources, top pages, countries and devices live. To check the stack, request /api/health: it reports postgres and clickhouse separately.

About Hosting Plausible
Plausible is an Elixir application that ingests page views over HTTP and answers dashboard queries from ClickHouse, a columnar database built for this workload. Self-host it when analytics data must stay on infrastructure you control, or for unlimited page views with no per-event bill.
- Cookieless tracking, so no consent banner is required in most jurisdictions
- A ~1 KB script, roughly 75× smaller than Google Analytics' tag
- Goals and custom events with conversion rates on the same screen
- UTM campaign tracking, referrer and channel attribution
- Country, region and city geolocation from a bundled DB-IP database
- A public Stats API, shareable dashboards, email reports
PostgreSQL holds users, teams, sites, goals and settings. ClickHouse holds every event and session, which is what makes a query over millions of rows return instantly. Mailpit accepts mail over the private network and gives you a web inbox — since new accounts arrive by invitation, that mail path is what lets you add colleagues.
Why Deploy Plausible on Railway
Railway removes the operational work that makes self-hosted analytics unattractive.
- No Docker Compose, volume or ClickHouse tuning to maintain
- Both databases on private networking, never the public internet
- Managed TLS and a custom domain in two clicks
- Persistent volumes for event data and exports
- One-click redeploys when a new release ships
Common Use Cases
- Replacing Google Analytics on marketing sites and docs portals where a consent banner hurts conversion
- Measuring signups by defining custom events as goals, then reading conversion rate per source
- Running analytics for client sites from one instance, each dashboard shared read-only via a link
- Keeping visitor data in your own infrastructure for a data-residency or procurement requirement
Dependencies for Plausible
- Plausible Community Edition —
ghcr.io/plausible/community-edition:latest - PostgreSQL — Railway managed database: accounts, sites, goals, settings
- ClickHouse — gridalpha/plausible-clickhouse-railway on
clickhouse/clickhouse-server:24.12-alpine: events and sessions - Mailpit —
axllent/mailpit:latest, SMTP plus web inbox for invitations
Environment Variables Reference
| Variable | Description | Required |
|---|---|---|
BASE_URL | Public URL, used in every generated link | Yes |
SECRET_KEY_BASE | Session signing key, 64+ characters | Yes |
DATABASE_URL | PostgreSQL connection string | Yes |
CLICKHOUSE_DATABASE_URL | ClickHouse connection string with database name | Yes |
PORT | Listen port; used when HTTP_PORT is unset | Yes |
DISABLE_REGISTRATION | true, false or invite_only; first account always allowed | No |
SMTP_HOST_ADDR | SMTP relay host; without one, mail goes direct on port 25 | No |
MAXMIND_LICENSE_KEY | Swaps the bundled country database for MaxMind city data | No |
GOOGLE_CLIENT_ID | Search Console data and Google Analytics import | No |
Deployment Dependencies
- Source: plausible/analytics, AGPL-3.0
- Config reference: plausible/community-edition
- Requires PostgreSQL 12+ and ClickHouse 23.3+
Plausible vs Google Analytics vs Umami
| Plausible | Google Analytics 4 | Umami | |
|---|---|---|---|
| Open source | Yes (AGPL-3.0) | No | Yes (MIT) |
| Self-hostable | Yes | No | Yes |
| Consent banner | Not needed | Required | Not needed |
| Script size | ~1 KB | ~45 KB | ~2 KB |
| Event storage | ClickHouse | Google-owned | PostgreSQL or MySQL |
GA4 goes deeper if you live inside Google's ad stack and accept the consent burden. Umami is lighter because it needs no ClickHouse, but Plausible pulls ahead on goals, campaign attribution and its Stats API.
Server Requirements to Self-Host Plausible
ClickHouse, not Plausible, sets the floor here.
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 2 vCPU | 4 vCPU |
| RAM | 2 GB | 4–8 GB |
| Storage | 10 GB | 25 GB+, growing with event volume |
| PostgreSQL | 12+ | 16 or newer |
| ClickHouse | 23.3+ | 24.12 |
ClickHouse needs SSE 4.2 or ARM NEON. Compressed events run to tens of bytes each, so disk grows slowly even at millions of page views.
How to Self-Host Plausible Outside Railway
Plausible publishes a reference Docker Compose setup. Clone it, set the two required values, start it:
git clone -b v3.2.1 --single-branch https://github.com/plausible/community-edition plausible-ce
cd plausible-ce
echo "BASE_URL=https://analytics.example.com" > .env
echo "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .env
docker compose up -d
Plausible listens on port 8000, so put a reverse proxy in front and terminate TLS there. Add the tracking snippet to every page you want measured, using the domain you registered:
Server-side and mobile events reach the same instance over the Events API:
curl -X POST https://analytics.example.com/api/event \
-H "Content-Type: application/json" \
-H "User-Agent: Mozilla/5.0" \
-d '{"name":"Signup","url":"https://example.com/pricing","domain":"example.com"}'
How Much Does Plausible Cost to Self-Host?
The Community Edition is free and open source under AGPL-3.0, so there is no licence fee at any traffic level, and on Railway you pay only for the compute, memory and volume storage the four services use. Plausible's hosted cloud starts around $9/month for 10k monthly page views and carries a few features the Community Edition does not: marketing funnels, user journeys, revenue goals, SSO and the Sites API. Otherwise self-hosting gets unlimited page views for the cost of a small container plus a database.
FAQ
What is Plausible and why self-host it? Plausible is a lightweight, open source, privacy-friendly analytics tool and a direct Google Analytics alternative. Self-hosting keeps visitor records on infrastructure you control and removes per-page-view billing.
What does this Railway template deploy? Plausible Community Edition on a public URL, a managed PostgreSQL database, a ClickHouse database pre-configured for Plausible, and Mailpit for outgoing mail.
Why does the template include both PostgreSQL and ClickHouse? Plausible requires both. PostgreSQL stores accounts, sites, goals and settings; ClickHouse stores the event stream, and being columnar keeps queries fast at millions of page views.
How do I create the first admin user in self-hosted Plausible?
Visit the deployed URL and register. Plausible exempts the first account from the registration restriction, so no default credentials exist. Afterwards /register redirects to login and users join by invitation.
Do I need a cookie consent banner with Plausible? No. Plausible sets no cookies and collects no personal data or persistent identifiers, which is why it generally falls outside GDPR, CCPA and PECR consent rules.
Can I send events from a backend or mobile app instead of the script?
Yes. POST /api/event accepts JSON with name, url and domain plus a User-Agent header — that is how you track server-side conversions or anything a browser script cannot see.
Template Content
mailpit
axllent/mailpit:latestClickHouse
gridalpha/plausible-clickhouse-railwayplausible-storage
Bucket
