# Generate a Debug Bundle with `rpk` in Linux

> 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: Generate a Debug Bundle with <code>rpk</code> in Linux
latest-redpanda-tag: v26.1.9
latest-console-tag: v3.7.3
latest-operator-version: v26.1.4
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "false"
page-eol-date: March 31, 2027
latest-connect-version: 4.93.0
docname: debug-bundle/generate/linux
page-component-name: streaming
page-version: "26.1"
page-component-version: "26.1"
page-component-title: Streaming
page-relative-src-path: debug-bundle/generate/linux.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/main/modules/troubleshoot/pages/debug-bundle/generate/linux.adoc
description: Use <code>rpk</code> to generate a debug bundle on a Redpanda cluster running in Linux.
page-git-created-date: "2024-12-16"
page-git-modified-date: "2024-12-16"
support-status: supported
---

<!-- Source: https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/generate/linux.md -->

Use `rpk` to generate a debug bundle on a Redpanda cluster running in Linux.

To generate a debug bundle with rpk, you have two options depending on your needs:

-   [Use `rpk debug bundle`](#debug-bundle): Run this command directly on each broker in the cluster. This method requires access to the nodes your brokers are running on.

-   [Use `rpk debug remote-bundle`](#remote-debug-bundle): Run this command from a remote machine to collect diagnostics data from all brokers in the cluster. This method is ideal when you want to gather data without logging into each node individually.


## [](#prerequisites)Prerequisites

You must have [`rpk` installed](https://docs.redpanda.com/streaming/current/get-started/rpk-install/) on your host machine.

## [](#debug-bundle)Use `rpk debug bundle`

To generate a debug bundle with `rpk`, you can run the [`rpk debug bundle`](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-debug/rpk-debug-bundle/) command on each broker in the cluster.

1.  Execute the [`rpk debug bundle`](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-debug/rpk-debug-bundle/) command on a broker:

    ```bash
    rpk debug bundle
    ```

    If you have an upload URL from the Redpanda support team, provide it in the `--upload-url` flag to upload your debug bundle to Redpanda.

    ```bash
    rpk debug bundle \
      --upload-url <url>
    ```

    Example output:

    Creating bundle file...

    Debug bundle saved to "/var/lib/redpanda/1675440652-bundle.zip"

2.  On your host machine, make a directory in which to save the debug bundle:

    ```bash
    mkdir debug-bundle
    ```

3.  Copy the debug bundle ZIP file to the `debug-bundle` directory on your host machine.

4.  Unzip the file on your host machine and use it to debug your cluster.

    ```bash
    cd debug-bundle
    unzip <bundle-name>.zip
    ```

    For guidance on reading the debug bundle, see [Inspect a Debug Bundle](https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/inspect/).

5.  Remove the debug bundle from the Redpanda broker:

    ```bash
    rm /var/lib/redpanda/<bundle-name>.zip
    ```


When you’ve finished troubleshooting, remove the debug bundle from your host machine:

```bash
rm -r debug-bundle
```

## [](#remote-debug-bundle)Use `rpk debug remote-bundle`

The [`rpk debug remote-bundle`](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-debug/rpk-debug-remote-bundle/) command allows you to remotely generate a consolidated debug bundle from all brokers in your cluster. This command is useful when you do not want to log into each broker’s node individually using `rpk debug bundle`.

1.  Create an [`rpk` profile](https://docs.redpanda.com/streaming/current/get-started/config-rpk-profile/) to connect to your cluster. Include all brokers you want to collect data from in the `admin.hosts` configuration.

    ```bash
    rpk profile create <profile-name> --set admin.hosts=<brokers>
    ```

2.  Check the configured addresses in your profile:

    ```bash
    rpk profile print
    ```

    Example output:

    `profile.yml`

    ```yaml
    admin:
      hosts:
        - broker1:9644
        - broker2:9644
        - broker3:9644
    ```

3.  Start the debug bundle process:

    ```bash
    rpk debug remote-bundle start
    ```

    > 💡 **TIP**
    >
    > To skip the confirmation steps, use the `--no-confirm` flag.
    >
    > To generate a bundle for a subset of brokers, use the `-X admin.hosts` flag. For example, `rpk debug remote-bundle start -X admin.hosts target-broker:9644`.

4.  Check the status:

    ```bash
    rpk debug remote-bundle status
    ```

    Example output:

    BROKER           STATUS   JOB-ID
    localhost:29644  running  7f93fd6e-fc5e-46a5-8842-717542f89e59
    localhost:19644  running  7f93fd6e-fc5e-46a5-8842-717542f89e59

    When the status changes to `success`, the process is complete.

    > 💡 **TIP**
    >
    > To cancel a debug bundle process while it’s running, use `rpk debug remote-bundle cancel`.

5.  When the process is complete, download the debug bundle:

    ```bash
    rpk debug remote-bundle download
    ```

    By default the compressed file is downloaded to your current working directory. To choose a different location or filename, use the `--output` flag. For example:

    ```bash
    rpk debug remote-bundle download --output ~/redpanda/debug-bundles/cluster1
    ```

    This command results in `cluster1.zip` downloaded to the `~/redpanda/debug-bundles/` directory.


Unzip the file and use the contents to debug your cluster. For guidance on reading the debug bundle, see [Inspect a Debug Bundle](https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/inspect/).

> 💡 **TIP**
>
> Configure the [`debug_bundle_auto_removal_seconds`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#debug_bundle_auto_removal_seconds) property to automatically remove debug bundles after a period of time. See [Automatically remove debug bundles](https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/configure/linux/#remove).

## [](#next-steps)Next steps

[Inspect a Debug Bundle](https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/inspect/).

## [](#suggested-reading)Suggested reading

-   [`rpk debug bundle`](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-debug/rpk-debug-bundle/)

-   [`rpk debug remote-bundle`](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-debug/rpk-debug-remote-bundle/)

-   [jq manual](https://stedolan.github.io/jq/manual/#Basicfilters)