Documentation

Install and use the influx CLI

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

Install the influx CLI

Do one of the following:

Use Homebrew

brew install influxdb-cli

Manually download and install

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

    Download from your browser

    influx CLI v2.7.3 (macOS)

    Download from the command line

    curl -O https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.3-darwin-amd64.tar.gz \
        --output-dir ~/Downloads
    
  2. Unpackage the downloaded binary.

    Do one of the following:

    • In Finder, double-click the downloaded package file.

    • In your terminal (for example, Terminal or iTerm2) use tar to extract the package–for example, enter the following command to extract it into ~/Downloads:

      tar zxvf ~/Downloads/influxdb2-client-2.7.3-darwin-amd64.tar.gz \
        --directory ~/Downloads
      
  3. Optional: Place the influx binary in your $PATH–for example, copy the binary to /usr/local/bin:

    sudo cp ~/Downloads/influx /usr/local/bin/
    

    With the influx binary in your $PATH (/usr/local/bin), you can enter influx in your terminal to run the CLI.

    If you do not move the influx binary into your $PATH, enter the path to the binary to run the CLI–for example:

    ~/Downloads/influx
    
  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 prevents it from running. To authorize the influx binary:

    Allow the binary on macOS Ventura

    1. Follow the preceding instructions to attempt to start influx.
    2. Open System Settings and click Privacy & Security.
    3. Under the Security heading, there is a message about “influxd” being blocked, click Allow Anyway.
    4. When prompted, enter your password to allow the setting.
    5. Close System Settings.
    6. Attempt to start influx.
    7. A prompt appears with the message “macOS cannot verify the developer of “influx”…”". Click Open.

    Allow the binary on macOS Catalina

    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 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
    wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.3-linux-amd64.tar.gz
    
    # arm
    wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.3-linux-arm64.tar.gz
    
  2. Unpackage the downloaded binary.

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

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

    # amd64
    sudo cp ./influx /usr/local/bin/
    
    # arm
    sudo cp ./influx /usr/local/bin/
    

    If you do not move the influxd binary into your $PATH, enter the path to the binary to start the server–for example:

    ./influx
    

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 .\influxdb2-client-2.7.3-windows-amd64.zip -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
ORG
\
--token
API_TOKEN
\
--active

Replace the following:

  • CONFIG_NAME: Connection configuration name.
  • ORG_NAME: your InfluxDB organization.
  • API_TOKEN: your API 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.

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.

cli

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:

InfluxDB Cloud powered by TSM