---
title: rpk topic create
latest-redpanda-tag: v26.2.7
latest-console-tag: v3.14.0
latest-operator-version: v26.2.6
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "false"
page-eol-date: July 28, 2027
latest-connect-version: 4.118.0
docname: rpk/rpk-topic/rpk-topic-create
page-component-name: streaming
page-version: "26.2"
page-component-version: "26.2"
page-component-title: Streaming
page-relative-src-path: rpk/rpk-topic/rpk-topic-create.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/main/modules/reference/pages/rpk/rpk-topic/rpk-topic-create.adoc
description: Create one or more Kafka topics with configurable partitions, replication factor, and topic-level settings. All topics created with one invocation have the same number of partitions, replication factor, and key/value configs.
page-git-created-date: "2023-05-17"
page-git-modified-date: "2026-10-29"
page-autogenerated: true
page-generated-by: doc-tools (rpk-docs)
page-generated-from: the rpk command help in redpanda-data/streaming-enterprise
page-generated-content: all
support-status: supported
---

# rpk topic create

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

<!-- Source: https://docs.redpanda.com/streaming/current/reference/rpk/rpk-topic/rpk-topic-create.md -->

Create one or more Kafka topics with configurable partitions, replication factor, and topic-level settings.

All topics created with one invocation have the same number of partitions, replication factor, and key/value configs. For example, `rpk topic create -c cleanup.policy=compact -r 3 -p 20 foo bar` creates two topics, `foo` and `bar`, each with 20 partitions, 3 replicas, and the `cleanup.policy=compact` config option set.

> ❗ **IMPORTANT**
>
> Starting in Redpanda v25.3, several topic properties support enhanced tristate behavior. Properties like `retention.ms`, `retention.bytes`, `segment.ms`, and others now distinguish between zero values (immediate eligibility for cleanup/compaction) and negative values (disable the feature entirely). Previously, zero and negative values were treated the same way. For the complete list of affected properties and detailed information, see [Redpanda v26.1 behavior changes](https://docs.redpanda.com/streaming/current/get-started/release-notes/redpanda/#behavior-changes). Review your topic configurations if you currently use zero values for these properties.

For more information about topics, see [`rpk topic describe`](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-topic/rpk-topic-describe/).

## Usage

```bash
rpk topic create <topics...> [flags]
```

## Examples

This section provides examples of how to use `rpk topic create`.

### Create a topic

Create a topic named `my-topic`

```bash
rpk topic create my-topic
```

Output:

```bash
TOPIC     STATUS
my-topic  OK
```

### Create multiple topics

Create two topics (`my-topic-1`, `my-topic-2`) at the same time with one command

```bash
rpk topic create my-topic-1 my-topic-2
```

Output:

```bash
TOPIC       STATUS
my-topic-1  OK
my-topic-2  OK
```

### Set a topic property

Create topic `my-topic-3` with the topic property `cleanup.policy=compact`

```bash
rpk topic create my-topic-3 -c cleanup.policy=compact
```

Output:

```bash
TOPIC       STATUS
my-topic-3  OK
```

### Create topic with multiple partitions

Create topic `my-topic-4` with 20 partitions

```bash
rpk topic create my-topic-4 -p 20
```

Output:

```bash
TOPIC       STATUS
my-topic-4  OK
```

### Create topic with multiple replicas

> ❗ **IMPORTANT**
>
> The replication factor must be a positive, odd number (such as 3), and it must be equal to or less than the number of available brokers.

Create topic `my-topic-5` with 3 replicas

```bash
rpk topic create my-topic-5 -r 3
```

Output:

```bash
TOPIC       STATUS
my-topic-5  OK
```

### Combine flags

You can combine flags in any way you want. This example creates two topics, `topic-1` and `topic-2`, each with 20 partitions, 3 replicas, and the cleanup policy set to compact

```bash
rpk topic create -c cleanup.policy=compact -r 3 -p 20 topic-1 topic-2
```

Output:

```bash
TOPIC    STATUS
topic-1  OK
topic-2  OK
```

## Flags

| Value | Type | Description |
| --- | --- | --- |
| `-d, --dry` | bool | Validate the topic creation request without actually creating the topic. Useful for testing configuration. |
| `--if-not-exists` | bool | Only create the topic if it does not already exist. |
| `-p, --partitions` | int32 | Number of partitions for the topic. The default of `-1` uses the cluster’s `default_topic_partitions` property. More partitions enable higher parallelism but increase resource usage. |
| `-r, --replicas` | int16 | Replication factor (must be odd); -1 defaults to the cluster’s default_topic_replications. |
| `-c, --topic-config` | stringArray | Topic configuration properties in the format `key=value`. Can be specified multiple times. Example: `--topic-config retention.ms=86400000`. |

## Global flags

| Value | Type | Description |
| --- | --- | --- |
| `--config` | string | Redpanda or `rpk` config file; default search paths are `~/.config/rpk/rpk.yaml`, `$PWD/redpanda.yaml`, and `/etc/redpanda/redpanda.yaml`. |
| `-X, --config-opt` | stringArray | Override `rpk` configuration settings; `-X help` for detail or `-X list` for terser detail. |
| `--ignore-profile` | bool | Ignore `rpk.yaml` and `redpanda.yaml`; use default settings. |
| `--profile` | string | `rpk` profile to use. |
| `-v, --verbose` | bool | Enable verbose logging. |

> 📝 **NOTE**
>
> For the full list of properties, see [Topic Properties](https://docs.redpanda.com/streaming/current/reference/properties/topic-properties/)