<a id="cloud-create-cluster"></a>

# Create a Kafka Cluster

Create an Apache Kafka® cluster in Confluent Cloud to start streaming. Confluent Cloud clusters are
fully managed: you choose a [cluster type](cluster-types.md#cloud-cluster-types) and a
[cloud provider and region](../get-started/regions.md#providers-regions), and Confluent handles
provisioning, scaling, and [fault tolerance](resilience.md#cloud-resilience).

<iframe width="560" height="315" src="https://www.youtube.com/embed/uKay_LDkk70?si=MmkEZVcCV1KZNgfX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

You can create clusters using the
[Confluent Cloud Console](#cloud-create-cluster-console-walkthrough),
[Confluent CLI](#cloud-create-cluster-cli-walkthrough), and
[REST API](#cloud-create-cluster-restapi-walkthrough). For a description
of cluster types, service level agreements (SLA), and resource quotas for
clusters, see [Kafka Cluster Types in Confluent Cloud](cluster-types.md#cloud-cluster-types) and [Service Quotas for Confluent Cloud](../quotas/service-quotas.md#ccloud-resource-limits).

Prerequisites:

- Operator or administrator access to a Confluent Cloud environment.
- For Freight clusters, you must contact Confluent and work with the
  sales team to determine a maximum eCKU for your cluster before you provision.

Considerations:

- Cloud provider and region cannot be changed after provisioning a cluster.
- To meet data residency and sovereignty requirements, data produced to a topic
  through Kafka stays within the geographic region you select. For more
  information, see the [Confluent Cloud Security
  Controls](https://assets.confluent.io/m/67f93edfe1a9f524/original/20200805-WP-Confluent_Cloud_Security_Controls.pdf)
  whitepaper (PDF).
- For Dedicated clusters, the number of
  [Confluent Unit for Kafka (CKU)](../_glossary.md#term-Confluent-Unit-for-Kafka-CKU) determines the cluster’s capacity. You
  can manage CKUs after provisioning. For more information, see
  [Fixed limits and recommended guidelines](cluster-types.md#cku-details) and [Update Kafka clusters](update-cluster.md#cloud-cluster-update-api).
- Cluster name (`display_name`) is a friendly name with the following
  requirements:
  - Use 64 characters or less
  - Use whitespace, Unicode letters, numbers, and the following special
    characters: period (`.`), comma (`,`), ampersand (`&`), underscore
    (`_`), plus (`+`), bar (`|`), open square bracket (`[`), close
    square bracket (`]`), slash (`/`), dash (`-`)

<a id="cloud-create-cluster-console-walkthrough"></a>

## Cloud Console

Navigate to the clusters page for your environment. If this is your first
cluster, click **Create cluster on my own**. If this isn’t your first cluster,
click **+ Add cluster**. The **Create cluster** page opens with a single form;
the sections that appear depend on the cluster type you choose in
**Cluster type**.

| Cluster type   | Setup options                                                                                         |
|----------------|-------------------------------------------------------------------------------------------------------|
| Basic          | Cluster name, Provider and region                                                                     |
| Standard       | Cluster name, Provider and region, Uptime SLA                                                         |
| Enterprise     | Cluster name, Provider and region, Uptime SLA, Networking,<br/>Encryption key management              |
| Freight        | Cluster name, Provider and region, Networking, Encryption key<br/>management                          |
| Dedicated      | Cluster name, Select CKUs, Provider and region, Uptime SLA,<br/>Networking, Encryption key management |
1. Specify **Cluster name**.
2. Under **Cluster type**, select Basic, Standard,
   Enterprise, Freight, or Dedicated.
3. For Dedicated clusters, under **Select CKUs**, use the slider or
   enter a value to set the cluster size. Multi-zone availability requires
   two CKUs.
4. Under **Provider and region**, select a cloud provider tile and a
   **Region**.
5. For Standard, Enterprise, or Dedicated
   clusters, under **Uptime SLA**, select an SLA option.
6. For Enterprise, Freight, and Dedicated clusters,
   a **Networking** section appears:
   - For Enterprise and Freight clusters, select the
     checkbox to configure networking later, or click
     **Create new network** to configure a private network now.
   - Dedicated clusters require you to select a network type
     (**PrivateLink**, **VPC Peering**, or **Transit Gateway**, depending on
     provider) and either use an existing network or create a new one.

   To create a new private network:
   1. Select your provider’s networking mechanism:
      - AWS: Transit Gateway, VPC Peering, or PrivateLink. For
        Enterprise and Freight clusters, Private Network Interface is
        also available.
      - Azure: Private Link or VNet Peering
      - Google Cloud: VPC Peering or Private Service Connect
   2. Choose **Create new** and enter a **Network name**.
   3. If required for your mechanism, select your zones.
   4. Depending on your provider and mechanism, enter a CIDR block in
      **CIDR for Confluent Cloud Network**, or select
      **Private DNS resolution** to resolve your cluster endpoints using
      a private DNS zone:

      | Provider     | Mechanism               | Zones          | CIDR block     | Private DNS resolution                            |
      |--------------|-------------------------|----------------|----------------|---------------------------------------------------|
      | AWS          | VPC Peering             | Required       | Required       | Not supported                                     |
      | AWS          | Transit Gateway         | Required       | Required       | Not supported                                     |
      | AWS          | PrivateLink             | Required       | Not applicable | Optional; otherwise public DNS resolution is used |
      | Azure        | Private Link            | Not applicable | Not applicable | Optional; otherwise public DNS resolution is used |
      | Azure        | VNet Peering            | Not applicable | Required       | Not supported                                     |
      | Google Cloud | VPC Peering             | Required       | Required       | Not supported                                     |
      | Google Cloud | Private Service Connect | Required       | Not applicable | Optional; otherwise public DNS resolution is used |

   For more information, see the reference for your provider and mechanism:
   - For AWS PrivateLink, see [Use AWS PrivateLink for Serverless Products on Confluent Cloud](../networking/aws-platt.md#cloud-networking-privatelink-aws-esku)
   - For AWS Private Network Interface, see
     [Use Private Network Interface on Confluent Cloud](../networking/aws-pni.md#cloud-networking-pni-aws)
   - For Azure Private Link, see
     [Use Azure Private Link for Serverless Products on Confluent Cloud](../networking/azure-platt.md#cloud-networking-privatelink-azure-esku)
   - For Google Cloud Private Service Connect, see
     [Use Google Cloud Private Service Connect for Serverless Products on Confluent Cloud](../networking/gcp-platt.md#cloud-networking-privatelink-gc-esku)
   - For all mechanisms, see [Manage Networking on Confluent Cloud](../networking/overview.md#cloud-networking)
7. For Enterprise, Freight, or Dedicated
   clusters, an **Encryption key management** section appears. Accept
   the default cloud-provider managed key, or, with the Advanced
   Security add-on enabled, select **Self managed key**.

   If you select **Self managed key**, follow the on-screen steps to
   register your key. For more information, see
   [Protect Data at Rest Using Self-Managed Encryption Keys on Confluent Cloud](../security/encrypt/byok/overview.md#byok-encrypted-clusters).
8. Review the cost estimate and **Summary** panel, then click
   **Launch cluster**.

   ### Basic and Standard

   ![Cost and summary panel when creating a Standard Kafka
   cluster.](images/_clusters/create-cluster-standard-review.png)

   ### Enterprise

   ![Cost and summary panel when creating an Enterprise Kafka
   cluster.](images/_clusters/create-cluster-enterprise-review.png)

   ### Freight

   ![Cost and summary panel when creating a Freight Kafka
   cluster.](images/_clusters/create-cluster-freight-review.png)

   ### Dedicated

   ![Cost and summary panel when creating a Dedicated Kafka
   cluster.](images/_clusters/create-cluster-dedicated-review.png)

   If you haven’t set up a payment method, add one or enter a promotional
   code before you can launch the cluster.

<a id="cloud-create-cluster-cli-walkthrough"></a>

## Confluent CLI

To create a cluster using the CLI, run the following command in your terminal:

```none
confluent kafka cluster create <name> [flags]
```

For example:

```none
confluent kafka cluster create my_new_cluster --cloud "aws" --region "us-west-2"
```

Your output should resemble:

```text
It may take up to 5 minutes for the Kafka cluster to be ready.
+----------------------+---------------------------------------------------------+
| Current              | false                                                   |
| ID                   | lkc-123exa                                              |
| Name                 | my_new_cluster                                          |
| Type                 | BASIC                                                   |
| Ingress Limit (MB/s) |                                                     250 |
| Egress Limit (MB/s)  |                                                     750 |
| Storage              | 5 TB                                                    |
| Cloud                | aws                                                     |
| Region               | us-west-2                                               |
| Availability         | single-zone                                             |
| Status               | PROVISIONING                                            |
| Endpoint             | SASL_SSL://pkc-exa45.us-west-2.aws.confluent.cloud:9092 |
| REST Endpoint        | https://pkc-exa45.us-west-2.aws.confluent.cloud:443     |
+----------------------+---------------------------------------------------------+
```

<a id="cloud-create-cluster-restapi-walkthrough"></a>

## Confluent Cloud APIs

API requests must include an authorization header with an API key and
secret. For more information, see [Authentication](https://docs.confluent.io/cloud/current/api.html/#authentication) in the
Confluent Cloud API reference.

To create a cluster, make a `POST` request with a JSON payload that
specifies the requirements.

```text
POST /cmk/v2/clusters
```

### Request

This request structure applies to all cluster types. When you make the
request, include a JSON payload that contains a `spec` object with the
following:

| Parameter      | Required or Optional         | Description                                                                                                                                                                                                                                                                                                                                                                               |
|----------------|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `display_name` | Required                     | The display name of the cluster.                                                                                                                                                                                                                                                                                                                                                          |
| `availability` | Required                     | - For Dedicated clusters: `SINGLE_ZONE` or `MULTI_ZONE`<br/>- For Basic, Standard, or Enterprise clusters in<br/>  organizations created on or after April 16, 2024: `Low` (99.5%/99.9%)<br/>  or `High` (99.99%)<br/>- For Basic, Standard, or Enterprise clusters in<br/>  organizations created before April 16, 2024: `SINGLE_ZONE` or<br/>  `MULTI_ZONE`                             |
| `cloud`        | Required                     | `GCP`, `AZURE` or `AWS`                                                                                                                                                                                                                                                                                                                                                                   |
| `region`       | Required                     | A valid region for the cloud provider.                                                                                                                                                                                                                                                                                                                                                    |
| `config`       | Required                     | Object that contains the cluster type: `kind`: `Basic`, `Standard`,<br/>`Enterprise`, `Dedicated`, or `Freight`.<br/><br/>For Dedicated clusters, you must also specify a `cku` integer<br/>value, and you can specify an optional `encryption_key` for BYOK<br/>clusters.<br/><br/>Clusters can be upgraded from Basic to Standard, but<br/>cannot be downgraded from Standard to Basic. |
| `environment`  | Required                     | Object that contains the environment identifier: `id`: `env-abc123`.                                                                                                                                                                                                                                                                                                                      |
| `network`      | Required for private network | Object that contains the network identifier: `id`: `n-12345` and<br/>related environment name. To create a Dedicated cluster in a<br/>private network, first create the network, then specify that network<br/>when you create the cluster.                                                                                                                                               |

#### Request examples by cluster type

### Example request for Basic and Standard clusters

```text
POST /cmk/v2/clusters HTTP/1.1
Host: api.confluent.cloud

{
   "spec":{
      "display_name":"ProdKafkaCluster",
      "availability":"Low",
      "cloud":"GCP",
      "region":"us-east4",
      "config":{
         "kind":"Basic"
      },
      "environment":{
         "id":"env-a12b34"
      }
   }
}
```

### Example request for Enterprise clusters in a private network

```text
POST /cmk/v2/clusters HTTP/1.1
Host: api.confluent.cloud

{
   "spec":{
      "display_name":"ProdKafkaCluster",
      "availability":"High",
      "cloud":"AWS",
      "region":"us-east-1",
      "config":{
         "kind":"Enterprise"
      },
      "environment":{
         "id":"env-a12b34"
      },
      "network":{
         "id":"n-12345",
         "environment": "env-a12b34"
      }
   }
}
```

### Example requests for Dedicated clusters

On a secure public endpoint, specifying the number of CKUs in the
`config` element:

```text
POST /cmk/v2/clusters HTTP/1.1
Host: api.confluent.cloud

{
   "spec":{
      "display_name":"ProdKafkaCluster",
      "availability":"SINGLE_ZONE",
      "cloud":"GCP",
      "region":"us-east4",
      "config":{
         "kind":"Dedicated",
         "cku": 2
      },
      "environment":{
         "id":"env-a12b34"
      }
   }
}
```

On a private network, specifying the network in the `network` element:

```text
POST /cmk/v2/clusters HTTP/1.1
Host: api.confluent.cloud

{
   "spec":{
      "display_name":"ProdKafkaCluster",
      "availability":"SINGLE_ZONE",
      "cloud":"GCP",
      "region":"us-east4",
      "config":{
         "kind":"Dedicated",
         "cku": 2
      },
      "environment":{
         "id":"env-a12b34"
      },
      "network":{
         "id":"n-12345",
         "environment": "env-a12b34"
      }
   }
}
```

### Response

This response structure applies to all cluster types. Successful calls
return HTTP `202 ACCEPTED` with a JSON payload that describes the cluster.

Responses include the following:

- The cloud provider (`AWS`, `GCP`, `AZURE`) and region for the cluster.
- The cluster status (`PROVISIONED`, `PROVISIONING`, `FAILED`) and
  `kind` (Basic, Standard, Enterprise, Dedicated, and Freight).
- Information about the environment that contains the cluster.
- For Dedicated clusters, the number of CKUs allocated to the cluster.

#### Response examples by cluster type

### Example response for Basic and Standard clusters

```text
HTTP/1.1 202 ACCEPTED
Content-Type: application/json

{
      "api_version": "cmk/v2",
      "id": "abc-f3a90de",
      "kind": "Cluster",
      "metadata": {
         "created_at": "2022-04-22T20:45:26.657894Z",
         "self": "https://api.confluent.cloud/v2/kafka-clusters/abc-f3a90de",
         "resource_name": "crn://confluent.cloud/kafka=abc-f3a90de",
         "updated_at": "2022-04-22T20:45:26.659364Z"
      },
      "spec": {
         "display_name": "ProdKafkaCluster",
         "availability": "Low",
         "cloud": "GCP",
         "region": "us-east4",
         "config": {
               "kind": "Basic"
         },
         "kafka_bootstrap_endpoint": "abc-00000-00000.us-east4.gcp.glb.confluent.cloud:9092",
         "http_endpoint": "https://abc-00000-00000.us-east4.gcp.glb.confluent.cloud",
         "environment": {
            "api_version": "org/v2",
            "id": "env-a12b34",
            "kind":"Environment",
            "related": "https://api.confluent.cloud/v2/environments/env-a12b34",
            "resource_name": "crn://confluent.cloud/organization=1234abcd-edef-46ac-8a41-c49e44a3fd9a/environment=env-a12b34"
         }
      },
      "status": {
         "phase": "PROVISIONING"
      }
}
```

### Example response for Enterprise clusters in a private network

```text
HTTP/1.1 202 ACCEPTED
Content-Type: application/json

{
   "api_version": "cmk/v2",
   "kind": "Cluster",
   "id": "abc-f3a90de",
   "metadata": {
      "self": "https://api.confluent.cloud/v2/kafka-clusters/abc-f3a90de",
      "resource_name": "crn://confluent.cloud/kafka=abc-f3a90de",
      "created_at": "2023-06-22T20:45:26.657894Z",
      "updated_at": "2023-06-22T21:13:55.742641944Z"
   },
   "spec": {
      "display_name": "ProdKafkaCluster",
      "availability": "High",
      "cloud": "AWS",
      "region": "us-east-1",
      "config": {
         "kind": "Enterprise"
      },
      "kafka_bootstrap_endpoint": "abc-00000-00000.us-east-1.aws.glb.confluent.cloud:9092",
      "http_endpoint": "https://abc-00000-00000.us-east-1.aws.glb.confluent.cloud",
      "environment": {
         "api_version": "org/v2",
         "id": "env-a12b34",
         "kind":"Environment",
         "related": "https://api.confluent.cloud/v2/environments/env-a12b34",
         "resource_name": "https://api.confluent.cloud/organization=abcd41c4-edef-46ac-8a41-c49e44a3fd9a/environment=env-a12b34"
         },
         "network": {
         "id": "n-00000",
         "environment": "env-a12b34",
         "related": "https://api.confluent.cloud/networking/v1/networks/n-00000",
         "resource_name": "https://api.confluent.cloud/organization=abcd41c4-edef-46ac-8a41-c49e44a3fd9a/network=n-00000",
         "api_version": "networking/v1",
         "kind": "Network"
         }
      },
   "status": {
      "phase": "PROVISIONING"
   }
}
```

### Example responses for Dedicated clusters

On a secure public endpoint:

```text
HTTP/1.1 202 ACCEPTED
Content-Type: application/json

{
   "api_version": "cmk/v2",
   "kind": "Cluster",
   "id": "abc-f3a90de",
   "metadata": {
      "self": "https://api.confluent.cloud/v2/kafka-clusters/abc-f3a90de",
      "resource_name": "crn://confluent.cloud/kafka=abc-f3a90de",
      "created_at": "2022-04-22T20:45:26.657894Z",
      "updated_at": "2022-04-22T21:13:55.742641944Z"
   },
   "spec": {
      "display_name": "ProdKafkaCluster",
      "availability": "SINGLE_ZONE",
      "cloud": "GCP",
      "region": "us-east4",
      "config": {
         "kind": "Dedicated",
         "cku": 2
      },
      "kafka_bootstrap_endpoint": "abc-00000-00000.us-east4.gcp.glb.confluent.cloud:9092",
      "http_endpoint": "https://abc-00000-00000.us-east4.gcp.glb.confluent.cloud",
      "environment": {
         "api_version": "org/v2",
         "id": "env-a12b34",
         "kind":"Environment",
         "related": "https://api.confluent.cloud/v2/environments/env-a12b34",
         "resource_name": "crn://confluent.cloud/organization=1234abcd-edef-46ac-8a41-c49e44a3fd9a/environment=env-a12b34"
      }
   },
   "status": {
      "phase": "PROVISIONING",
      "cku": 2
   }
}
```

In a private network:

```text
HTTP/1.1 202 ACCEPTED
Content-Type: application/json

{
   "api_version": "cmk/v2",
   "kind": "Cluster",
   "id": "abc-f3a90de",
   "metadata": {
      "self": "https://api.confluent.cloud/v2/kafka-clusters/abc-f3a90de",
      "resource_name": "crn://confluent.cloud/kafka=abc-f3a90de",
      "created_at": "2022-04-22T20:45:26.657894Z",
      "updated_at": "2022-04-22T21:13:55.742641944Z"
   },
   "spec": {
      "display_name": "ProdKafkaCluster",
      "availability": "SINGLE_ZONE",
      "cloud": "GCP",
      "region": "us-east4",
      "config": {
         "kind": "Dedicated",
         "cku": 2
      },
      "kafka_bootstrap_endpoint": "abc-00000-00000.us-east4.gcp.glb.confluent.cloud:9092",
      "http_endpoint": "https://abc-00000-00000.us-east4.gcp.glb.confluent.cloud",
      "environment": {
         "api_version": "org/v2",
         "id": "env-a12b34",
         "kind":"Environment",
         "related": "https://api.confluent.cloud/v2/environments/env-a12b34",
         "resource_name": "https://api.confluent.cloud/organization=abcd41c4-edef-46ac-8a41-c49e44a3fd9a/environment=env-a12b34"
         },
         "network": {
         "id": "n-00000",
         "environment": "env-a12b34",
         "related": "https://api.confluent.cloud/networking/v1/networks/n-00000",
         "resource_name": "https://api.confluent.cloud/organization=abcd41c4-edef-46ac-8a41-c49e44a3fd9a/network=n-00000",
         "api_version": "networking/v1",
         "kind": "Network"
         }
      },
   "status": {
      "phase": "PROVISIONING",
      "cku": 2
   }
}
```

## Terraform

To create a cluster using the Confluent Terraform provider, see
[confluent_kafka_cluster Resource](https://registry.terraform.io/providers/confluentinc/confluent/latest/docs/resources/confluent_kafka_cluster).

## Related content

- To create topics and produce and consume data, see [Quick Start for Confluent Cloud](../get-started/index.md#cloud-quickstart)
- For the CLI command reference, see [confluent kafka
  cluster](https://docs.confluent.io/confluent-cli/current/command-reference/kafka/cluster/index.html)
- For the API reference, see [Cluster API reference](https://docs.confluent.io/cloud/current/ccloud/clusters-cmk-v-2/)
- For the networking API reference, see [Networking API reference](https://docs.confluent.io/cloud/current/ccloud/networks-networking-v-1/)
- For supported providers and regions, see [Confluent Cloud Regions and Availability by Cloud Provider](../get-started/regions.md#providers-regions)
- For BYOK encrypted clusters, see [Protect Data at Rest Using Self-Managed Encryption Keys on Confluent Cloud](../security/encrypt/byok/overview.md#byok-encrypted-clusters)
- For cost estimates, see [Confluent Cost Estimator](https://www.confluent.io/pricing/cost-estimator/)
