Railway

Deploy plausible

Deploy Plausible Analytics (CE) with a single click

Deploy plausible

/var/lib/postgresql/data

Just deployed

Plausible CE Logo

Plausible Community Edition

Privacy-friendly, open-source web analytics built for the modern web

Deploy on Railway


Deploy and Host

Deploy Plausible Community Edition on Railway in minutes. Plausible is a lightweight, open-source web analytics platform that doesn't use cookies and is fully compliant with GDPR, CCPA, and PECR. This template sets up Plausible CE with ClickHouse for high-performance analytics storage and PostgreSQL for metadata.

About Hosting

Plausible CE is the self-hosted version of Plausible Analytics, a privacy-first alternative to Google Analytics. Unlike traditional analytics tools, Plausible:

  • No cookies required — No cookie consent banners needed
  • GDPR/CCPA compliant out of the box
  • Lightweight script — < 1KB, loads instantly
  • ClickHouse-powered — Handles millions of page views
  • 27.4K+ GitHub stars — Battle-tested by thousands

This Railway template deploys three components:

ComponentPurposeImage
Plausible CEWeb analytics applicationghcr.io/plausible/community-edition:v3.2.1
ClickHouseColumn-oriented analytics databaseclickhouse/clickhouse-server:24.12-alpine
PostgreSQLMetadata and user data storageRailway plugin

Why Deploy

  • Eliminate Google Analytics — Own your analytics data completely
  • Privacy by default — No tracking cookies, no personal data collection
  • Lightweight performance — Tracking script is ~45KB gzipped
  • Infinite scalability — ClickHouse handles billions of events
  • Real-time dashboards — See visitor data as it comes in
  • Zero-config SEO — Built-in sitemaps, canonical URLs, Open Graph

Common Use Cases

  • SaaS Products — Track feature usage and user behavior without third-party scripts
  • Content Websites — Monitor traffic, top pages, and referral sources
  • E-commerce — Analyze conversion funnels and traffic sources
  • Personal Blogs — Simple, privacy-respecting visitor analytics
  • Enterprise Intranets — Host behind your firewall for internal analytics

Dependencies for Plausible

Deployment Dependencies

  • Railway Account — Sign up at railway.app
  • PostgreSQL Plugin — Added automatically via Railway's plugin system
  • Custom Domain (recommended) — For production deployments

All services are containerized and deploy with a single click.


Quick Start

1. Deploy to Railway

Deploy on Railway

Click the button above. Railway will:

  1. Create the Plausible CE service
  2. Create the ClickHouse service
  3. Add a PostgreSQL database plugin
  4. Wire internal networking between services

2. Configure Environment Variables

Set these required variables in Railway dashboard:

VariableDescriptionHow to Get
BASE_URLPublic URL of your Plausible instancehttps://your-app.up.railway.app
SECRET_KEY_BASE64-byte random string for encryptionopenssl rand -base64 48
CLICKHOUSE_DATABASE_URLClickHouse connection stringSee networking section below

> Network Tip: ClickHouse runs as a Railway service. Use the internal Railway service URL format: > http://clickhouse:8123/plausible

3. Access Your Instance

Once deployed, visit your BASE_URL and register the first user account.


Environment Variables

Required

VariableDescription
BASE_URLPublic URL (no trailing slash), e.g. https://plausible.yourdomain.com
SECRET_KEY_BASEAt least 64-byte random base64 string for cookie signing
DATABASE_URLPostgreSQL connection string (auto-populated by Railway plugin)
CLICKHOUSE_DATABASE_URLClickHouse connection string (http://clickhouse:8123/plausible)

Registration

VariableDescription
DISABLE_REGISTRATIONSet to true to prevent new user signups after initial setup
ENABLE_EMAIL_VERIFICATIONSet to true to require email verification
TOTP_VAULT_KEYKey for encrypting TOTP two-factor secrets

Email (SMTP)

VariableDescription
MAILER_ADAPTEREmail adapter: Bamboo.SMTPAdapter (SMTP), Bamboo.PostmarkAdapter, etc.
MAILER_EMAILFrom email address for outgoing emails
MAILER_NAMEFrom name for outgoing emails
SMTP_HOST_ADDRSMTP server address
SMTP_HOST_PORTSMTP server port
SMTP_USER_NAMESMTP username
SMTP_USER_PWDSMTP password
SMTP_HOST_SSL_ENABLEDSet to true to enable SSL/TLS

Google Auth

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret

IP Geolocation

VariableDescription
IP_GEOLOCATION_DBGeolocation database: city (MaxMind City)
MAXMIND_LICENSE_KEYMaxMind license key for GeoIP database downloads

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     Railway Project                          │
│                                                              │
│  ┌──────────────────┐      ┌──────────────────┐            │
│  │   Plausible CE    │─────▶│    ClickHouse     │           │
│  │   (Elixir/Phoenix)│      │   (Analytics DB)  │          │
│  │   :8000           │      │   :8123/:9000     │           │
│  └────────┬──────────┘      └──────────────────┘            │
│           │                                                 │
│           ▼                                                 │
│  ┌──────────────────┐                                       │
│  │   PostgreSQL      │                                       │
│  │   (Railway Plugin)│                                       │
│  └──────────────────┘                                       │
└─────────────────────────────────────────────────────────────┘
  • Plausible CE — Main application server (Elixir/Phoenix)
  • ClickHouse — Columnar analytics database for storing events
  • PostgreSQL — Relational database for users, sites, and metadata

All internal communication happens over Railway's private network.


Troubleshooting

ClickHouse fails to start

ClickHouse requires SSE 4.2 or NEON CPU instruction support. Most modern CPUs support this. If using an older/ARM instance:

  1. Check Railway's region for CPU compatibility
  2. Consider using an external ClickHouse Cloud service instead

Connection refused to services

Services may need time to start. ClickHouse and PostgreSQL start in parallel:

  • ClickHouse: ~30 seconds startup time
  • PostgreSQL: ~10 seconds startup time
  • Plausible CE: waits for both before starting

Registration is open

Anyone who knows your URL can register. After creating your account:

  1. Set DISABLE_REGISTRATION=true in Railway dashboard
  2. Restart the Plausible service

Health check fails

The health endpoint is at /api/health. Plausible CE takes 30-60 seconds to start on first deploy as it runs database migrations. This is normal.


License

Plausible CE is licensed under AGPL-3.0.


Resources


Template Content

More templates in this category

View Template
Rocky Linux
[Jun'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
15
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
70
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
44