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
-
Download the
influxCLI package. -
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.2.0-darwin-amd64.tar.gz
-
-
(Optional) Place the binary in your
$PATH.# (Optional) Copy the influx binary to your $PATH sudo cp ~/Downloads/influxdb2-client-2.2.0-darwin-amd64/influx /usr/local/bin/If you do not move the
influxbinary into your$PATH, prefix the executable./to run it in place. -
(macOS Catalina and newer) Authorize the
influxbinary.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 theinfluxbinary:- Attempt to run an
influxcommand. - Open System Preferences and click Security & Privacy.
- Under the General tab, there is a message about
influxbeing blocked. Click Open Anyway.
- Attempt to run an
-
Download the influx CLI package.
Download the
influxCLI package from your browser or from the command line.Download from your browser
influx CLI v2.2.0 (amd64) influx CLI v2.2.0 (arm)
Download from the command line
# amd64 wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.2.0-linux-amd64.tar.gz # arm wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.2.0-linux-arm64.tar.gz -
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.2.0-linux-amd64.tar.gz # arm tar xvzf path/to/influxdb2-client-2.2.0-linux-arm64.tar.gz -
(Optional) Place the unpackaged
influxexecutable in your system$PATH.# amd64 sudo cp influxdb2-client-2.2.0-linux-amd64/influx /usr/local/bin/ # arm sudo cp influxdb2-client-2.2.0-linux-arm64/influx /usr/local/bin/If you do not move the
influxbinary into your$PATH, prefix the executable./to run it in place.
-
Download the
influxCLI package. -
Expand the downloaded archive.
Expand the downloaded archive into
C:\Program Files\InfluxData\and rename it if desired.> Expand-Archive .\influxdb2-client-2.2.0-windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\' > mv 'C:\Program Files\InfluxData\influxdb2-client-2.2.0-windows-amd64' 'C:\Program Files\InfluxData\influx' -
Grant network access to the
influxCLI.When using the
influxCLI for the first time, Windows Defender displays the following message:Windows Defender Firewall has blocked some features of this app.
To grant the
influxCLI the required access, do the following:- Select Private networks, such as my home or work network.
- 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> \
--active
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.
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.