How to Create Kafka Clusters

Last verified 17 Sep 2026

You can create a Kafka cluster using doctl, the API, or the Control Panel.

We currently support Kafka versions 3.9 and 4.1. New clusters use Kafka 4.1 by default. To view available major versions for new clusters, use the /v2/databases/options response.

Create a Database Cluster Using Automation

You can create a database cluster using the DigitalOcean CLI (doctl) or the API.

Create a Database Cluster via CLI

To create a database using doctl, you need to provide values for the --engine, --region, and --size flags. Use the doctl databases options engines, doctl databases options regions, and doctl databases options slugs commands, respectively, to get a list of available values.

How to Create a Database Cluster Using the DigitalOcean CLI
  1. Install doctl, the official DigitalOcean CLI.

  2. Create a personal access token and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

    doctl auth init
  4. Run doctl databases create. Basic usage:

    doctl databases create <name> [flags]

    The following example creates a Kafka cluster named example-database in the nyc1 region with three 2 GB nodes:

    doctl databases create example-database --engine kafka --version 3.8 --region nyc1 --size db-s-2vcpu-2gb --num-nodes 3

Create a Database Cluster via API

To create a database using the API, you need to provide values for the engine, region, and size fields, which specify the database’s engine, its datacenter, and its configuration (number of CPUs, amount of RAM, and disk capacity). Use the /v2/databases/options endpoint to get a list of available values.

How to Create a Database Cluster Using the DigitalOcean API

cURL

Send a POST request to https://api.digitalocean.com/v2/databases using cURL:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{
    "name": "example-database",
    "engine": "kafka",
    "version": "3.8",
    "region": "nyc1",
    "size": "db-s-2vcpu-2gb",
    "num_nodes": 3
  }' \
  "https://api.digitalocean.com/v2/databases"

Go

Using Godo, the official DigitalOcean API client for Go:

import (
    "context"
    "os"

    "github.com/digitalocean/godo"
)

func main() {
    token := os.Getenv("DIGITALOCEAN_TOKEN")

    client := godo.NewFromToken(token)
    ctx := context.TODO()

    createRequest := &godo.DatabaseCreateRequest{
        Name:       "example-database",
        EngineSlug: "kafka",
        Version:    "3.8",
        Region:     "nyc1",
        SizeSlug:   "db-s-2vcpu-2gb",
        NumNodes:   3,
    }

    cluster, _, err := client.Databases.Create(ctx, createRequest)
}

Python

Using PyDo, the official DigitalOcean API client for Python:

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

create_req = {
  "name": "example-database",
  "engine": "kafka",
  "version": "3.8",
  "region": "nyc1",
  "size": "db-s-2vcpu-2gb",
  "num_nodes": 3
}

create_resp = client.databases.create_cluster(body=create_req)

Create a Database Cluster Using the Control Panel

To create a Kafka database cluster, go to the Databases page and click Create Database. Or click Create at the top of any page and choose Managed Database from the Data Services section of the menu.

Choose a Database Engine

On the Create Database Cluster page, in the Choose a database engine section, select Kafka, and then choose a version, if available. The database engine and version can’t be changed after creation.

The database engine selection portion of the database create page

Choose a Database Configuration

In the Choose a database configuration section, select an option:

  • Basic - Shared CPU: CPU processing power is shared among neighboring Droplets on the same host. Best for low-traffic, testing, or development workloads.

  • General Purpose - Dedicated CPU: Provides the full processing power of a single vCPU at all times. Best for most workloads that need consistent CPU performance.

  • Memory-Optimized - Dedicated CPU: Provides the full processing power of a single vCPU at all times. Best for memory-heavy workloads with large working sets and demanding read-heavy or analytics-style queries.

Because Kafka is more resource-intensive than other engines, we recommend shared CPU plans for development and testing workloads, and dedicated CPU plans for production workloads.

Add Brokers

Most Basic - Shared CPU plans include a fixed 3-broker cluster. All of the Dedicated CPU plans let you select the number of brokers.

If you select a plan that isn’t fixed at 3 brokers, the Number of Brokers selector appears above CPU options. Select 3 Brokers, 6 Brokers, 9 Brokers, or 15 Brokers.

Number of brokers selector with 3 brokers selected.

More brokers improve scalability, provide high availability, and distribute workload across the cluster.

Choose CPU Options

Under CPU options, select an option:

  • Regular (Disk: SSD): Use for standard workloads that don’t require NVMe-backed disk performance.
  • Premium AMD (Disk: NVMe): Use for workloads that benefit from faster local disk performance and higher network throughput. This option is only available for Basic - Shared CPU configurations.
  • Premium Intel (Disk: NVMe): Use for workloads that benefit from faster local disk performance, higher network throughput, and predictable CPU performance.

Changing the CPU option can change the available plan sizes, prices, and datacenter regions.

Select a Plan

Under Select a plan, choose a plan size for the cluster. The plan determines the cluster’s vCPUs, RAM, and minimum storage. Each option shows its combined monthly cost and included resources.

After creation, you can increase your cluster’s compute size (number or size of nodes) at any time.

Choose a Storage Size

Under Choose a storage size, you can increase storage in 10 GiB increments, up to the maximum in the Storage range (the storage range depends on the selected compute plan). For current rates, see [Kafka pricing].

Choose a storage size section showing 40 GiB selected with cost and supported storage range.

You can increase or decrease storage at any time, but you cannot reduce it below the amount currently in use, or below what’s required for backups and growth.

Enable Storage Autoscaling

Under Autoscale storage, select Enable Storage Autoscaling to automatically increase storage when disk utilization on any node in the cluster reaches the specified threshold. The threshold is based on the worst-performing node in the cluster, not the average across nodes.

Click Customize to set a custom Threshold and Storage Increment. For performance and stability, autoscaling can increase storage only up to the maximum allowed by your current plan.

Autoscale storage section with storage autoscaling enabled and customizable threshold and increment fields.
Note

When autoscaling occurs, the specified storage increment is added to each node in the cluster, not distributed across the cluster. Even when data is uneven across nodes, such as with different partition sizes, each node still receives the same increment. The total added storage is the increment multiplied by the number of nodes.

Autoscaling takes several minutes depending on the cluster size. It runs without downtime and you do not need to take any action. When autoscaling occurs, the system bills the added capacity as additional storage.

Choose a Datacenter Region

The Choose a datacenter region section shows the datacenters where you currently have the most resources, with the number of resources shown to the right as X resources. Hover over this text to see the specific resources in the datacenter.

For best performance, choose a datacenter close to the resources that connect to the cluster. Resources in the same datacenter share a VPC network, which reduces latency and keeps traffic off the public internet.

The datacenter selection portion of the databases create page

Available regions depend on the CPU option and plan you select. For available regions, see Regional Availability.

Finalize and Create

In the Finalize and Create section, enter a unique name for the cluster and select a project to add it to. After creation, you can move the cluster to another project, but its name can’t be changed.

The Finalize and Create section of the Create a database page

Review the monthly and hourly cost for the cluster. When finished, click Create Database Cluster.

Clusters typically take five minutes or more to provision. You can complete important configuration tasks such as restricting inbound connections while you wait.

Note

DigitalOcean Kafka does not currently support the native importing of existing Kafka databases. However, you can use Kafka MirrorMaker to replicate existing data to your DigitalOcean Kafka cluster.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.