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.

Supported environments

Operating systems

The Confluent CLI is supported on macOS, Microsoft Windows, and Linux (including Alpine) operating systems.

Java versions

On non-Windows platforms, the Confluent CLI offers the confluent local commands for operating on a local install of Confluent Platform. If you plan to use the confluent local commands, you need to have the JDK version 1.8 or 1.11 on your local system.

If you have multiple versions of Java installed, set the JAVA_HOME environment variable to the version you want Confluent Platform to use.

See Java supported versions for Confluent Platform for the currently supported Java versions.

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. Set the PATH environment to include the directory that you downloaded the CLI binaries, ./bin:

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

    curl -sL --http1.1 https://cnfl.io/cli | sh -s -- -b /usr/local/bin v2.14.0
    
  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.

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