Documentation

influxdb3 create token --admin

Create an operator token or named admin token.

Usage

influxdb3 create token --admin [OPTIONS]

Options

OptionDescription
--regenerateRegenerates the operator token. Requires --token and the current operator token
--nameName of the token
--expiryExpires in duration–for example, 10d for 10 days 1y for 1 year
--hostThe host URL of the running InfluxDB 3 server [env: INFLUXDB3_HOST_URL=] [default: http://127.0.0.1:8181]
--tokenAn existing admin token for the InfluxDB 3 server
--tls-caAn optional arg to use a custom ca for useful for testing with self signed certs
--formatOutput format for token [possible values: json, text]
--offlineGenerate token without connecting to server (for automation)
--output-fileFile path to save the token (required with --offline)
-h, --helpPrint help information
--help-allPrint more detailed help information

Examples

Create an operator token

The operator token is a special token that has full administrative privileges on the InfluxDB server and doesn’t expire. The first admin token you create becomes the operator token for the instance. You can create an operator token using the --admin flag without any additional options.

influxdb3 create token --admin

The output is the raw token string you can use to authenticate future CLI commands and API requests. For CLI commands, use the --token option or the INFLUXDB3_AUTH_TOKEN environment variable to pass the token string.

Use the operator token to create a named admin token

influxdb3 create token \
  --admin \
  --token 
OPERATOR_TOKEN
\
--name
TOKEN_NAME
\
--expiry DURATION

Replace the following:

  • OPERATOR_TOKEN: Your operator token for the server
  • TOKEN_NAME: Name for your new admin token
  • DURATION: Duration for the token to remain valid, in humantime format (for example, 10d for 10 days or 1y for 1 year).

Use the token to create a database

influxdb3 create database \
  --token ADMIN_TOKEN \
  
DATABASE_NAME

Replace the following:

  • ADMIN_TOKEN: Your InfluxDB admin token
  • DATABASE_NAME: Name for your new database

Use CLI environment variables

Set the token as an environment variable to simplify repeated CLI commands:

export INFLUXDB3_AUTH_TOKEN=ADMIN_TOKEN

Generate an offline admin token

Generate an offline admin token file to use if no tokens exist when the server starts. Once started, you can interact with the server using the provided token. Offline admin tokens are designed to help with automated deployments.

Include the following options:

  • --offline (Required)
  • --output-file (Required)
  • --name (default is _admin)
  • --expiry (Optional)
influxdb3 create token --admin \
  --name 
TOKEN_NAME
\
--expiry
DURATION
\
--offline \ --output-file
path/to/admin-token.json

Replace the following:

  • TOKEN_NAME: Name for your offline admin token
  • DURATION: Duration for the token to remain valid, in humantime format (for example, 10d for 10 days or 1y for 1 year).
  • path/to/admin-token.json: File path to use for the generated token file

View example offline admin token file


Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.7

Key enhancements in InfluxDB 3.7 and the InfluxDB 3 Explorer 1.5.

See the Blog Post

InfluxDB 3.7 is now available for both Core and Enterprise, landing alongside version 1.5 of the InfluxDB 3 Explorer UI. This release focuses on giving developers faster visibility into what their system is doing with one-click monitoring, a streamlined installation pathway, and broader updates that simplify day-to-day operations.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On February 3, 2026, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2