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

> Step-by-step guide to creating your first Kafka ClickPipe.

# Creating your first Kafka ClickPipe

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

> In this guide, we will walk you through the process of creating your first Kafka ClickPipe.

Kafka ClickPipes can be deployed and managed manually using the ClickPipes UI, as well as programmatically using [OpenAPI](/integrations/clickpipes/programmatic-access/openapi) and [Terraform](/integrations/clickpipes/programmatic-access/terraform).

<Steps>
  <Step title="Navigate to data sources" id="1-load-sql-console">
    Select the `Data Sources` button on the left-side menu and click on "Set up a ClickPipe".

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_step0.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=e9541eb0c881173eacc746f45524d8d4" alt="Select imports" size="md" width="2606" height="790" data-path="images/integrations/data-ingestion/clickpipes/cp_step0.webp" />
  </Step>

  <Step title="Select a data source" id="2-select-data-source">
    Select your Kafka data source from the list.

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_step1.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=a50f95af84bef1cf769395a204bd0cfa" alt="Select data source type" size="md" width="2600" height="1890" data-path="images/integrations/data-ingestion/clickpipes/cp_step1.webp" />
  </Step>

  <Step title="Configure the data source" id="3-configure-data-source">
    Fill out the form by providing your ClickPipe with a name, a description (optional), your credentials, and other connection details.

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_step2.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=cabcedf06d16b8930dbdd3b57fd35d13" alt="Fill out connection details" size="md" width="1896" height="1370" data-path="images/integrations/data-ingestion/clickpipes/cp_step2.webp" />
  </Step>

  <Step title="Configure a schema registry (optional)" id="4-configure-your-schema-registry">
    A valid schema is required for Avro and Protobuf topics. See [Schema registries](/integrations/clickpipes/kafka/schema-registries) for more details on how to configure a schema registry.
  </Step>

  <Step title="Configure a reverse private endpoint (optional)" id="5-configure-reverse-private-endpoint">
    Configure a Reverse Private Endpoint to allow ClickPipes to connect to your Kafka cluster using AWS PrivateLink.
    See our [AWS PrivateLink documentation](/integrations/clickpipes/aws-privatelink) for more information.
  </Step>

  <Step title="Configure SSH tunneling (optional)" id="6-configure-ssh-tunneling">
    You can use SSH tunneling if your Kafka broker isn't publicly accessible. Instead of connecting directly, ClickPipes establishes an SSH connection to a bastion host (a server in your network that is publicly accessible) and then forwards traffic through it to your Kafka broker on your private network.

    1. Enable the "SSH Tunnel" toggle.
    2. Fill in the SSH connection details:
       * **SSH Host**: The hostname or IP address of your bastion host — this is the publicly accessible server that acts as a gateway into your private network.
       * **SSH Port**: The port for SSH on the bastion host (default `22`).
       * **SSH User**: The username to authenticate with on the bastion host.

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_ssh_tunnel.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=f4bc1d67973ac1ea2349dde9e97518e2" alt="SSH tunnel configuration" size="md" width="1810" height="1510" data-path="images/integrations/data-ingestion/clickpipes/cp_ssh_tunnel.webp" />

    3. To use Key-based authentication, click on "Revoke and regenerate key pair" to generate a new key pair and copy the generated public key to your SSH server under `~/.ssh/authorized_keys`.
    4. Click on "Verify Connection" to verify the connection.

    <Note>
      Make sure to whitelist [ClickPipes IP addresses](/integrations/clickpipes/home#list-of-static-ips) in your firewall rules for the SSH bastion host so that ClickPipes can establish the SSH tunnel.
    </Note>
  </Step>

  <Step title="Select your topic" id="7-select-your-topic">
    Select your topic and the UI will display a sample document from the topic.

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_step3.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=ee80e73c22789da32f70cd5a860520f2" alt="Set your topic" size="md" width="2380" height="1956" data-path="images/integrations/data-ingestion/clickpipes/cp_step3.webp" />
  </Step>

  <Step title="Configure your destination table" id="8-configure-your-destination-table">
    In the next step, you can select whether you want to ingest data into a new ClickHouse table or reuse an existing one. Follow the instructions in the screen to modify your table name, schema, and settings. You can see a real-time preview of your changes in the sample table at the top.

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_step4a.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=24a3288470ed1e16962d0b66ac75a585" alt="Set table, schema, and settings" size="md" width="2734" height="1328" data-path="images/integrations/data-ingestion/clickpipes/cp_step4a.webp" />

    You can also customize the advanced settings using the controls provided

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_table_settings.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=101064df928dc0d89dfd718e33260010" alt="Set advanced controls" size="md" width="1592" height="338" data-path="images/integrations/data-ingestion/clickpipes/cp_table_settings.webp" />
  </Step>

  <Step title="Configure permissions" id="9-configure-permissions">
    ClickPipes will create a dedicated user for writing data into a destination table. You can select a role for this internal user using a custom role or one of the predefined role:

    * `Full access`: with the full access to the cluster. It might be useful if you use Materialized View or Dictionary with the destination table.
    * `Only destination table`: with the `INSERT` permissions to the destination table only.

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_step5.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=9a75402c40da36a6a5c2936ca83f2523" alt="Permissions" size="md" width="2736" height="1318" data-path="images/integrations/data-ingestion/clickpipes/cp_step5.webp" />
  </Step>

  <Step title="Complete setup" id="10-complete-setup">
    Clicking on "Create ClickPipe" will create and run your ClickPipe. It will now be listed in the Data Sources section.

    <Image img="https://mintcdn.com/private-7c7dfe99-postgresql-tls-support/w-Unfx0B83cK7_6Z/images/integrations/data-ingestion/clickpipes/cp_overview.webp?fit=max&auto=format&n=w-Unfx0B83cK7_6Z&q=85&s=e39f05bbffb64f3c6959363afb9451c9" alt="View overview" size="md" width="3436" height="1076" data-path="images/integrations/data-ingestion/clickpipes/cp_overview.webp" />
  </Step>
</Steps>
