Installing and Configuring the CLI¶
The Confluent CLI is supported for macOS, Microsoft Windows, and Linux operating systems. You can install the Confluent CLI by downloading the executable or tarball.
Install the Confluent CLI using this script. This command creates a
bin directory in your designated
<path-to-directory>/bin). The location must be in your PATH (e.g.
/usr/local/bin). On Microsoft Windows,
an appropriate Linux environment may need to be installed in order to have the
sh commands available, such as
the Windows Subsystem for Linux <https://docs.microsoft.com/en-us/windows/wsl/about>.
curl -L https://cnfl.io/cli | sh -s -- -b /<path-to-directory>/bin
Download and install the raw binaries by platform.
Java version requirements¶
On non-Windows platforms, the Confluent CLI offers confluent local commands
(designed to operate on a local install of Confluent Platform) which require Java, and JDK version
1.11 is recommended. If you have multiple versions of Java installed, set
JAVA_HOME to the version you want Confluent Platform to use.
Setting JAVA_HOME when you have multiple JDKs prevents the Confluent CLI from defaulting to the newest installed Java version, which may not be supported. If the default Java version is not supported, the CLI will fail with a message about unsupported Java versions even if a supported version is installed and set as the in-use JDK (shown as output to
To set JAVA_HOME, add the location of a supported JDK to your PATH in a file such as
.bash_profileor by setting it temporarily as an environment variable in your current shell:
To find the location of your installed Java versions, type the following in a command shell:
The output will look similar to this example, which happens to show two JDKs,
/usr/libexec/java_home -V Matching Java Virtual Machines (2): 12.0.1, x86_64: "OpenJDK 12.0.1" /Library/Java/JavaVirtualMachines/openjdk-12.0.1.jdk/Contents/Home 1.8.0_212, x86_64: "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
In this case, you would add JDK
#JAVA_HOME export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/
The Confluent CLI will then run with the specified, supported JDK
1.8, regardless of how many Java versions you have installed.
confluentin your terminal to get started.
You should see Confluent CLI usage information:
Manage your Confluent Platform. Usage: confluent [command] Available Commands: completion Print shell completion code. help Help about any command iam Manage RBAC and IAM permissions. local Manage a local Confluent Platform development environment. login Log in to Confluent Platform. This is required for RBAC. logout Log out of Confluent Platform. secret Manage secrets for Confluent Platform. update Update the confluent CLI. version Print the confluent CLI version. Flags: -h, --help help for confluent -v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). --version version for confluent Use "confluent [command] --help" for more information about a command.
Set your PATH variable:
If RBAC is enabled, you must log in to the Confluent CLI with the Metadata service URL specified (
<url>). For more information, see confluent login.
confluent login --url <url>
Enter your Confluent credentials: Email: Password:
Your output should resemble:
Logged in as user
Try out the Confluent CLI using a local development environment.