# rpk security secret create

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

---
title: rpk security secret create
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: rpk/rpk-security/rpk-security-secret-create
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: rpk/rpk-security/rpk-security-secret-create.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/rpk/rpk-security/rpk-security-secret-create.adoc
page-git-created-date: "2025-05-09"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-security/rpk-security-secret-create.md -->

Create a new secret for your cluster.

Scopes define the areas where the secret can be used. Available scopes are:

-   `redpanda_connect`

-   `redpanda_cluster`


You can set one or both scopes on a secret.

## [](#usage)Usage

```bash
rpk security secret create [flags]
```

## [](#examples)Examples

To create a secret and set its scope to `redpanda_connect`:

```bash
rpk security secret create --name NETT --value value --scopes redpanda_connect
```

To set the scope to both `redpanda_connect` and `redpanda_cluster`:

```bash
rpk security secret create --name NETT2 --value value --scopes redpanda_connect,redpanda_cluster
```

You can also pass the scopes as a string:

```bash
rpk security secret create --name NETT2 --value value --scopes "redpanda_connect,redpanda_cluster"
```

## [](#flags)Flags

| Value | Type | Description |
| --- | --- | --- |
| -h, --help | - | Help for create. |
| --name | string | Name of the secret (required). Must be in uppercase and can only contain letters, digits, and underscores. |
| --scopes | stringArray | Scope(s) of the secret, for example, redpanda_connect (required). |
| --value | string | Value of the secret (required). |
| --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 run rpk -X help for inline detail or rpk -X list for terser detail. |
| --profile | string | rpk profile to use. |
| -v, --verbose | - | Enable verbose logging. |