---
title: influx - InfluxDB command line interface
description: The influx CLI includes commands to manage many aspects of InfluxDB, including buckets, organizations, users, tasks, etc.
url: https://docs.influxdata.com/influxdb3/cloud-serverless/reference/cli/influx/
estimated_tokens: 4104
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb3/cloud-serverless/reference/cli/influx/
date: '2025-04-02T15:54:32-06:00'
lastmod: '2025-04-02T15:54:32-06:00'
---

The `influx` command line interface (CLI) includes commands to manage many aspects of InfluxDB,
including buckets, organizations, users, tasks, etc.

* [Download and install the influx CLI](#download-and-install-the-influx-cli)
  * [Use Homebrew](#use-homebrew)
  * [Manually download and install](#manually-download-and-install)
    * [Download from your browser](#download-from-your-browser)
    * [Download from the command line](#download-from-the-command-line)

* [Provide required authentication credentials](#provide-required-authentication-credentials)
  * [Credential precedence](#credential-precedence)

* [Usage](#usage)
* [Commands](#commands)
* [Flags](#flags)
  * [Flag patterns and conventions](#flag-patterns-and-conventions)
    * [Mapped environment variables](#mapped-environment-variables)
    * [Shorthand and longhand flags](#shorthand-and-longhand-flags)
    * [Flag input types](#flag-input-types)
      * [string](#string)
      * [stringArray](#stringarray)
      * [integer](#integer)
      * [duration](#duration)

## Download and install the influx CLI

#### macOS ####

Do one of the following:

* [Use Homebrew](#use-homebrew)
* [Manually download and install](#manually-download-and-install)

### Use Homebrew

```sh
brew install influxdb-cli
```

### Manually download and install

1. **Download the `influx` CLI package.**

   [influx CLI v2.8.0 (macOS)](https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.8.0-darwin-amd64.tar.gz)

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](https://www.iterm2.com/)**:

     ```
     # Unpackage contents to the current working directory
     tar zxvf ~/Downloads/influxdb2-client-2.8.0-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.8.0-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](#download-from-your-browser)or [from the command line](#download-from-the-command-line).

   #### Download from your browser ####

   [influx CLI v2.8.0 (amd64)](https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.8.0-linux-amd64.tar.gz)[influx CLI v2.8.0 (arm)](https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.8.0-linux-arm64.tar.gz)

   #### Download from the command line ####

   ```
   # amd64
   curl -O \
   https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.8.0-linux-amd64.tar.gz
   ```

   ```
   # arm
   curl -O \
   https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.8.0-linux-arm64.tar.gz \
   ```

2. **Unpackage the downloaded package.**

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

   ```
   # amd64
   tar xvzf influxdb2-client-2.8.0-linux-amd64.tar.gz
   ```

   ```
   # arm
   tar xvzf influxdb2-client-2.8.0-linux-arm64.tar.gz
   ```

3. **(Optional) Place the unpackaged `influx` executable in your system `$PATH`.**

   ```
   sudo cp ./influx /usr/local/bin/
   ```

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

#### Use Powershell for Windows

Use Powershell for running `influx` CLI commands.
Command Prompt is not fully compatible.

1. **Download the `influx` CLI package.**

   [influx CLI v2.8.0 (Windows)](https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.8.0-windows-amd64.zip)

2. **Expand the downloaded archive.**

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

   ```
   > Expand-Archive .\influxdb2-client-2.8.0-windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\'
   > mv 'C:\Program Files\InfluxData\influxdb2-client-2.8.0-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**.

## 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](/influxdb3/cloud-serverless/reference/cli/influx/config/create/)to create an `influx` CLI config and set it as active:

```sh
influx config create --config-name CONFIG_NAME \
  --host-url http://localhost:8086 \
  --org ORG_NAME \
  --token API_TOKEN \
  --active
```

For more information about managing CLI configurations, see the[`influx config` documentation](/influxdb3/cloud-serverless/reference/cli/influx/config/).

### Credential precedence

Provide credentials using any of the following supported methods.
The `influx` CLI uses the following precedence when retrieving credentials:

1. Command line flags (`--host`, `--org -o`, `--token -t`)
2. Environment variables (`INFLUX_HOST`, `INFLUX_ORG`, `INFLUX_TOKEN`)
3. CLI configuration file

Command line flags override environment variables, which override configuration file values.

## Usage

```
influx [flags]
influx [command]
```

## Commands

|                                    Command                                     |                               Description                                |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------|
|        [apply](/influxdb3/cloud-serverless/reference/cli/influx/apply/)        |                        Apply an InfluxDB template                        |
|         [auth](/influxdb3/cloud-serverless/reference/cli/influx/auth/)         |                      API token management commands                       |
|       [backup](/influxdb3/cloud-serverless/reference/cli/influx/backup/)       |                    Back up data *(InfluxDB OSS only)*                    |
|       [bucket](/influxdb3/cloud-serverless/reference/cli/influx/bucket/)       |                        Bucket management commands                        |
|[bucket-schema](/influxdb3/cloud-serverless/reference/cli/influx/bucket-schema/)|          Manage InfluxDB bucket schemas *(InfluxDB Cloud only)*          |
|   [completion](/influxdb3/cloud-serverless/reference/cli/influx/completion/)   |                       Generate completion scripts                        |
|       [config](/influxdb3/cloud-serverless/reference/cli/influx/config/)       |                    Configuration management commands                     |
|   [dashboards](/influxdb3/cloud-serverless/reference/cli/influx/dashboards/)   |                             List dashboards                              |
|       [delete](/influxdb3/cloud-serverless/reference/cli/influx/delete/)       |                       Delete points from InfluxDB                        |
|       [export](/influxdb3/cloud-serverless/reference/cli/influx/export/)       |                      Export resources as a template                      |
|         [help](/influxdb3/cloud-serverless/reference/cli/influx/help/)         |                          Help about any command                          |
|          [org](/influxdb3/cloud-serverless/reference/cli/influx/org/)          |                     Organization management commands                     |
|         [ping](/influxdb3/cloud-serverless/reference/cli/influx/ping/)         |                  Check the InfluxDB `/health` endpoint                   |
|        [query](/influxdb3/cloud-serverless/reference/cli/influx/query/)        |                           Execute a Flux query                           |
|      [restore](/influxdb3/cloud-serverless/reference/cli/influx/restore/)      |                Restore backup data *(InfluxDB OSS only)*                 |
|      [scripts](/influxdb3/cloud-serverless/reference/cli/influx/scripts)       |           Scripts management commands *(InfluxDB Cloud only)*            |
|       [secret](/influxdb3/cloud-serverless/reference/cli/influx/secret/)       |                              Manage secrets                              |
|        [setup](/influxdb3/cloud-serverless/reference/cli/influx/setup/)        |Create default username, password, org, bucket, etc. *(InfluxDB OSS only)*|
|       [stacks](/influxdb3/cloud-serverless/reference/cli/influx/stacks/)       |                          Manage InfluxDB stacks                          |
|         [task](/influxdb3/cloud-serverless/reference/cli/influx/task/)         |                         Task management commands                         |
|    [telegrafs](/influxdb3/cloud-serverless/reference/cli/influx/telegrafs/)    |                Telegraf configuration management commands                |
|     [template](/influxdb3/cloud-serverless/reference/cli/influx/template/)     |               Summarize and validate an InfluxDB template                |
|         [user](/influxdb3/cloud-serverless/reference/cli/influx/user/)         |                         User management commands                         |
|           [v1](/influxdb3/cloud-serverless/reference/cli/influx/v1/)           |                    Work with the v1 compatibility API                    |
|      [version](/influxdb3/cloud-serverless/reference/cli/influx/version/)      |                       Print the influx CLI version                       |
|        [write](/influxdb3/cloud-serverless/reference/cli/influx/write/)        |                         Write points to InfluxDB                         |

## Flags

|Flag|        |         Description         |
|----|--------|-----------------------------|
|`-h`|`--help`|Help for the `influx` command|

### Flag patterns and conventions

The `influx` CLI uses the following patterns and conventions:

* [Mapped environment variables](#mapped-environment-variables)
* [Shorthand and longhand flags](#shorthand-and-longhand-flags)
* [Flag input types](#flag-input-types)

#### Mapped environment variables

`influx` CLI flags mapped to environment variables are listed in the **Mapped to**column of the Flags table in each command documentation.
Mapped flags inherit the value of the environment variable.
To override environment variables, set the flag explicitly in your command.

[](#view-mapped-environment-variables)

View mapped environment variables

> [!Note]
> Some `influx` CLI commands may not support all mapped environment variables.
> For more information about what mapped environment variables each command supports,
> see the command documentation.

|  Environment variable  |                             Description                             |
|------------------------|---------------------------------------------------------------------|
| `INFLUX_ACTIVE_CONFIG` |                CLI configuration to use for commands                |
|   `INFLUX_BUCKET_ID`   |                              Bucket ID                              |
|  `INFLUX_BUCKET_NAME`  |                             Bucket name                             |
| `INFLUX_CONFIGS_PATH`  |Path to `influx` CLI configurations (default `~/.influxdbv2/configs`)|
| `INFLUX_HIDE_HEADERS`  |       Hide table headers in command output (default `false`)        |
|     `INFLUX_HOST`      |     HTTP address of InfluxDB (default `http://localhost:8086`)      |
|     `INFLUX_NAME`      |                          InfluxDB Username                          |
|      `INFLUX_ORG`      |                     InfluxDB Organization name                      |
|`INFLUX_ORG_DESCRIPTION`|                      Organization description                       |
|    `INFLUX_ORG_ID`     |                      InfluxDB Organization ID                       |
|  `INFLUX_OUTPUT_JSON`  |                     Return command output JSON                      |
|  `INFLUX_SKIP_VERIFY`  |                  Skip TLS certificate verification                  |
|     `INFLUX_TOKEN`     |                         InfluxDB API token                          |

#### Shorthand and longhand flags

Many `influx` CLI flags support both shorthand and longhand forms.

* **shorthand:** a shorthand flag begins with a single hyphen followed by a single letter (for example: `-c`).
* **longhand:** a longhand flag starts with two hyphens followed by a multi-letter,
  hyphen-spaced flag name (for example: `--active-config`).

Commands can use both shorthand and longhand flags in a single execution.

#### Flag input types

`influx` CLI flag input types are listed in each the table of flags for each command.
Flags support the following input types:

##### string

Text string, but the flag can be used **only once** per command execution.

##### stringArray

Single text string, but the flag can be used **multiple times** per command execution.

##### integer

Sequence of digits representing an integer value.

##### duration

Length of time represented by an integer and a duration unit
(`1ns`, `1us`, `1µs`, `1ms`, `1s`, `1m`, `1h`, `1d`, `1w`).
| Command | Description |
| --- | --- |
| Command | Description |
| apply | Apply an InfluxDB template |
| auth | API token management commands |
| backup | Back up data  (InfluxDB OSS only) |
| bucket | Bucket management commands |
| bucket-schema | Manage InfluxDB bucket schemas  (InfluxDB Cloud only) |
| completion | Generate completion scripts |
| config | Configuration management commands |
| dashboards | List dashboards |
| delete | Delete points from InfluxDB |
| export | Export resources as a template |
| help | Help about any command |
| org | Organization management commands |
| ping | Check the InfluxDB  /health  endpoint |
| query | Execute a Flux query |
| restore | Restore backup data  (InfluxDB OSS only) |
| scripts | Scripts management commands  (InfluxDB Cloud only) |
| secret | Manage secrets |
| setup | Create default username, password, org, bucket, etc.  (InfluxDB OSS only) |
| stacks | Manage InfluxDB stacks |
| task | Task management commands |
| telegrafs | Telegraf configuration management commands |
| template | Summarize and validate an InfluxDB template |
| user | User management commands |
| v1 | Work with the v1 compatibility API |
| version | Print the influx CLI version |
| write | Write points to InfluxDB |

| Flag |  | Description |
| --- | --- | --- |
| Flag |  | Description |
| -h | --help | Help for the  influx  command |

| Environment variable | Description |
| --- | --- |
| Environment variable | Description |
| INFLUX_ACTIVE_CONFIG | CLI configuration to use for commands |
| INFLUX_BUCKET_ID | Bucket ID |
| INFLUX_BUCKET_NAME | Bucket name |
| INFLUX_CONFIGS_PATH | Path to  influx  CLI configurations (default  ~/.influxdbv2/configs ) |
| INFLUX_HIDE_HEADERS | Hide table headers in command output (default  false ) |
| INFLUX_HOST | HTTP address of InfluxDB (default  http://localhost:8086 ) |
| INFLUX_NAME | InfluxDB Username |
| INFLUX_ORG | InfluxDB Organization name |
| INFLUX_ORG_DESCRIPTION | Organization description |
| INFLUX_ORG_ID | InfluxDB Organization ID |
| INFLUX_OUTPUT_JSON | Return command output JSON |
| INFLUX_SKIP_VERIFY | Skip TLS certificate verification |
| INFLUX_TOKEN | InfluxDB API token |
