Install Confluent CLI

You can install the Confluent CLI using one of the following methods:

Install

Confluent CLI v2 replaces the former Confluent Cloud CLI for management of Confluent Cloud. Use the Installation Script instructions to download the CLI for Confluent Cloud management.

If you need to run v1 and v2 of the Confluent CLI in parallel to manage both cloud and on-prem clusters, see Run multiple CLIs in parallel.

Scripted installation

To use the scripted installation method on Microsoft Windows, you may need to install an appropriate Linux environment, such as the Windows Subsystem for Linux, to have the curl and sh commands available.

The installation script detects which system you are running on and downloads the appropriate binary.

Default installation

To install the latest version of the Confluent CLI in the default directory:

  1. Download and install the latest version in the default directory, ./bin:

    curl -sL --http1.1 https://cnfl.io/cli | sh -s -- latest
    
  2. Add the ./bin directory to your $PATH:

    export PATH=$(pwd)/bin:$PATH
    

Custom installation

To install a specific version of Confluent CLI into a custom directory:

  1. List all available Confluent CLI versions:

    curl -sL --http1.1 https://cnfl.io/cli | sh -s -- -l
    
  2. Download a specific version listed in the above output list.

    The default download directory is ./bin.

    • To download and install a specific version of the Confluent CLI, specify v followed by the version number:

      curl -sL --http1.1 https://cnfl.io/cli | sh -s -- v<version>
      
    • To download and install the Confluent CLI in a custom directory, specify -b followed by a custom directory path, <path-to-cli>:

      curl -sL --http1.1 https://cnfl.io/cli | sh -s -- -b <path-to-cli> v<version>
      

    For example, to download version 2.38.1 of Confluent CLI to /user/local/bin:

    curl -sL --http1.1 https://cnfl.io/cli | sh -s -- -b /usr/local/bin v2.38.1
    
  3. Set the PATH environment to include the directory that you downloaded the CLI binaries in the previous step:

    export PATH=<path-to-cli>:$PATH
    
  4. Optionally, if you do not have enough space in the default directory that CLI stores logs and data, set the CONFLUENT_CURRENT environment variable to use a different directory:

    export CONFLUENT_CURRENT=<path-to-confluent-local-data>
    

Tarball or Zip installation

  1. Download and install the most recently released CLI binaries for your platform:

  2. Set the PATH environment to include the directory that you downloaded the CLI binaries in the previous step:

    export PATH=<path-to-cli>:$PATH
    
  3. Optionally, if you do not have enough space in the default directory that CLI stores logs and data, set the CONFLUENT_CURRENT environment variable to use a different directory:

    export CONFLUENT_CURRENT=<path-to-confluent-local-data>
    

Use Confluent CLI in the Confluent Platform package

Confluent Platform installation packages include the Confluent CLI binaries for each of the operating system and architecture types that the Confluent CLI supports.

Confluent Community software users must download the CLI separately and configure it manually.

To use the Confluent CLI in the Confluent Platform package:

  1. Set the Confluent Platform home environment variable:

    export CONFLUENT_HOME=<The directory where Confluent is installed>
    
  2. Add the location of the CLI to the PATH:

    export PATH=$CONFLUENT_HOME/bin:$PATH
    

Install alternative version in Confluent Platform package

The version of the Confluent CLI used by Confluent Platform can be changed by downloading a specific Confluent CLI binary and using it to replace the current binary.

When you download and install the Confluent CLI outside of the Confluent Platform package, ensure that you are installing a Confluent CLI version that is compatible with the version of Confluent Platform you are running. For reference, see the Confluent CLI to Confluent Platform compatibility table.

  1. Download the appropriate version of Confluent CLI as described in Scripted installation.

  2. Use the downloaded binary to replace the existing Confluent CLI binary located in subdirectories of $CONFLUENT_HOME/libexec/cli/.

    For example, on macOS, which is the darwin operating system type and amd64 architecture type:

    cp <cli binaries> $CONFLUENT_HOME/libexec/cli/darwin_amd64/
    

Verify

Confirm the version and the OS type of the CLI with the following command:

confluent version

Upgrade

Use the confluent update command to upgrade from one version of Confluent CLI 2.x to a newer version. See confluent update for the full syntax.

To ensure compatibility, updates using the confluent update command are disabled for the CLI packaged with Confluent Platform. If you need to upgrade to a higher version of CLI, see Install alternative version in Confluent Platform package.

Troubleshoot installation issues

Issue: Confluent CLI commands hang immediately after an installation or an upgrade

The new CLI plugins functionality, introduced in v2.24.0, searches your entire $PATH and can cause slow response time if you have a long $PATH.

Workaround: Disable the plugins by setting the following in the ~/.confluent/config.json file.

"disable_plugins": true

Confluent Platform properties files

The following is a list of the default Confluent Platform services configuration properties files, where $CONFLUENT_HOME is the directory where you installed Confluent Platform. You reference or modify the appropriate file when you work with a Confluent Platform service.

  • Connect: $CONFLUENT_HOME/etc/schema-registry/connect-avro-distributed.properties
  • Control Center: $CONFLUENT_HOME/etc/confluent-control-center/control-center-dev.properties
  • Kafka: $CONFLUENT_HOME/etc/kafka/server.properties
  • REST Proxy: $CONFLUENT_HOME/etc/kafka-rest/kafka-rest.properties
  • ksqlDB: $CONFLUENT_HOME/etc/ksqldb/ksql-server.properties
  • Schema Registry: $CONFLUENT_HOME/etc/schema-registry/schema-registry.properties
  • ZooKeeper: $CONFLUENT_HOME/etc/kafka/zookeeper.properties