Self-host ClickHouse in one click

Run the free, open-source ClickHouse server on your own VPS for a flat monthly price, with no compute-hour bill and backups you can restore.

Terminal
$ curl -fsSL https://sshworkbench.com/install.sh | bash

Free 7-day trial. No sign-up, no credit card.

Deploy ClickHouse dialog in SSH Workbench

Last updated November 16, 2026

Is self-hosted ClickHouse free?

Yes. ClickHouse is open source under the Apache 2.0 license, and the server you run yourself has no paid edition, no row limit and no feature gate. You can use it inside a commercial product, sell services around it or change the code. Apache 2.0 only asks you to keep the license and copyright notices when you redistribute it.

What costs money is ClickHouse Cloud, the managed service run by ClickHouse, Inc. Self-hosting it means paying for a server and doing the operations work yourself: backups, updates and monitoring.

Self-hosted ClickHouse vs ClickHouse Cloud: what it costs

ClickHouse Cloud bills by usage, with no monthly minimum. One compute unit is 8 GiB of RAM and 2 vCPUs. In AWS us-east-1 it costs $0.21811 an hour on the Basic plan and $0.29846 on Scale, plus $25.30 per TB of storage each month. Basic is capped at 1 TB of storage and 8 to 12 GiB of memory. New accounts get $300 of credit for 30 days.

The figures below assume the service runs around the clock (732 hours, the month ClickHouse's own calculator uses) and leave out storage, backups and egress.

OptionPer monthPer yearMemory
VPS, DigitalOcean Basic 8 GB$48$5768 GB
VPS, DigitalOcean Basic 16 GB$96$1,15216 GB
ClickHouse Cloud Basic, 1 compute unitabout $160about $1,9168 GiB
ClickHouse Cloud Scale, 2 replicas of 8 GiBabout $437about $5,2442 × 8 GiB

A 16 GB droplet costs less than the smallest Cloud service running all day, and its disk is included. Budget hosts such as Hetzner list 8 GB servers for under €10 a month when they have stock. Cloud wins when the database sits idle most of the day, since compute scales to zero, or when you need replicas without running them yourself.

With SSH Workbench, add $199 once or $9 a month. The first year on a $48 VPS then comes to about $775, still well under a year of Cloud Basic, and every year after costs only the server.

ClickHouse self-hosted requirements

  • RAM. ClickHouse recommends 32 GB or more. It runs on as little as 2 GB with extra tuning and a low ingest rate, and below 16 GB you may hit memory errors on heavy queries. For a side project or a Langfuse instance, 8 GB is a workable start; give it 16 GB if queries grow.
  • CPU. The amd64 image needs an x86-64-v3 CPU (AVX2), which almost every server CPU since 2015 has. The arm64 image needs ARMv8.2-A.
  • Disk. SSD if you can. ClickHouse's docs recommend ext4 with noatime, or XFS.
  • A domain, such as ch.example.com, only if apps outside the server need to connect.
  • Docker or Podman on the server.

Self-host ClickHouse in one click with SSH Workbench

  1. Connect your server in SSH Workbench, open Apps, then Deploy app, and pick ClickHouse.
  2. Keep the container name clickhouse or type your own.
  3. Under Who needs to connect to this database?, choose Just apps on this server (recommended). Both ports, 8123 for HTTP and 9000 for the native protocol, are bound to 127.0.0.1, and you reach them over an SSH tunnel.
  4. Or choose External services (Vercel, AWS, my other servers) and enter a domain whose A record points at the server. SSH Workbench secures both ports with a Let's Encrypt certificate and gives you an encrypted connection string.
  5. Pick Backups: None, Daily or Hourly. Daily keeps 7 days.
  6. Click Deploy. A 24-character password is generated for the default user; save it from the screen that appears after the deploy, because it is shown once.

Your data lives in a named volume on the server, so it survives restarts and updates.

Self-host ClickHouse with docker compose

To set it up by hand, this compose file follows the official image's documentation. Replace the password.

services:
  clickhouse:
    image: clickhouse/clickhouse-server:25.8
    restart: unless-stopped
    ports:
      - "127.0.0.1:8123:8123"
      - "127.0.0.1:9000:9000"
    environment:
      CLICKHOUSE_PASSWORD: change-me
      CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    volumes:
      - clickhouse_data:/var/lib/clickhouse
      - clickhouse_logs:/var/log/clickhouse-server

volumes:
  clickhouse_data:
  clickhouse_logs:

Start it with docker compose up -d, then check it answers:

curl http://127.0.0.1:8123/ping
docker compose exec clickhouse clickhouse-client --password change-me --query "SELECT version()"

Setting a password is what gives the default user network access; without it the image locks that user down. CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT lets it create other users with CREATE USER, which you will want for each app.

Connecting to ClickHouse and the built-in UI

ClickHouse has a web UI built in. Open an SSH tunnel from your laptop, using the host ports shown for the app:

ssh -L 8123:127.0.0.1:8123 -L 9000:127.0.0.1:9000 user@your-server

Then open http://localhost:8123/play, log in as default and run SQL in the browser. GUI clients such as DBeaver or DataGrip connect to localhost:8123 through the same tunnel.

Apps running directly on the server use 127.0.0.1 and the port. Containers cannot reach the host's 127.0.0.1; put them on the same Docker network and use the container name, clickhouse, with port 8123 or 9000.

With External services, the connection string looks like this, over TLS:

clickhouse://default:[email protected]:PORT/default?secure=true

Using it with Langfuse or Sentry

Most people searching for self-hosted ClickHouse need it for another tool.

  • Langfuse requires ClickHouse. Point CLICKHOUSE_URL at the HTTP port, CLICKHOUSE_MIGRATION_URL at the native port (clickhouse://host:9000), set the user and password, and set CLICKHOUSE_CLUSTER_ENABLED=false for a single server. The server must run in UTC. Langfuse v3 needs ClickHouse 24.3 or newer, and v4 needs 25.12 or newer.
  • Sentry self-hosted ships its own ClickHouse container in its compose setup. You do not need a separate one; size the server for Sentry as a whole. Langfuse and Sentry also need PostgreSQL and Redis.

Backups

All of ClickHouse's data lives in /var/lib/clickhouse, the clickhouse_data volume. For consistent backups while the server runs, use ClickHouse's own BACKUP command. Add a backup disk in /etc/clickhouse-server/config.d/backup_disk.xml and mount a host folder at /backups:

<clickhouse>
    <storage_configuration>
        <disks>
            <backups>
                <type>local</type>
                <path>/backups/</path>
            </backups>
        </disks>
    </storage_configuration>
    <backups>
        <allowed_disk>backups</allowed_disk>
        <allowed_path>/backups/</allowed_path>
    </backups>
</clickhouse>

Restart ClickHouse, then back up and restore a table:

BACKUP TABLE mydb.events TO Disk('backups', 'events-1.zip');
RESTORE TABLE mydb.events FROM Disk('backups', 'events-1.zip');

BACKUP DATABASE mydb works the same way. A restore fails if the table already holds data.

SSH Workbench's backups archive the whole data volume to a .tar.gz on a daily or hourly schedule and keep 7 days of them. Restoring one puts the volume back exactly as it was.

Updating

With docker compose, change the image tag, then pull and recreate:

docker compose pull
docker compose up -d

ClickHouse aims for a one-year compatibility window, which spans two LTS releases. Within that window you can upgrade in one step. For a bigger jump, go through an intermediate version less than a year newer than yours. You can usually downgrade to a version less than a year old, but only if you have not used any of the new version's features. Take a backup first.

Troubleshooting

"Connection refused" on port 8123 or 9000. The port is bound to 127.0.0.1, so it only answers on the server itself. Connect through an SSH tunnel, or use the External services option for remote apps. Inside Docker, localhost means the container, not the host.

"Authentication failed" for the default user. The default user has no network access when the image starts without a password. Set CLICKHOUSE_PASSWORD and recreate the container with docker compose up -d, then log in as default with that password.

"Illegal instruction" on startup. The CPU lacks AVX2 or another x86-64-v3 instruction, common on old hosts or a hypervisor that hides CPU features. Move to a newer server or ask the host to pass through the host CPU model.

"Memory limit exceeded" during queries. The query needs more RAM than the server or container allows. Add LIMITs and filters, lower max_threads for that query, or move to a server with 16 GB or more.

Self-hosting ClickHouse: questions

When should you use ClickHouse?

Use it for analytics on large, append-heavy data: events, logs, metrics, traces and product analytics, where queries scan and aggregate millions of rows. It is a poor fit for a typical app database with frequent single-row updates and deletes. Most teams keep PostgreSQL or MySQL for the app and send events to ClickHouse.

Can I run ClickHouse locally with Docker?

Yes, and the docker compose file on this page works on a laptop as it is. Docker Desktop on macOS and Windows runs the same clickhouse/clickhouse-server image, and the web UI opens at localhost:8123/play. Keep the data in a named volume so it survives a container restart.

Can I self host ClickHouse on AWS or Kubernetes?

Both work. On AWS, Azure or Google Cloud, a plain VM with Docker runs the same compose file as any VPS; pick a memory-heavy instance and attach SSD storage. For Kubernetes, the ClickHouse Kubernetes Operator is the supported route, and it is worth the extra work only when you need replicas and shards across several nodes.

Can I run ClickHouse without Keeper?

Yes. A single ClickHouse server stores and queries data on its own; ClickHouse Keeper only coordinates replication and ON CLUSTER DDL between servers. You need Keeper, or ZooKeeper, once you use ReplicatedMergeTree tables or a multi-node cluster. Tools that assume a cluster, like Langfuse, have a setting to turn ON CLUSTER off.

Does ClickHouse run on ARM servers?

Yes. The official image ships an arm64 build, so Ampere servers such as Hetzner's CAX line and AWS Graviton instances work. The arm64 image needs an ARMv8.2-A CPU, and ClickHouse lists the Raspberry Pi 4 as unsupported.

ClickHouse is a trademark of ClickHouse, Inc.. SSH Workbench is not affiliated with or endorsed by ClickHouse, Inc..

Deploy ClickHouse in one click

Install SSH Workbench, connect your server and pick ClickHouse from the catalog.

Terminal
$ curl -fsSL https://sshworkbench.com/install.sh | bash

Free 7-day trial. No sign-up, no credit card.