> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-home-button.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Obtain your Cloud connection details

> Learn how to find the hostname, port, and credentials for your ClickHouse Cloud service so you can connect from external clients, CLIs, and applications.

<a href="/get-started/quickstarts/home"><Badge size="lg" color="gray" icon="arrow-left">All quickstarts</Badge></a>

<div className="mt-2 flex flex-wrap gap-2">
  <Badge size="lg" color="blue">Real-Time Analytics</Badge>
  <Badge size="lg" color="blue">Data Warehousing</Badge>
  <Badge size="lg" color="blue">Observability</Badge>
  <Badge size="lg" color="blue">AI/ML</Badge>
  <Badge size="lg" color="orange">Cloud</Badge>
</div>

<h2 id="prerequisites">
  Prerequisites
</h2>

To successfully follow this guide, you'll need the following:

* A running ClickHouse Cloud service. If you don't have one yet, complete the [Create your first Cloud service](/get-started/quickstarts/create-your-first-service-on-cloud) quickstart first.

You should also have completed the [Create your first Cloud service](/get-started/quickstarts/create-your-first-service-on-cloud) quickstart, as you'll need an existing ClickHouse Cloud service to retrieve connection details from.

<h2 id="what-youll-build">
  What you'll build
</h2>

In this quickstart you'll learn how to locate the connection details for your ClickHouse Cloud service - the hostname, port numbers, username, and password you need to connect from any external client, CLI tool, or application.
By the end, you'll know where to find these details in the Cloud console and how to verify connectivity using a simple `curl` command, so you're ready to connect from tools like `clickhouse-local`, `clickhouse-client`, or any ClickHouse driver.

<Steps titleSize="h3">
  <Step>
    ### Open the Cloud console

    Navigate to the [ClickHouse Cloud console](https://console.clickhouse.cloud/) and sign in to your account.

    From the main dashboard, locate the service you want to connect to. If the service is idled, click on it and wait for it to wake up before proceeding - you'll need it running to verify connectivity in a later step.
  </Step>

  <Step>
    ### Find your connection details

    Click on your service to open its details page, then click the **Connect** button in the left sidebar:

    <img className="block dark:hidden w-2/3 mx-auto" src="https://mintcdn.com/private-7c7dfe99-home-button/k6dUBbEUOmZKxz3v/images/get-started/quickstarts/connect-light.png?fit=max&auto=format&n=k6dUBbEUOmZKxz3v&q=85&s=bcada08a48f2f63f445e8a20ef5a7d8f" alt="Connect button in the ClickHouse Cloud console (light mode)" width="1050" height="964" data-path="images/get-started/quickstarts/connect-light.png" />

    <img className="hidden dark:block w-2/3 mx-auto" src="https://mintcdn.com/private-7c7dfe99-home-button/k6dUBbEUOmZKxz3v/images/get-started/quickstarts/connect-dark.png?fit=max&auto=format&n=k6dUBbEUOmZKxz3v&q=85&s=1e40b31290d69bb5a9ec5387353cbe2b" alt="Connect button in the ClickHouse Cloud console (dark mode)" width="1034" height="960" data-path="images/get-started/quickstarts/connect-dark.png" />

    The first time you click this button, you'll see a dialogue showing your credentials:

    | Detail       | Description                             |
    | ------------ | --------------------------------------- |
    | **Username** | Your username (typically `default`)     |
    | **Password** | The generated password for your service |

    There is also a dropdown with preformatted example connection strings for different protocols and interfaces (e.g. `clickhouse-client`, HTTPS, JDBC, etc.), which you can copy directly.

    <Warning>
      Download the credentials file or copy your password and store it somewhere safe. Once you close this dialogue, you will not be able to see the password again.
    </Warning>

    You'll also find your service **hostname** on the service details page (e.g. `abc123.us-east-1.aws.clickhouse.cloud`). Copy it along with your credentials - you'll need both throughout the remaining steps and in subsequent quickstarts.

    <Note>
      If you've lost your password, you can reset it from the **Settings** tab of your service in the Cloud console.
    </Note>
  </Step>

  <Step>
    ### Understand the connection protocols

    ClickHouse Cloud exposes two main network protocols, each on its own port:

    * **Native protocol (port 9440)** - A binary protocol used by `clickhouse-client`, `clickhouse-local`, and most language-specific drivers. It is the fastest option and supports all ClickHouse features. TLS is required on Cloud.
    * **HTTPS protocol (port 8443)** - An HTTP-based interface useful for REST clients, `curl`, web-based tools, and drivers that prefer HTTP. Also requires TLS on Cloud.

    Both protocols require TLS encryption when connecting to ClickHouse Cloud - you cannot connect over plaintext. Most tools handle this automatically when you specify the correct port, but you may need to pass a `--secure` flag or set `ssl=true` depending on the client.

    For most quickstarts and CLI workflows in this series, you'll use the **native protocol on port 9440**.
  </Step>

  <Step>
    ### Save your connection details for reuse

    You'll use these connection details frequently across quickstarts. To avoid retyping them every time, you can export them as environment variables in your terminal session:

    ```bash theme={null}
    export CLICKHOUSE_HOST=YOUR_HOST.clickhouse.cloud
    export CLICKHOUSE_USER=default
    export CLICKHOUSE_PASSWORD=YOUR_PASSWORD
    ```

    Replace the values with your actual hostname, username, and password.
    If you'll be connecting to your Cloud service using `clickhouse-client` or `clickhouse-local`, obtain the hostname by selecting 'Native' from the dropdown next to "Connect with:".
    Copy the hostname which appears after `--host` from the shown connection example.

    <Warning>
      These environment variables only persist for your current terminal session. Do not store passwords in shell profile files (`.bashrc`, `.zshrc`) or commit them to version control.
    </Warning>
  </Step>
</Steps>

<h2 id="next-steps">
  Next steps
</h2>

You now have all the connection details needed to connect to your ClickHouse Cloud service from any external tool. The hostname, port, username, and password you found here are used throughout the rest of the quickstart series.

Check out the following quickstarts next:

* [Insert data using clickhouse-client](/get-started/quickstarts/insert-data-using-clickhouse-client)
* [Create your first MergeTree table](/get-started/quickstarts/create-your-first-mergetree-table)

Or go deeper with the reference documentation:

* [Native interface (TCP)](/concepts/features/interfaces/tcp)
* [HTTP interface](/concepts/features/interfaces/http)

<Frame caption="Check out the ClickHouse academy for on-demand and live training">
  <a href="https://learn.clickhouse.com/" target="_blank">
    <img src="https://mintcdn.com/private-7c7dfe99-home-button/iOJBcv5hu2da8lsi/images/academy.png?fit=max&auto=format&n=iOJBcv5hu2da8lsi&q=85&s=102d3dcf8c90c04e86d2494a4b35541f" alt="ClickHouse Academy — Master ClickHouse with expert-designed training for every skill level" width="560" noZoom data-path="images/academy.png" />
  </a>
</Frame>

<div className="mt-8">
  <a href="/get-started/quickstarts/home"><Badge size="lg" color="gray" icon="arrow-left">All quickstarts</Badge></a>
</div>
