---
title: How to connect to your deployment
description: Learn how to connect yourself or your applications to your Scaleway Data Warehouse for ClickHouse® deployment.
tags: connect applications deployment data warehouse clickhouse
dates:
  validation: 2025-06-03
  posted: 2025-06-03
---
import Requirements from '@macros/iam/requirements.mdx'


This page explains how to connect yourself or your applications to your Data Warehouse for ClickHouse® deployment using the [Scaleway console](https://console.scaleway.com).

To connect your deployment with BI tools, refer to the [dedicated documentation](/data-warehouse/how-to/connect-bi-tools/).

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- Created a [Data Warehouse deployment](/data-warehouse/how-to/create-deployment/)

1. Click **ClickHouse®** under **Data & Analytics** on the side menu. The Data Warehouse deployment page displays.

2. Click the name of the Data Warehouse deployment you want to connect to. The overview tab of the deployment displays.

3. Click the **Actions** button in the top-right corner of the page. A drop-down menu displays.

4. Select **Connect using frameworks**. The connection wizard displays. 

    <Message type="note">
    To connect your deployment with BI tools, refer to the [dedicated documentation](/data-warehouse/how-to/connect-bi-tools/).
    </Message>

5. Select your preferred framework:

    **Protocols**

    Select the appropriate protocol, then run the displayed command in a terminal. Remember to replace the placeholders with the appropriate values, and to specify the correct path to the certificate file.

        <Tabs>
            <TabsTab label="ClickHouse® CLI">
            ```bash
            clickhouse client \
            --host <YOUR_DEPLOYMENT_ID>.dtwh.<REGION>.scw.cloud \
            --port 9440 \
            --secure \
            --user scwadmin \
            --password '<PASSWORD>'
            ```
            </TabsTab>
            <TabsTab label="MySQL">
            ```bash
              mysql -h <YOUR_DEPLOYMENT_ID>.dtwh.<REGION>.scw.cloud \
              -P 9004 \
              -u scwadmin \
              --password='<PASSWORD>' -e "SELECT 1;"
            ```
            <Message type="note">
            MySQL connection is exposed publicly. Use ClickHouse® CLI for a secure connection.
            </Message>
            </TabsTab>
            <TabsTab label="HTTPS">
            ```bash
            echo 'SELECT 1' | curl 'https://scwadmin:<PASSWORD>@<YOUR_DEPLOYMENT_ID>.dtwh.<REGION>.scw.cloud:8443' -d @-
            ```
            <Message type="note">
            `curl` only works with SQL queries, and does not allow direct connection to your Data Warehouse for ClickHouse® deployment.
            </Message>
            </TabsTab>
        </Tabs>
      <br/>
      **Languages**

      Select the desired language, then run the code displayed to create a file that connects to your deployment, and run queries programmatically. Remember to replace the placeholders with the appropriate values, and to specify the correct path to the certificate file.

        <Tabs>
            <TabsTab label="Python">
            ```python
            pip install clickhouse-connect
            cat <<EOF >clickhouse.py
            import clickhouse_connect

            client = clickhouse_connect.get_client(
                host="<YOUR_DEPLOYMENT_ID>.dtwh.<REGION>.scw.cloud",
                port=8443,
                username="scwadmin",
                password="<PASSWORD>",
            )
            query_result = client.query("SELECT 1")
            print(query_result.result_set)
            EOF
            python clickhouse.py
            ```
            </TabsTab>
            <TabsTab label="Go">
            ```go
            mkdir ClickHouse-go
            cd ClickHouse-go
            go mod init ClickHouse-go
            cat <<EOF >main.go
            package main

            import (
                  "context"
                  "fmt"
                  "log"
                  "github.com/ClickHouse/clickhouse-go/v2"
            )

            func main() {
                  conn, err := clickhouse.Open(&clickhouse.Options{
                      Addr: []string{"f133556f-8578-486f-be7f-49f7da08b728.dtwh.fr-par.scw.cloud:9440"},
                      Auth: clickhouse.Auth{
                          Database: "default",
                          Username: "scwadmin",
                          Password: "PASSWORD",
                      },
                  })
                  if err != nil {
                      log.Fatal(err)
                  }
                  defer conn.Close()

                  ctx := context.Background()
                  var result string
                  if err := conn.QueryRow(ctx, "SELECT 1").Scan(&result); err != nil {
                      log.Fatal(err)
                  }
                  fmt.Println(result)
            }
            EOF
            go run .
            ```
            </TabsTab>
            <TabsTab label="Node.js">
            ```node
            npm i @clickhouse/client
            cat <<EOF >clickhouse.js
            import { createClient } from '@clickhouse/client'

            void (async () => {
              const client = createClient({
                url: 'https://f133556f-8578-486f-be7f-49f7da08b728.dtwh.fr-par.scw.cloud:8443',
                username: 'scwadmin',
                password: 'PASSWORD'
              })
              const rows = await client.query({
                query: 'SELECT 1',
                format: 'JSONEachRow',
              })
              console.info(await rows.json())
              await client.close()
            })()
            EOF
            node clickhouse.js
            ```
            </TabsTab>
            <TabsTab label="Java">
            ```java
            cat <<EOF >pom.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <project
                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
                xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <modelVersion>4.0.0</modelVersion>
                <groupId>clickhouse-java</groupId>
                <artifactId>clickhouse-java</artifactId>
                <version>1.0.0</version>
                <packaging>jar</packaging>
                <dependencies>
                    <dependency>
                        <groupId>com.clickhouse</groupId>
                        <artifactId>clickhouse-jdbc</artifactId>
                        <version>0.7.2</version>
                    </dependency>
                </dependencies>
            </project>
            EOF
            mkdir -p src/main/java
            cat <<EOF >src/main/java/Main.java
            import java.sql.*;
            import java.lang.ClassNotFoundException;

            public class Main {
              public static void main(String[] args) throws SQLException, ClassNotFoundException {
                Class.forName("com.clickhouse.jdbc.ClickHouseDriver");
                String url = "jdbc:ch://scwadmin:PASSWORD@f133556f-8578-486f-be7f-49f7da08b728.dtwh.fr-par.scw.cloud:8443/default?ssl=true";
                try (Connection con = DriverManager.getConnection(url); Statement stmt = con.createStatement()) {
                  ResultSet result_set = stmt.executeQuery("SELECT 1 AS one");
                  while (result_set.next()) {
                    System.out.println(result_set.getInt("one"));
                  }
                }
              }
            }
            EOF
            mvn clean compile
            mvn exec:java -Dexec.mainClass=Main
            ```
            </TabsTab>
        </Tabs>

You are now connected to your Data Warehouse for ClickHouse® deployment using the administrator account.
