.. _confluent_hub_client:

|c-hub| Client
==============

The |c-hub| client is a command line tool that makes it easy to install and update components
from `Confluent Hub <https://confluent.io/hub>`_ into a local |cp| installation.

.. _confluent-hub-client-installing-client:

-------------------------
Installing |c-hub| Client
-------------------------

The |c-hub| client is natively :ref:`installed <installation-overview>` as a part of |cp| and located in
the ``/bin`` directory. You can also install separately by following these instructions.

MacOS
-----

#.  Tap the Confluent repository for the |c-hub| client.

    .. codewithvars:: bash

        brew tap confluentinc/homebrew-confluent-hub-client

#.  Install the |c-hub| client.

    .. codewithvars:: bash

        brew cask install confluent-hub-client

#.  .. include:: includes/client-optional.rst


Linux
-----

Download and unzip the |c-hub| tarball.

#.  Download and unzip
    `confluent-hub-client-latest.tar.gz <http://client.hub.confluent.io/confluent-hub-client-latest.tar.gz>`_.
    Add the contents of the ``bin`` directory to your PATH environment variable so that ``which confluent-hub`` finds the ``confluent-hub`` command.


#.  .. include:: includes/client-optional.rst

.. _confluent-hub-client-installing-components:

-----------------------------------------
Installing Components With |c-hub| Client
-----------------------------------------

You can click the **Installation** tab of a component on |c-hub| to get the component-specific installation commands or see
the :ref:`connector installation documentation <connect_managing>`. For example,
here are the installation instructions for the |kconnect-long| JDBC connector:

.. image:: ../../../images/confluent-hub-1.png

Use this |c-hub| client command to install components from |c-hub| into a local |cp| installation:

.. code:: bash

     confluent-hub install <owner>/<component>:<version>

where

* ``<owner>`` is the name of component owner on |c-hub|.
* ``<component>`` is the name of the component on |c-hub|.
* ``<version>`` is either the version of the component on |c-hub| or the literal ``latest`` when you just want to
  install the latest version of the component.

.. tip:: If the **Installation** tab doesn't provide the |c-hub| installation command, contact the component owner.