Skip to content

Deploy ClickHouse with the clickhouse template

Deployment

Deploy ClickHouse with the clickhouse template

Stand up ClickHouse, a fast analytical column store, on a single Quake AI instance using the validated OpenTofu template clickhouse. You apply the template, read the bootstrap credentials, connect with the HTTP interface, create a database and table, and run an analytical query.

ClickHouse is the query layer for large analytical datasets. You run it yourself; this is a self-hosted tool you operate, not a managed warehouse.

Monthly cost estimate

Pricing calculator ↗

Sized as a custom package on dedicated vCPU.

Starting template$68.20/mo

Monthly total for the required template above. Use the configurator below to add optional pieces and see the total update.

What each resource is for

ClickHouse host

m2a.large · 2 dedicated vCPU, 8 GiB RAM, 0.5 Gbps

Runs ClickHouse in Docker (analytical column store), with table data on an attached volume.

ClickHouse analytical workloads run on 2 vCPU and 8 GiB RAM. Size up for heavier query concurrency or larger in-memory working sets.

$66.00/mo

Compute shown per role at custom-package rates ($29/dedicated vCPU, $7.25/shared vCPU, $1/GiB RAM). The headline above is the billed total: the cheaper of a named plan and the custom package, plus add-ons.

Included in baseline

m2a.large

2 dedicated vCPU, 8 GiB RAM, 0.5 Gbps

$66.00

Compute + RAM rate basis

2 vCPU + 8 GiB RAM at $29/dedicated vCPU, $7.25/shared vCPU, $1/GiB RAM (regular). Totals apply the flat −$5/mo package promotion.

—

Block storage (90 GiB)

90 GiB at $0.08/GiB/mo

$7.20

Public IP (included)

1 included with the custom package

$0.00

Package promotional discount

Flat −$5.00/mo on the custom package (same promotion as named plans).

$-5.00

Included at no charge

These line items are zero on Quake AI. Many other providers meter them separately.

Data transfer (inbound and outbound)

Unlimited data transfer on every plan; Quake AI does not meter per-GB egress.

AWS, GCP, and Azure meter outbound transfer per GB. DigitalOcean and Hetzner include an allowance on compute plans, then charge overage.

Learn more
$0.00

Private networking

Private networks, subnets, Neutron routers, and security groups are included with the plan.

VPC objects are usually free to create elsewhere, but NAT gateways bill hourly plus per-GB processed. Quake AI uses router SNAT with no separate NAT line item.

$0.00

Control-plane API requests

OpenStack API calls for provisioning and management are included.

Some managed services on other clouds meter API calls or charge for premium control-plane features.

$0.00

Dev/test vs production

Start on shared CPU for dev/test, then promote to dedicated for production with a flavor resize. The network, storage, and template stay the same.

Dev/test on shared CPU

Burstable s1a flavors; suited to prototyping and low or bursty load.

$18.70/mo

Production on dedicated CPU

The headline estimate above; predictable steady-load performance.

$68.20/mo

Saves $49.50/mo while you build on shared CPU.

Shared flavors carry less RAM (m2a.large (8 GiB RAM) -> s1a.small (2 GiB RAM)). A resize reboots the instance; data on attached volumes persists. Size the dedicated flavor for the RAM your production workload needs.

Pricing data last validated: . For current rates, check quake.ai/pricing.

Prerequisites#

You need:

  • OpenTofu 1.6.0 or later (or Terraform 1.6.0 or later) installed locally.
  • Your OpenStack credentials sourced into the shell (source openrc.sh). See the OpenStack CLI guide.
  • An SSH keypair that already exists in your project. Record its name for the key_name variable.
  • A copy of the clickhouse template directory from the template reference page.
  • Your workstation's public IP address. Find it with curl -sS https://api.ipify.org.

Step 1: Set the variables and apply the template#

Copy the template's example variables file and set your key and workstation IP:

bash
cp terraform.tfvars.example terraform.tfvars
HCL
key_name             = "YOUR_KEY_NAME"
client_allowed_cidr  = "YOUR_IP/32"

Initialize, plan, and apply:

bash
tofu init
tofu plan
tofu apply

Record floating_ip and http_url from tofu output.

Step 2: Read the bootstrap credentials#

ClickHouse does not ship a default password. cloud-init writes credentials to /opt/clickhouse/.bootstrap-user:

bash
ssh ubuntu@YOUR_FLOATING_IP "sudo cat /opt/clickhouse/.bootstrap-user"

Confirm the container is running:

bash
ssh ubuntu@YOUR_FLOATING_IP "sudo docker ps --filter name=clickhouse"

Step 3: Create a database and run a query#

Replace YOUR_PASSWORD with the password from step 2:

bash
curl "http://YOUR_FLOATING_IP:8123/?user=default&password=YOUR_PASSWORD" \
  --data-binary "CREATE DATABASE IF NOT EXISTS demo"

curl "http://YOUR_FLOATING_IP:8123/?user=default&password=YOUR_PASSWORD" \
  --data-binary "
CREATE TABLE IF NOT EXISTS demo.events (
  event_date Date,
  event_name String,
  count UInt32
) ENGINE = MergeTree()
ORDER BY (event_date, event_name);

INSERT INTO demo.events VALUES
  ('2026-07-01', 'page_view', 120),
  ('2026-07-01', 'signup', 8),
  ('2026-07-02', 'page_view', 95),
  ('2026-07-02', 'signup', 12)
"

curl "http://YOUR_FLOATING_IP:8123/?user=default&password=YOUR_PASSWORD" \
  --data-binary "
SELECT event_name, sum(count) AS total
FROM demo.events
GROUP BY event_name
ORDER BY total DESC
FORMAT PrettyCompact
"

What you built#

  • Applied the clickhouse template to provision network, security group, data volume, instance, and floating IP
  • Read bootstrap credentials and connected over the HTTP interface
  • Created a database, loaded sample data, and ran an aggregation query

Scope of this deployment#

This template runs a single-VM ClickHouse host, not a managed warehouse. The instance is CPU-only and runs in one region. You operate the instance, Docker, ClickHouse, and the data volume yourself.

Next steps#

Clean up#

bash
tofu destroy

Export any datasets you want to keep before you destroy.

Before this
Was this page helpful?