# Self-host ClickHouse

> A columnar database built for fast analytical queries over large datasets.

- Page: https://levelrail.com/templates/clickhouse/
- JSON: https://levelrail.com/templates/clickhouse.json
- Category: Database Tools
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/ClickHouse/ClickHouse
- Upstream docs: https://hub.docker.com/r/clickhouse/clickhouse-server

## Requirements
- Memory: about 1 GiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 26.3-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| clickhouse | clickhouse/clickhouse-server | 26.3-alpine | 8123 | clickhouse_data -> /var/lib/clickhouse |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| clickhouse | CLICKHOUSE_PASSWORD | generated |

## Deploy

### CLI

```bash
levelrail-cli templates deploy clickhouse --name my-clickhouse
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/clickhouse/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy ClickHouse on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id clickhouse for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image clickhouse/clickhouse-server:26.3-alpine is what you deploy there.

Self-host ClickHouse, ClickHouse docker compose file, deploy ClickHouse on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
