# Specify Admin API Addresses for rpk

> 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: Specify Admin API Addresses for rpk
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: admin-addresses
page-component-name: streaming
page-version: "24.1"
page-component-version: "24.1"
page-component-title: Streaming
page-relative-src-path: admin-addresses.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/v/24.1/modules/get-started/pages/admin-addresses.adoc
description: Learn how and when to specify Redpanda admin addresses for <code>rpk</code> commands, so <code>rpk</code> knows where to run admin-related commands.
page-git-created-date: "2024-07-24"
page-git-modified-date: "2024-07-24"
support-status: past end-of-life
---

<!-- Source: https://docs.redpanda.com/streaming/24.1/get-started/admin-addresses.md -->

For `rpk` to know where to run admin-related commands, you must provide the admin server addresses for each broker of a Redpanda cluster. You can specify these addresses as IP addresses or as hostnames, using any of these methods:

-   Command line flag (`-X admin.hosts`)

-   Environment variable setting (`RPK_ADMIN_HOSTS`)

-   Configuration file setting in `redpanda.yaml` (`rpk.admin_api.addresses`)


Command line flag settings take precedence over environment variable settings and configuration file settings. If the command line does not contain the `-X admin.hosts` settings, the environment variable settings are used. If the environment variables are not set, the values in the configuration file are used.

## [](#command-line-flags)Command line flags

Admin API addresses are required for communicating with the Admin API. Provide these addresses with the `—-api-urls` flag for commands related to cluster or user tasks, such as [`rpk cluster health`](https://docs.redpanda.com/streaming/24.1/reference/rpk/rpk-cluster/rpk-cluster-health/) and [`rpk cluster maintenance enable <node_id>`](https://docs.redpanda.com/streaming/24.1/reference/rpk/rpk-cluster/rpk-cluster-maintenance/). Note that `rpk cluster info` and `rpk cluster metadata` instead require the [`-X brokers` flag](https://docs.redpanda.com/streaming/24.1/get-started/broker-admin/).

The following table shows which `rpk` commands require the `-X admin.hosts` or `--hosts` flag.

| Command | Address flag required |
| --- | --- |
| rpk security user | -X admin.hosts |
| rpk cluster (all except rpk cluster info and rpk cluster metadata) | -X admin.hosts |
| rpk redpanda admin | --hosts |

## [](#environment-variable-settings)Environment variable settings

Environment variable settings last for the duration of the shell session, or until you set the variable to a different setting. Configure the environment variable `RPK_ADMIN_HOSTS`.

For example, to configure the addresses to use when running Admin API commands on an external cluster with three brokers:

```bash
export RPK_ADMIN_HOSTS="192.168.78.34:9644,192.168.78.35:9644,192.168.78.36:9644"
```

## [](#configuration-file-settings)Configuration file settings

As each Redpanda broker starts up, a `redpanda.yaml` configuration file is automatically generated for that broker. This file contains a section for `rpk` settings, which includes Admin API settings.

The `admin_api` section contains the address and port for each admin server. The default address is `0.0.0.0`, and the default port is 9644. You can edit this line and replace it with the Admin API IP addresses.

The following example shows the addresses and port numbers for two admin servers.

```yaml
rpk:
  admin_api:
    - 192.168.72.34:9644
    - 192.168.72.35:9644
```

> 📝 **NOTE**
>
> If you do not update the default addresses in the `redpanda.yaml` file, you must provide the required addresses on the command line or by setting the corresponding environment variable.