---
title: "Deploy ClickHouse"
description: "Fast column database for real-time analytics, with a persistent volume"
category: "Analytics"
url: https://railway.com/deploy/clickhouse-3
---

# Deploy ClickHouse

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

**[Deploy ClickHouse on Railway](https://railway.com/template/clickhouse-3)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/clickhouse-3/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Analytics

## Template content

### ClickHouse https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/clickhouse.png

- **Source:** https://github.com/aalfath/clickhouse-railway-template
- **Health check:** /ping
- **Public domain:** Yes

## Documentation

# 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

* [ClickHouse documentation](https://clickhouse.com/docs)
* [ClickHouse Docker image](https://hub.docker.com/r/clickhouse/clickhouse-server)
* [ClickHouse 26.10.4.207 release](https://github.com/ClickHouse/ClickHouse/releases/tag/v26.10.4.207-stable)
* [Template repo](https://github.com/aalfath/clickhouse-railway-template)

### 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.



## Similar templates

- [Plausible WordPress](https://railway.com/deploy/deploy-plausible-for-wordpress-sites) — Cookie-free WordPress stats from your own Plausible
- [Typesense Multilingual](https://railway.com/deploy/deploy-typesense-multilingual-search) — Locale-aware multilingual search with Typesense
- [Formbricks](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Open this page in a browser: https://railway.com/deploy/clickhouse-3
