Install and Use The Influx CLI - InfluxDB OSS v2 Documentation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

  Docs InfluxDB OSS  v2   

Search InfluxDB v2 & Flux 

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


Set up the influx CLI
Use influx CLI commands

Install the influx CLI

macOS Linux Windows

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.
> mv 'C:\Program Files\InfluxData\influxdb2-client-2.7.3

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:

a. Select Private networks, such as my home or work network.


b. Click Allow access.

Set up the influx CLI


Provide required authentication credentials
Enable shell completion (Optional)

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

 Change InfluxDB URL

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.

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 prompts for a password after each command that
requires authentication.

influx config create \
-n CONFIG_NAME  \
-u http://localhost:8086  \
-p USERNAME  : PASSWORD  \
-o ORG 

 Change InfluxDB URL

Replace the following:

CONFIG_NAME : Connection configuration name.


ORG : your organization name.

USERNAME:PASSWORD : your UI username and password combination.

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.

Related
influx - InfluxDB command line interface

cli

Was this page helpful? Yes No

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, use the following resources:

 InfluxData Community InfluxDB Community Slack

Customers with an annual or support contract can contact


InfluxData Support.

 Edit this page

 Submit docs issue

 Submit InfluxDB issue

© 2024 InfluxData, Inc.

You might also like