Deploy ClickHouse

Fast column database for real-time analytics, with a persistent volume

Deploy ClickHouse

/var/lib/clickhouse

Deploy and Host ClickHouse on Railway

ClickHouse is an open-source, column-oriented database for real-time analytics. It runs SQL queries over billions of rows in milliseconds, compresses data well, and takes data in at high speed. Teams use it for product analytics, logs, metrics and event data behind dashboards and APIs.

About Hosting ClickHouse

Hosting ClickHouse means running the server with persistent storage, a password-protected interface and sensible limits on its own logging. This template builds ClickHouse 26.10.4.207 from the official image, pinned by digest, in a public GitHub repo, so Railway offers you an update when a new version lands. Data lives on a volume at /var/lib/clickhouse. The HTTP interface (port 8123) gets a Railway domain with HTTPS, including the /play SQL console, and a generated password protects it. High-volume diagnostic system tables are off, and the query, part and error logs keep 7 days, so the volume doesn't fill up over time.

Common Use Cases

  • Product and web analytics over event data
  • Log, metrics and observability storage behind Grafana or your own dashboards
  • Backend database for analytics tools that support ClickHouse, such as Plausible, PostHog, Langfuse or Metabase

Dependencies for ClickHouse Hosting

  • ClickHouse server (official clickhouse/clickhouse-server image, 26.10.4.207)
  • A Railway volume for /var/lib/clickhouse

Deployment Dependencies

Implementation Details

The template asks for nothing at deploy time. It sets CLICKHOUSE_USER (default), a generated 32-character CLICKHOUSE_PASSWORD and CLICKHOUSE_DB (default). SQL user management is on, so you can run CREATE USER and GRANT. Other services in the project connect over the private network with ${{ClickHouse.CLICKHOUSE_URL}} (HTTP) or ${{ClickHouse.CLICKHOUSE_HOST}} on port 9000 (native). From outside, use the HTTPS URL in CLICKHOUSE_PUBLIC_URL:

curl -u "default:YOUR-PASSWORD" "https://YOUR-DOMAIN/?query=SELECT%20version()"

The native port is not exposed publicly, because without TLS it sends the password in clear text. Add a TCP proxy for port 9000 yourself if you need it. Set CLICKHOUSE_LOG_RETENTION_DAYS to keep more or fewer days of system logs.

Why Deploy ClickHouse on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying ClickHouse on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Plausible WordPress
Cookie-free WordPress stats from your own Plausible

onepush
0
View Template
Typesense Multilingual
Locale-aware multilingual search with Typesense

onepush
0
View Template
Formbricks
Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Two Workspaces
3