Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • All guides
      • Pre-configuration
      • FQDNs of hosts
      • Connecting from applications
      • Code examples
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Configuring security groups
  • Getting SSL certificates
  • What's next
  • Useful links
  1. Step-by-step guides
  2. Connection
  3. Pre-configuration

Pre-configuring a ClickHouse® cluster connection

Written by
Yandex Cloud
Updated at July 6, 2026
View in Markdown
  • Configuring security groups
  • Getting SSL certificates
  • What's next
  • Useful links

You can connect to Managed Service for ClickHouse® cluster hosts:

  • Via the internet, if you configured public access for the host. These hosts can only be accessed over SSL.

  • From Yandex Cloud virtual machines located in the same cloud network. For hosts without public access, SSL is not required to connect to them from these virtual machines.

You can connect to a cluster either with encryption (on ports 9440 for clickhouse-client and 8443 for the HTTP interface) or without it (on ports 9000 and 8123, respectively).

Configuring security groupsConfiguring security groups

To connect to a cluster, security groups must include rules allowing traffic from certain ports, IP addresses, or from other security groups.

Rule settings depend on the chosen connection method:

Over the internet
From a Yandex Cloud VM

Configure all the cluster security groups to allow incoming traffic on ports 8443 and 9440 from any IP address. To do this, create the following rules for incoming traffic:

  • Port range: 8443 and 9440.
  • Protocol: TCP.
  • Source: Address range.
  • IPv4 CIDR: 0.0.0.0/0.

Create a separate rule for each port.

Warning

For a more secure cluster, specify only trusted IP addresses or subnets in the IPv4 CIDR field.

  1. Configure all the cluster security groups to allow incoming traffic from your VM's security group on ports 8123, 8443, 9000, and 9440. To do this, create the following rules for incoming traffic in these security groups:

    • Port range: 8123 (or any of the other ports listed).
    • Protocol: TCP.
    • Source: Security group.
    • Security group: If your cluster and VM share the same security group, select Current (Self). Otherwise, specify the VM security group.

    Create a separate rule for each port.

  2. Configure the VM security group to allow VM connections and traffic between the VM and cluster hosts.

    For example, you can set the following rules for your VM:

    • For incoming traffic:

      • Port range: 22.
      • Protocol: TCP.
      • Source: Address range.
      • IPv4 CIDR: 0.0.0.0/0.

      This rule allows inbound VM connections over SSH.

    • For outgoing traffic:

      • Port range: 0-65535.
      • Protocol: Any (Any).
      • Destination name: Address range.
      • IPv4 CIDR: 0.0.0.0/0.

      This rule permits all outbound traffic, allowing you to install any necessary certificates and tools on your VM.

Note

You can specify more granular security group rules, such as allowing traffic only in specific subnets.

Make sure to configure the security groups correctly for all subnets where the cluster hosts will reside. With incomplete or incorrect security group settings, you may lose access to the cluster.

For more information about security groups, see Network and database clusters.

Getting SSL certificatesGetting SSL certificates

To use an encrypted connection, get an SSL certificate:

Linux (Bash)
macOS (Zsh)
Windows (PowerShell)
sudo mkdir --parents /usr/local/share/ca-certificates/Yandex/ && \
sudo wget "https://storage.yandexcloud.net/cloud-certs/RootCA.pem" \
     --output-document /usr/local/share/ca-certificates/Yandex/RootCA.crt && \
sudo wget "https://storage.yandexcloud.net/cloud-certs/IntermediateCA.pem" \
     --output-document /usr/local/share/ca-certificates/Yandex/IntermediateCA.crt && \
sudo chmod 655 \
     /usr/local/share/ca-certificates/Yandex/RootCA.crt \
     /usr/local/share/ca-certificates/Yandex/IntermediateCA.crt && \
sudo update-ca-certificates

The certificates will be saved to the following files:

  • /usr/local/share/ca-certificates/Yandex/RootCA.crt
  • /usr/local/share/ca-certificates/Yandex/IntermediateCA.crt
sudo mkdir -p /usr/local/share/ca-certificates/Yandex/ && \
sudo wget "https://storage.yandexcloud.net/cloud-certs/RootCA.pem" \
     --output-document /usr/local/share/ca-certificates/Yandex/RootCA.crt && \
sudo wget "https://storage.yandexcloud.net/cloud-certs/IntermediateCA.pem" \
     --output-document /usr/local/share/ca-certificates/Yandex/IntermediateCA.crt && \
sudo chmod 655 \
     /usr/local/share/ca-certificates/Yandex/RootCA.crt \
     /usr/local/share/ca-certificates/Yandex/IntermediateCA.crt && \
security import /usr/local/share/ca-certificates/Yandex/RootCA.crt -k ~/Library/Keychains/login.keychain; \
security import /usr/local/share/ca-certificates/Yandex/IntermediateCA.crt -k ~/Library/Keychains/login.keychain

The certificates will be saved to the following files:

  • /usr/local/share/ca-certificates/Yandex/RootCA.crt
  • /usr/local/share/ca-certificates/Yandex/IntermediateCA.crt
  1. Download and import the certificates:

    mkdir -Force $HOME\.yandex; `
    curl.exe https://storage.yandexcloud.net/cloud-certs/RootCA.pem `
      --output $HOME\.yandex\RootCA.crt; `
    curl.exe https://storage.yandexcloud.net/cloud-certs/IntermediateCA.pem `
      --output $HOME\.yandex\IntermediateCA.crt; `
    Import-Certificate `
      -FilePath $HOME\.yandex\RootCA.crt `
      -CertStoreLocation cert:\CurrentUser\Root; `
    Import-Certificate `
      -FilePath $HOME\.yandex\IntermediateCA.crt `
      -CertStoreLocation cert:\CurrentUser\Root
    

    Your corporate security policies and antivirus software may block the certificate download. For more information, see FAQ.

  2. Agree to install the certificates in the Trusted Root Certification Authorities storage.

The certificates will be saved to the following files:

  • $HOME\.yandex\RootCA.crt
  • $HOME\.yandex\IntermediateCA.crt

To use graphical IDEs, save a certificate to a local folder and specify the path to it in the connection settings.

What's nextWhat's next

  • Get the FQDN of the host you want to connect to.
  • Connect to the cluster using a browser, graphical IDE, or CLI.
  • Integrate the cluster connection into your application code.

Useful linksUseful links

  • ClickHouse® connection FAQ

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
Deleting a cluster
Next
FQDNs of hosts
© 2026 Direct Cursus Technology L.L.C.