Install and use the influx CLI

    The influx CLI is packaged and versioned separately from the InfluxDB server (influxd).

    macOS Windows

    Do one of the following:

    If you used Homebrew to install InfluxDB v2.2, the influxdb-cli formula was downloaded as a dependency and should already be installed. If installed, influxdb-cli will appear in the output of the following command:

    1. brew list | grep influxdb-cli
    1. Download the influx CLI package.

    2. (Optional) Place the binary in your $PATH.

    3. (macOS Catalina and newer) Authorize the influx binary.

      macOS requires downloaded binaries to be signed by registered Apple developers. When you first attempt to run influx, macOS will prevent it from running. To authorize the influx binary:

      1. Attempt to run an influx command.
      2. Open System Preferences and click Security & Privacy.
      3. Under the General tab, there is a message about being blocked. Click Open Anyway.
    4. Download the influx CLI package.

      Download the influx CLI package from your browser or .

      Download from your browser

      influx CLI v (arm)

      Download from the command line

      1. # amd64
      2. wget https://dl.influxdata.com/influxdb/releases/influxdb2-client--linux-amd64.tar.gz
      3. # arm
      4. wget https://dl.influxdata.com/influxdb/releases/influxdb2-client--linux-arm64.tar.gz
    5. Unpackage the downloaded package.

      *Note: The following commands are examples. Adjust the filenames, paths, and utilities if necessary.*

      1. # amd64
      2. # arm
      3. tar xvzf path/to/influxdb2-client--linux-arm64.tar.gz
    6. (Optional) Place the unpackaged influx executable in your system $PATH.

      If you do not move the influx binary into your $PATH, prefix the executable to run it in place.

    7. Download the influx CLI package.

      influx CLI v (Windows)

    8. Expand the downloaded archive into C:\Program Files\InfluxData\ and rename it if desired.

      1. > Expand-Archive .\influxdb2-client--windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\'
      2. > mv 'C:\Program Files\InfluxData\influxdb2-client--windows-amd64' 'C:\Program Files\InfluxData\influx'
    9. Grant network access to the influx CLI.

      When using the influx CLI for the first time, Windows Defender displays the following message:

      To grant the influx CLI the required access, do the following:

      1. Select Private networks, such as my home or work network.
      2. Click Allow access.

    To avoid having to pass your InfluxDB host, API token, and organization with each command, store them in an influx CLI configuration (config). influx commands that require these credentials automatically retrieve these credentials from the active config.

    Use the to create an influx CLI config and set it as active:

    1. influx config create --config-name <config-name> \
    2. --host-url http://localhost:8086 \
    3. --org <your-org> \
    4. --token <your-auth-token> \

    For more information about managing CLI configurations, see the influx config documentation.

    For instructions on how to create API tokens, see .

    To install shell completion scripts, see influx completion.

    For information about influx CLI commands, see the .