Install and use the influx CLI

Use the influx CLI to interact with and manage your InfluxDB instance. Write and query data, generate InfluxDB templates, export data, and more.

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

Install the influx CLI

Do one of the following:

Use Homebrew

brew install influxdb-cli

If you used Homebrew to install InfluxDB 2.7, 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:

brew list | grep influxdb-cli

Manually download and install

  1. Download the influx CLI package.

    influx CLI v2.7.3 (macOS)

  2. Unpackage the downloaded package.

    Do one of the following:

    • Double-click the downloaded package file in Finder.

    • Run the following command in a macOS command prompt application such Terminal or iTerm2:

      # Unpackage contents to the current working directory
      tar zxvf ~/Downloads/influxdb2-client-2.7.3-darwin-amd64.tar.gz
  3. (Optional) Place the binary in your $PATH.

    # (Optional) Copy the influx binary to your $PATH
    sudo cp ~/Downloads/influxdb2-client-2.7.3-darwin-amd64/influx /usr/local/bin/

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

  4. (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 influx being blocked. Click Open Anyway.
  1. Download the influx CLI package.

    Download the influx CLI package from your browser or from the command line.

    Download from your browser

    influx CLI v2.7.3 (amd64) influx CLI v2.7.3 (arm)

    Download from the command line

    # amd64
    # arm
  2. Unpackage the downloaded package.

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

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

    # amd64
    sudo cp influxdb2-client-2.7.3-linux-amd64/influx /usr/local/bin/
    # arm
    sudo cp influxdb2-client-2.7.3-linux-arm64/influx /usr/local/bin/

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

We recommend running influx CLI commands in Powershell. Command Prompt is not fully compatible.

  1. Download the influx CLI package.

    influx CLI v2.7.3 (Windows)

  2. Expand the downloaded archive.

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

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

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

    Windows Defender Firewall has blocked some features of this app.

    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.

Set up the influx CLI

Provide required authentication credentials

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 influx config create command to create an influx CLI config and set it as active:

influx config create --config-name <config-name> \
  --host-url http://localhost:8086 \
  --org <your-org> \
  --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 Create a token.

Authenticate with a username and password

The influx CLI 2.4.0+ lets you create connection configurations that authenticate with InfluxDB OSS 2.4+ using the username and password combination that you would use to log into the InfluxDB user interface (UI). The CLI retrieves a session cookie and stores it, unencrypted, in your configs path.

Use the --username-password, -p option to provide your username and password using the <username>:<password> syntax. If no password is provided, the CLI will prompt for a password after each command that requires authentication.

influx config create \
  -n config-name \
  -u http://localhost:8086 \
  -p example-user:example-password \
  -o example-org

Enable shell completion (Optional)

To install influx shell completion scripts, see influx completion.

Use influx CLI commands

For information about influx CLI commands, see the influx CLI reference documentation.

Was this page helpful?

Thank you for your feedback!

Introducing InfluxDB Clustered

A highly available InfluxDB 3.0 cluster on your own infrastructure.

InfluxDB Clustered is a highly available InfluxDB 3.0 cluster built for high write and query workloads on your own infrastructure.

InfluxDB Clustered is currently in limited availability and is only available to a limited group of InfluxData customers. If interested in being part of the limited access group, please contact the InfluxData Sales team.

Learn more
Contact InfluxData Sales

The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Flux is going into maintenance mode and will not be supported in InfluxDB 3.0. This was a decision based on the broad demand for SQL and the continued growth and adoption of InfluxQL. We are continuing to support Flux for users in 1.x and 2.x so you can continue using it with no changes to your code. If you are interested in transitioning to InfluxDB 3.0 and want to future-proof your code, we suggest using InfluxQL.

For information about the future of Flux, see the following:

State of the InfluxDB Cloud Serverless documentation

InfluxDB Cloud Serverless documentation is a work in progress.

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.