# 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)

---
title: rpk topic create
latest-operator-version: v26.1.4
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "true"
page-eol-date: April 30, 2025
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
docname: rpk/rpk-topic/rpk-topic-create
page-component-name: streaming
page-version: "24.1"
page-component-version: "24.1"
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/v/24.1/modules/reference/pages/rpk/rpk-topic/rpk-topic-create.adoc
page-git-created-date: "2023-05-17"
page-git-modified-date: "2024-07-24"
support-status: past end-of-life
---

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

Create topics.

Topics created with this command will have the same number of partitions, replication factor, and key/value configs.

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

## [](#usage)Usage

```bash
rpk topic create [TOPICS...] [flags]
```

## [](#flags)Flags

| Value | Type | Description |
| --- | --- | --- |
| -d, --dry | - | Dry run: validate the topic creation request; do not create topics. |
| -h, --help | - | Help for create. |
| -p, --partitions | int32 | Number of partitions to create per topic; -1 defaults to the cluster property default_topic_partitions (default -1). |
| -r, --replicas | int16 | Replication factor (must be odd); -1 defaults to the cluster’s default_topic_replications (default -1). |
| -c, --topic-config | string (repeatable) | Topic properties can be set by using <key>=<value>. For example -c cleanup.policy=compact. This flag is repeatable, so you can set multiple parameters in a single command. |
| --config | string | Redpanda or rpk config file; default search paths are /var/lib/redpanda/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml. |
| -X, --config-opt | stringArray | Override rpk configuration settings. See rpk -X or execute rpk -X help for inline detail or rpk -X list for terser detail. |
| --profile | string | Profile to use. See rpk profile for more details. |
| -v, --verbose | - | Enable verbose logging. |

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

## [](#examples)Examples

### [](#create-a-topic)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 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)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 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)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)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
```