---
updatedAt: 2026-09-28T08:45:27.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/quick-deploy-apps/llms.txt
---

# Apache Kafka (cluster)

Deploy [Apache Kafka](https://kafka.apache.org/), a robust, scalable, and high-performance system for managing real-time data streams. Kafka provides a reliable foundation for data pipelines, event-driven architectures, and stream processing applications, from log aggregation to real-time analytics.

This app deploys a Kafka cluster using Kafka's native consensus protocol, [KRaft](https://kafka.apache.org/documentation/#kraft). A few things to note about the deployment:

* The cluster is configured with mTLS for authentication. Inter-broker communication and client authentication are established via certificate identity.
* The minimum cluster size is three, with three controllers configured at all times for fault tolerance.
* Clients connecting to the cluster need their own valid certificate. All certificates are signed with a self-signed Certificate Authority (CA). Client keystores and the truststore are on the first Kafka node in `/etc/kafka/ssl/keystore` and `/etc/kafka/ssl/truststore`.
* The CA key and certificate pair are on the first Kafka node in `/etc/kafka/ssl/ca`.

> 📘 Cluster deployment
>
> This app deploys three, five, or seven Linode instances to create a distributed Apache Kafka cluster, each with the plan type and size you select.
>
> Each of these Linode instances will appear on your invoice as separate items.

## 1. Deploy Apache Kafka `cluster`

<div class="aligned">
   <img src="https://techdocs.akamai.com/terraform-images/img/clock.png" alt="" height="25" width="25" />
   <span class="span-header">&nbsp;Estimated deployment time:</span><span>&nbsp;5–7 minutes</span>
</div>

<br />

<div><p></p></div>

Follow the [deployment instructions](https://techdocs.akamai.com/quick-deploy-apps/docs/get-started) from the **Get started** section to configure the app, deploy it, and verify software installation.

For information on the app-specific configurations, see the [Configuration options](#configuration-options) section.

### Software included

Software installed on your Linode when deploying the app.

| Package                          | Description                                                                 |
| -------------------------------- | --------------------------------------------------------------------------- |
| **Apache Kafka**                 | A scalable, high-performance, fault-tolerant stream processing application. |
| **KRaft**                        | A Kafka native consensus protocol.                                          |
| **UFW (Uncomplicated Firewall)** | A firewall utility.                                                         |
| **Fail2ban**                     | A brute force protection utility.                                           |

### Base distribution and plan

* **Supported distribution:** Ubuntu 24.04 LTS
* **Recommended plan:** All plan types and sizes can be used depending on your storage needs.

### Configuration options

Configure the required options to deploy your instance. For additional customization, add advanced options.

The table maps the Cloud Manager UI fields to their corresponding API/CLI keys (`stackscript_data`) required for automated deployments.

**StackScript ID:** `1377657`

<table>
    <thead>
        <tr>
            <th>UI field</th>
            <th>API/CLI key</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="3">Required options</td>
        </tr>
        <tr>
            <td><b>Linode API token</b></td>
            <td><code>token_password</code></td>
            <td>A valid Linode API token used to deploy the additional Linode instances that make up this cluster.<br /> Follow <a href="https://techdocs.akamai.com/cloud-computing/docs/manage-personal-access-tokens">Manage personal access tokens</a> to get the token on your account with <code>Read/Write</code> access to <code>Linodes</code>.</td>
        </tr>
        <tr>
            <td><b>Limited sudo user</b></td>
            <td><code>sudo_username</code></td>
            <td>Your preferred username for the limited sudo user, entered without any capital letters, spaces, or special characters.<br /> When adding a limited sudo user, the user is created with a strong generated password for your new Linode instance, and the account is assigned to the <code>sudo</code> group, which provides elevated permissions when running commands with the <code>sudo</code> prefix.
                <blockquote>
                    <b>Note:</b> For easier and more secure access with the sudo user, add an <a href="https://techdocs.akamai.com/cloud-computing/docs/manage-ssh-keys">account SSH key</a> for the Cloud Manager user during deployment and select that user as an <code>authorized_user</code>. Their SSH pubkey will be assigned to both the root and limited sudo users.
                </blockquote>
            </td>
        </tr>
        <tr>
            <td><b>Number of clients connecting to Kafka</b></td>
            <td><code>client_count</code></td>
            <td>The number of clients that will connect to the Kafka cluster. SSL certificates are created for each client. Must be an integer of <i>1</i> or greater.</td>
        </tr>
        <tr>
            <td><b>Kafka cluster size</b></td>
            <td><code>cluster_size</code></td>
            <td>The number of Linode instances created as part of this cluster. Possible values are <i>3</i>, <i>5</i>, or <i>7</i>.</td>
        </tr>
        <tr>
            <td><b>SSL Information</b></td>
            <td><code>sslheader</code></td>
            <td>Set to <i>Yes</i> by default. This requires providing details for a self-signed TLS/SSL certificate, like country, town, organization, and email address.</td>
        </tr>
        <tr>
            <td><b>Country or region</b></td>
            <td><code>country_name</code></td>
            <td><i>Applies to a self-signed TLS/SSL certificate.</i> The country or region for you or your organization. When using the API/CLI, specify it as a two-letter ISO country or region code.</td>
        </tr>
        <tr>
            <td><b>State or province</b></td>
            <td><code>state_or_province_name</code></td>
            <td><i>Applies to a self-signed TLS/SSL certificate.</i> The state or province for you or your organization.</td>
        </tr>
        <tr>
            <td><b>Locality</b></td>
            <td><code>locality_name</code></td>
            <td><i>Applies to a self-signed TLS/SSL certificate.</i> The town or other locality for you or your organization.</td>
        </tr>
        <tr>
            <td><b>Organization</b></td>
            <td><code>organization_name</code></td>
            <td><i>Applies to a self-signed TLS/SSL certificate.</i> The name of your organization.</td>
        </tr>
        <tr>
            <td><b>Email address</b></td>
            <td><code>email_address</code></td>
            <td><i>Applies to a self-signed TLS/SSL certificate.</i> The email address you want to use for your certificate file.</td>
        </tr>
         <tr>
            <td><b>CA Common Name</b></td>
            <td><code>ca_common_name</code></td>
            <td><i>Applies to a self-signed TLS/SSL certificate.</i> The common name for the self-signed Certificate Authority (CA). For example, <i>Kafka RootCA</i>.</td>
        </tr>
        <tr>
            <td colspan="3">Advanced options</td>
        </tr>
        <tr>
            <td><b>Kafka version</b></td>
            <td><code>kafka_version</code></td>
            <td>The version of Kafka to install. Defaults to <i>3.8.0</i>.</td>
        </tr>
        <tr>
            <td><b>Cluster Settings</b></td>
            <td><code>clusterheader</code></td>
            <td>Set to <i>Yes</i> by default. Details of the cluster settings, including whether to add account SSH keys to all nodes.</td>
        </tr>
        <tr>
            <td><b>Add Account SSH Keys to All Nodes</b></td>
            <td><code>add_ssh_keys</code></td>
            <td>When set to <i>yes</i>, any SSH Keys that are added to the root user account (in the <b>SSH Keys</b> section) are also added to your limited user account on all deployed Linode instances. Possible values are <i>yes</i> or <i>no</i>. Defaults to <i>yes</i>.</td>
        </tr>
    </tbody>
</table>

> **Note:** After the app deployment completes, the password for your limited sudo user is generated and stored in the `.credentials` file in the home directory, along with application-specific passwords. Log in to your instance as `root` through the [Lish console](https://techdocs.akamai.com/cloud-computing/docs/access-your-system-console-using-lish) or [SSH](https://techdocs.akamai.com/cloud-computing/docs/set-up-and-secure-a-compute-instance#connect-to-the-linode), then run `cat /home/$USERNAME/.credentials` to view its contents.

### Use API, CLI, or Terraform

In addition to deploying the app to a new Linode instance via Cloud Manager, you can also use the Linode API, CLI, or Terraform. When running the operation, you need to provide the StackScript ID, supported Linux distribution, and [app-specific fields](#configuration-options) along with the standard Linode deployment configurations.

> **Note:** [Generate a personal access token](https://techdocs.akamai.com/linode-api/reference/get-started#personal-access-tokens) to authenticate your [API](https://techdocs.akamai.com/linode-api/reference/api), [CLI](https://techdocs.akamai.com/cloud-computing/docs/cli-1), or [Terraform](https://registry.terraform.io/providers/linode/linode/latest/docs) requests.

```bash API
curl --location 'https://api.linode.com/v4/linode/instances' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer abc123def456hij789klm' \
    --data-raw '{
        "region": "us-east",
        "type": "g6-standard-4",
        "image": "linode/ubuntu24.04",
        "label": "my-kafka-cluster-one-click-app",
        "root_pass": "@C0mpl3x#P@ssw0rd",
        "stackscript_id": 1377657,
        "stackscript_data": {
            "token_password": "abc123def456hij789klm",
            "sudo_username": "jsmith",
            "client_count": "1",
            "cluster_size": "5",
            "country_name": "US",
            "state_or_province_name": "Massachusetts",
            "locality_name": "Cambridge",
            "organization_name": "Akamai Technologies",
            "email_address": "jsmith@example.com",
            "ca_common_name": "Kafka RootCA"
        }
    }'
```
```bash CLI
linode-cli linodes create \
    --region us-east \
    --type g6-standard-4 \
    --label my-kafka-cluster-one-click-app \
    --image linode/ubuntu24.04 \
    --root_pass @C0mpl3x#P@ssw0rd \
    --stackscript_id 1377657 \
    --stackscript_data '{"token_password":"abc123def456hij789klm", "sudo_username":"jsmith", "client_count":"1", "cluster_size":"5", "country_name":"US", "state_or_province_name":"Massachusetts", "locality_name":"Cambridge", "organization_name":"Akamai Technologies", "email_address":"jsmith@example.com", "ca_common_name":"Kafka RootCA"}'
```
```json Terraform
resource "linode_instance" "my-linode" {
    region         = "us-east"
    type           = "g6-standard-4"
    label          = "my-kafka-cluster-one-click-app"
    image          = "linode/ubuntu24.04"
    root_pass      = "@C0mpl3x#P@ssw0rd"
    stackscript_id = 1377657
    stackscript_data = {
        "token_password"         = "abc123def456hij789klm"
        "sudo_username"          = "jsmith"
        "client_count"           = "1"
        "cluster_size"           = "5"
        "country_name"           = "US"
        "state_or_province_name" = "Massachusetts"
        "locality_name"          = "Cambridge"
        "organization_name"      = "Akamai Technologies"
        "email_address"          = "jsmith@example.com"
        "ca_common_name"         = "Kafka RootCA"
    }
}
```

## 2. Connect to Kafka

### Get the keystore and truststore

Once the deployment is complete, get your client certificates from the first Kafka node.

Authenticating clients requires a keystore and truststore. Access the first Kafka server to get these from `/etc/kafka/ssl/keystore` and `/etc/kafka/ssl/truststore`. Client certificates start with the word `client` followed by a number, depending on the number of clients requested, for example `client1` and `client2`.

Use a secure method such as SSH or an encrypted HTTPS web UI when transferring the client certificates to the Kafka consumer/producer

### Test the cluster

Run a quick test from any of the Kafka nodes using Kafka's utilities found in `/etc/kafka/bin`.

1. Create a `client.properties` file with the following content, replacing the placeholder values with your own:

   ```bash File: client.properties
   security.protocol=SSL
   ssl.truststore.location=/etc/kafka/ssl/truststore/server.truststore.jks
   ssl.truststore.password=CHANGE-ME
   ssl.keystore.location=/etc/kafka/ssl/keystore/client1.keystore.jks
   ssl.keystore.password=CHANGE-ME
   ```

2. Create a topic to test the connection and authentication.

   The output returns a message confirming the topic with the specified name was created.

   ```bash Command
   /etc/kafka/bin/kafka-topics.sh --create --topic test-ssl --bootstrap-server kafka3:9092 --command-config client.properties
   ```
   ```bash Output
   Created topic test-ssl.
   ```

3. Publish a message to the topic as a producer.

   ```bash
   echo "Kafka rocks!" | /etc/kafka/bin/kafka-console-producer.sh --topic test-ssl --bootstrap-server kafka3:9092 --producer.config client.properties
   ```

4. Read the message as a consumer.

   The output returns the previously published message.

   ```bash Command
   /etc/kafka/bin/kafka-console-consumer.sh --topic test-ssl --from-beginning --bootstrap-server kafka3:9092 --consumer.config client.properties
   ```
   ```bash Output
   Kafka rocks!
   ```

## Additional resources

For more information about the installed packages, see their official documentation.

* [Apache Kafka Documentation](https://kafka.apache.org/documentation/)

> 📘
>
> Note that we can't vouch for the accuracy or timeliness of externally hosted resources.

# Sibling pages

* [Apache Airflow](https://techdocs.akamai.com/quick-deploy-apps/docs/apache-airflow.md)
* [Apache Guacamole](https://techdocs.akamai.com/quick-deploy-apps/docs/apache-guacamole.md)
* [Appwrite](https://techdocs.akamai.com/quick-deploy-apps/docs/appwrite.md)
* [Backstage](https://techdocs.akamai.com/quick-deploy-apps/docs/backstage.md)
* [Cribl](https://techdocs.akamai.com/quick-deploy-apps/docs/cribl.md)
* [Django](https://techdocs.akamai.com/quick-deploy-apps/docs/django.md)
* [Docker](https://techdocs.akamai.com/quick-deploy-apps/docs/docker.md)
* [Flask](https://techdocs.akamai.com/quick-deploy-apps/docs/flask.md)
* [Gitea](https://techdocs.akamai.com/quick-deploy-apps/docs/gitea.md)
* [GitLab](https://techdocs.akamai.com/quick-deploy-apps/docs/gitlab.md)
* [GlusterFS (cluster)](https://techdocs.akamai.com/quick-deploy-apps/docs/glusterfs-cluster.md)
* [Harbor](https://techdocs.akamai.com/quick-deploy-apps/docs/harbor.md)
* [HashiCorp Nomad](https://techdocs.akamai.com/quick-deploy-apps/docs/hashicorp-nomad.md)
* [HashiCorp Nomad Clients (cluster)](https://techdocs.akamai.com/quick-deploy-apps/docs/hashicorp-nomad-clients-cluster.md)
* [HashiCorp Nomad (cluster)](https://techdocs.akamai.com/quick-deploy-apps/docs/hashicorp-nomad-cluster.md)
* [Jaeger](https://techdocs.akamai.com/quick-deploy-apps/docs/jaeger.md)
* [Jenkins](https://techdocs.akamai.com/quick-deploy-apps/docs/jenkins.md)
* [MEAN Stack](https://techdocs.akamai.com/quick-deploy-apps/docs/mean-stack.md)
* [Microweber](https://techdocs.akamai.com/quick-deploy-apps/docs/microweber.md)
* [NATS](https://techdocs.akamai.com/quick-deploy-apps/docs/nats.md)
* [NetFoundry Edge Router](https://techdocs.akamai.com/quick-deploy-apps/docs/netfoundry-edge-router.md)
* [Node.js](https://techdocs.akamai.com/quick-deploy-apps/docs/nodejs.md)
* [OpenLiteSpeed Django](https://techdocs.akamai.com/quick-deploy-apps/docs/openlitespeed-django.md)
* [OpenLiteSpeed Node.js](https://techdocs.akamai.com/quick-deploy-apps/docs/openlitespeed-nodejs.md)
* [RabbitMQ](https://techdocs.akamai.com/quick-deploy-apps/docs/rabbitmq.md)
* [Ruby on Rails](https://techdocs.akamai.com/quick-deploy-apps/docs/ruby-on-rails.md)
* [Saltcorn](https://techdocs.akamai.com/quick-deploy-apps/docs/saltcorn.md)
* [Splunk](https://techdocs.akamai.com/quick-deploy-apps/docs/splunk.md)
* [VS Code Server](https://techdocs.akamai.com/quick-deploy-apps/docs/vscode-server.md)