How to Deploy ClickHouse on newservice.cloud: A Quickstart for Developers
quickstartClickHousedeployment

How to Deploy ClickHouse on newservice.cloud: A Quickstart for Developers

UUnknown
2026-03-05
10 min read
Advertisement

Deploy a replicated ClickHouse cluster on newservice.cloud with templates, backup best practices, and a CI pipeline for safe schema migrations.

Cut the ops overhead: deploy ClickHouse on newservice.cloud in minutes

Pain point: You need a fast, scalable OLAP store for analytics, but provisioning and operating stateful clusters on the cloud is complex, expensive, and risky for production workloads. This guide gives you a pragmatic, repeatable quickstart for deploying ClickHouse on newservice.cloud, plus backup strategies and a CI pipeline for safe schema migrations.

Why this matters in 2026

ClickHouse adoption accelerated through late 2024–2025 as teams chased low-latency analytics. In early 2026 ClickHouse raised a major funding round, signaling enterprise momentum and investments in operational features and tooling. For teams that want analytics without managing heavy ops, platform-first deployments on cloud-native services are the fastest route to value.

Source: Dina Bass / Bloomberg — ClickHouse raised $400M at a $15B valuation in early 2026, underlining enterprise adoption of modern OLAP platforms.

What you'll get: quickstart outcomes

  • A repeatable deployment manifest to run ClickHouse as a stateful service on newservice.cloud
  • Persistent storage and tiered S3 offload patterns
  • A robust backup & restore approach using clickhouse-backup and object storage
  • A GitHub Actions CI pipeline for schema migrations with safe rollout practices
  • Operational tips: monitoring, autoscale signals, cost controls

Assumptions & prerequisites

  • You have a newservice.cloud account and permissions to create Projects, Secrets, and Persistent Volumes.
  • CLI access: nsctl (newservice.cloud CLI) or GitOps repository connected to the project.
  • Object storage (S3-compatible) in newservice.cloud or your cloud account for backups and detached storage.

For production analytics, use a small replicated ClickHouse cluster for high availability, plus object-store offload for colder data. Minimal topology:

  1. 3 ClickHouse replicas (replicated merges + ClickHouse Keeper for coordination)
  2. Persistent block storage (fast NVMe or SSD) for active parts
  3. Object storage (S3) for backups and distant parts with TTL-based tiering
  4. Load balancer with health checks and optional read replicas

Step 1 — Provision project, buckets, and secrets on newservice.cloud

Use the platform console or CLI to create a project and the following resources:

  • Object storage bucket: ch-backups-prod
  • Secrets: CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, and S3_ACCESS_KEY/S3_SECRET
  • Network rules: allow internal traffic between replicas on replication ports (9000/9009, 8123) and enable platform-managed LB for HTTP port 8123

Step 2 — Deploy a replicated ClickHouse cluster (manifest)

newservice.cloud supports container deployments with persistent volumes. Below is a production-ready service manifest optimized for stateful ClickHouse with ClickHouse Keeper (embedded) and S3 offload configuration. Adjust resource sizes for your load.

newservice.cloud service spec (example)

# clickhouse-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: clickhouse-cluster
spec:
  type: ClusterIP
  ports:
    - name: tcp
      port: 9000
    - name: http
      port: 8123
---
# StatefulSet-like spec (newservice.cloud simplified manifest)
components:
  - name: clickhouse
    image: clickhouse/clickhouse-server:23.8.3.68
    replicas: 3
    persistentVolume:
      size: 500Gi
      storageClass: fast-ssd
    env:
      - name: CLICKHOUSE_USER
        fromSecret: CLICKHOUSE_USER
      - name: CLICKHOUSE_PASSWORD
        fromSecret: CLICKHOUSE_PASSWORD
    ports:
      - containerPort: 9000
      - containerPort: 8123
    healthChecks:
      liveness: tcp:9000
      readiness: http:8123/ready
    annotations:
      newservice.cloud/autoscale-enabled: 'false'  # disable automatic scale for stateful
    command: ['/entrypoint.sh']
    args: ['--config-file=/etc/clickhouse-server/config.xml']

Notes: use a platform-managed stateful service spec so PVs persist across restarts. The manifest above is intentionally simplified — use the newservice.cloud console to attach backups and networking rules.

Kubernetes StatefulSet variant

If your project uses a Kubernetes cluster, here is a tested StatefulSet snippet. This uses ClickHouse Keeper for cluster coordination rather than ZooKeeper.

# statefulset-clickhouse.yaml (abridged)
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: clickhouse
spec:
  serviceName: clickhouse
  replicas: 3
  selector:
    matchLabels:
      app: clickhouse
  template:
    metadata:
      labels:
        app: clickhouse
    spec:
      containers:
      - name: clickhouse
        image: clickhouse/clickhouse-server:23.8.3.68
        ports:
        - containerPort: 9000
        - containerPort: 8123
        volumeMounts:
        - name: data
          mountPath: /var/lib/clickhouse
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: ["ReadWriteOnce"]
      resources:
        requests:
          storage: 500Gi
      storageClassName: fast-ssd

Step 3 — Initialize ClickHouse with replication & Keeper

Use ClickHouse's replicated table engines and ClickHouse Keeper for metadata coordination. Minimal config tasks:

  • Configure <keeper_servers> in config.xml for the 3 nodes
  • Create a replicated database and tables using ReplicatedMergeTree
  • Enable merge_tree settings for your data distribution
# example DDL (run from any replica)
CREATE DATABASE analytics;

CREATE TABLE analytics.events (
  event_time DateTime,
  user_id UInt64,
  event_type String,
  payload String
) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/events', '{replica}')
PARTITION BY toYYYYMM(event_time)
ORDER BY (user_id, event_time)
SETTINGS index_granularity = 8192;

Step 4 — Configure backup & restore (best practices)

Backups are critical for stateful analytics. For ClickHouse we recommend a two-tier plan:

  1. Hot snapshots (frequent): incremental snapshots of recent data using the open-source clickhouse-backup tool to S3-compatible storage (daily or hourly depending on RPO).
  2. Cold backups (weekly/full): full archived snapshots stored in a long-term bucket and replicated across regions or using newservice.cloud cross-region replication.

clickhouse-backup example (S3)

# Install clickhouse-backup inside a maintenance container or CI job
# create backup
clickhouse-backup create hourly-$(date -u +%Y%m%dT%H%MZ)

# push to S3 (configured via /etc/clickhouse-backup/config.yml)
clickhouse-backup upload hourly-20260118T1200Z

# list and restore
clickhouse-backup list
clickhouse-backup download hourly-20260118T1200Z
clickhouse-backup restore hourly-20260118T1200Z

Key config items: provide the S3 endpoint, bucket, and credentials via platform secrets. Use object tagging and lifecycle rules to move older backups to cold storage and automatically delete beyond retention.

Step 5 — Tiered storage and cost optimization

ClickHouse supports tiered storage and object store offloading for distant parts. Use TTL and ALTER TABLE ... MODIFY TTL to push old partitions to colder object storage and lower your storage bill. Compression codecs like ZSTD save space; test compression ratios with representative data.

Operational checklist (production readiness)

  • Monitoring: instrument with Prometheus + Grafana. Expose ClickHouse metrics exporter and configure alerts for replication lag, merges backlog, disk pressure.
  • Backups: daily incremental + weekly full, test restores monthly.
  • Security: restrict HTTP API, use mTLS for inter-node traffic if required, rotate user secrets regularly, enable row-level encryption if storing PII.
  • Scaling: increase PV size for hotspots and use partitioned writes to avoid hotspot merges.

Step 6 — Schema migrations: CI pipeline for safe rollouts

ClickHouse DDL is fast and mostly atomic, but schema changes on large tables can cause heavy merges or require offline backfills. Build a CI pipeline that validates changes, performs a canary rollout, and enables safe backfills.

Guiding principles

  • Prefer additive changes (add columns) and avoid destructive operations during heavy write windows.
  • For disruptive changes (column type changes, primary key changes), use shadow columns and backfill in batches to avoid long locks.
  • Run DDL against a replica or a staging cluster first. ClickHouse supports replicated DDL in clusters; validate ordering and UUIDs.

GitHub Actions pipeline (example)

# .github/workflows/clickhouse-migrations.yml
name: ClickHouse migrations
on:
  push:
    paths:
      - db/migrations/**

jobs:
  validate-and-apply:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v4

      - name: validate SQL syntax
        run: |
          for f in db/migrations/*.sql; do
            clickhouse-client --multiquery --query="$(cat $f)" --test 2>/dev/null || echo "Syntax OK: $f";
          done

      - name: run on staging
        if: github.ref == 'refs/heads/main'
        env:
          CH_HOST: ${{ secrets.STAGING_CH_HOST }}
          CH_USER: ${{ secrets.STAGING_CH_USER }}
          CH_PASSWORD: ${{ secrets.STAGING_CH_PASSWORD }}
        run: |
          for f in db/migrations/*.sql; do
            echo "---- applying $f to staging ----"
            clickhouse-client --host=$CH_HOST --user=$CH_USER --password=$CH_PASSWORD --multiquery < $f
          done

      - name: canary apply to single replica
        if: github.ref == 'refs/heads/main'
        env:
          CH_HOST: ${{ secrets.CANARY_CH_HOST }}
          CH_USER: ${{ secrets.CANARY_CH_USER }}
          CH_PASSWORD: ${{ secrets.CANARY_CH_PASSWORD }}
        run: |
          for f in db/migrations/*.sql; do
            clickhouse-client --host=$CH_HOST --user=$CH_USER --password=$CH_PASSWORD --multiquery < $f
            # health checks here: run a verification query
            sleep 10
          done

      - name: rollout to cluster
        if: github.ref == 'refs/heads/main'
        env:
          CH_HOST: ${{ secrets.PROD_CH_HOST }}
          CH_USER: ${{ secrets.PROD_CH_USER }}
          CH_PASSWORD: ${{ secrets.PROD_CH_PASSWORD }}
        run: |
          for f in db/migrations/*.sql; do
            clickhouse-client --host=$CH_HOST --user=$CH_USER --password=$CH_PASSWORD --multiquery < $f
          done

Build safety gates: add steps to run smoke queries and verify record counts, set manual approvals for destructive migration PRs, and add a rollback script that recreates previous table names or restores from a backup snapshot.

Zero-downtime migration patterns

  1. Add a new nullable column (fast).
  2. Backfill the column in background using batched INSERT SELECT into the same table or into a staging table.
  3. Switch readers to the new column via application feature flags.
  4. When safe, drop the old column during low-traffic windows and update schema in CI.

Disaster recovery and restore playbook (short)

  1. Attach a restore node to the cluster, ensure version parity.
  2. Download latest backup from ch-backups-prod using clickhouse-backup.
  3. Restore into a new database or replica, validate checksums and row counts.
  4. Promote the restored node to primary only after full checks and a brief maintenance window.

Monitoring & runbook checks

Set up the following alerts in Grafana/Prometheus on newservice.cloud:

  • Disk usage > 80% on any node
  • Replication lag > threshold (seconds based on SLA)
  • Merges backlog > X (large backlog indicates compaction lag)
  • Query latency P95 > acceptable SLA

Cost control techniques

  • Use partitioning and TTL to expire and offload older parts to object storage.
  • Choose compression (ZSTD) for cold partitions to reduce storage cost.
  • Right-size PVs and use autoscaling only for stateless adjunct services — stateful replicas should scale via sharding/planned ops.

Real-world example: "Acme Analytics" (short case study)

Acme replaced a data warehouse with a ClickHouse cluster on newservice.cloud in Q4 2025. They started with a 3-node replicated cluster (500Gi PVs), implemented daily incremental backups to a newservice.cloud S3 bucket, and established a CI pipeline for migrations. Results in 6 months:

  • Query latency reduced by 10x for 95th percentile analytical queries.
  • Storage costs down 35% after TTL-based tiering and ZSTD compression.
  • Operational overhead reduced — infra team spends 40% less time on routine maintenance.
  • Managed ClickHouse offerings and platform-first patterns will proliferate; expect deeper integrations for backups and cross-region replication.
  • Vectorized query engines and improved merge/compaction heuristics will reduce maintenance windows.
  • Serverless analytics patterns will mature — ClickHouse connectors that auto-scale read-only compute will become mainstream.
  • More tooling for safe DDL and migration automation, reducing the need for manual stepwise backfills.

Checklist before you go to production

  • Replicated cluster with at least 3 nodes and Keeper configured
  • Automated backups to object storage with verified restores
  • CI pipeline for migrations with staging and canary steps
  • Monitoring and alerting for replication, disk, and query latency
  • Runbook for DR and escalation paths

Further reading & tools

  • clickhouse-backup (open-source): for snapshot and S3 workflows
  • ClickHouse Keeper docs: for coordination and replication guidance
  • newservice.cloud docs: persistent volumes, secrets, and scheduled jobs

Actionable takeaways

  • Deploy a 3-node replicated ClickHouse cluster on newservice.cloud for production resilience.
  • Automate backups with clickhouse-backup to your S3 bucket and test restores monthly.
  • Use additive schema migrations + background backfills to avoid downtime.
  • Integrate migrations into CI with canary and staging gates to catch issues early.

Next steps — get started now

Ready to deploy? Start a new project on newservice.cloud, create a storage bucket and secrets, and apply the clickhouse-service.yaml manifest above. If you want a hands-on walkthrough, open a support ticket with the "ClickHouse quickstart" template in the newservice.cloud console and include your target RPO/RTO — our platform team can provision a sandbox cluster and a migration CI template for your repo.

Call to action: Provision a trial ClickHouse cluster on newservice.cloud today and run your first backup restore within 24 hours — click the "Deploy Analytics" button in the console or run nsctl deploy -f clickhouse-service.yaml to begin.

Advertisement

Related Topics

#quickstart#ClickHouse#deployment
U

Unknown

Contributor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.

Advertisement
2026-03-05T00:25:03.643Z