Install Confluent CLI

Use this documentation to install the Confluent CLI. Ensure you meet all requirements before moving forward.

To install the Confluent CLI, use any of the following methods:

Homebrew

macOS and Linux users can install the latest version of Confluent CLI using the following Homebrew command:

brew install confluentinc/tap/cli

Scripted installation

Tip

You can use the following instructions to install the latest version of the Confluent CLI:

curl -sL --http1.1 https://cnfl.io/cli | sh -s -- latest

To use the scripted installation method on Microsoft Windows, you might 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.

To download Confluent CLI directly from GitHub, see the following sections:

Windows

To install the Confluent CLI on Windows, complete the following steps:

  1. Download the latest Windows ZIP file from https://github.com/confluentinc/cli/releases/latest.

  2. Unzip the following file:

    confluent_X.X.X_windows_amd64.zip
    
  3. Run confluent.exe.

Default directory

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 directory

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 3.34.1 of Confluent CLI to /user/local/bin:

    curl -sL --http1.1 https://cnfl.io/cli | sh -s -- -b /usr/local/bin v3.34.1
    
  3. Set the $PATH environment variable 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>
    

Confluent Platform installation 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 Confluent 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 you install 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 the 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/
    

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>
    

Verify

You can 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 an earlier version of the Confluent CLI to a newer version. For the full syntax, see confluent update.

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 later version of the CLI, see Install alternative version in Confluent Platform package.

Confluent Platform properties files

The following list includes 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