Documentation

Set up InfluxDB

As you get started with this tutorial, do the following to make sure everything you need is in place.

  1. Optional: Download, install, and configure the influx CLI.

    The influx CLI provides a simple way to interact with InfluxDB from a command line. For detailed installation and setup instructions, see the influx CLI reference.

  2. Create an All Access API token.

    1. Go to cloud2.influxdata.com in a browser to log in and access the InfluxDB UI.

    2. Navigate to Load Data > API Tokens using the left navigation bar.

    3. Click + Generate API token and select All Access API Token.

    4. Enter a description for the API token and click Save.

    5. Copy the generated token and store it for safe keeping.

    We recommend using a password manager or a secret store to securely store sensitive tokens.

  3. Configure authentication credentials.

    As you go through this tutorial, interactions with InfluxDB Cloud Serverless require your InfluxDB URL or host, organization name or ID, and your API token. There are different methods for providing these credentials depending on which client you use to interact with InfluxDB.

    When configuring your token, if you created an all access token, use that token to interact with InfluxDB. Otherwise, use your operator token.

    When managing InfluxDB Cloud Serverless through the InfluxDB UI, authentication credentials are provided automatically using credentials associated with the user you log in with.

    There are three ways to provide authentication credentials to the influx CLI:

    Environment variables

    Command flags

    All influx CLI examples in this getting started tutorial assume your InfluxDB host, organization, and token are provided by either the active influx CLI configuration or by environment variables.

    Telegraf examples in this getting started tutorial assumes you assigned an INFLUX_TOKEN environment variable to your InfluxDB token.

    export INFLUX_TOKEN=
    API_TOKEN
    $env:INFLUX_TOKEN = "
    API_TOKEN
    "
    set INFLUX_TOKEN=
    API_TOKEN
    # Make sure to include a space character at the end of this command.

    Replace the following:

    • API_TOKEN: an InfluxDB API token with sufficient permissions to your bucket

    API (cURL and client library) examples in this getting started tutorial assume you have environment variables assigned to your InfluxDB credentials.

    To assign environment variables to your credentials, enter the following commands into your profile settings or terminal:

    export INFLUX_HOST=https://cloud2.influxdata.com
    export INFLUX_ORG=
    ORG_NAME
    export INFLUX_TOKEN=
    API_TOKEN
    $env:INFLUX_HOST = "https://cloud2.influxdata.com"
    $env:INFLUX_ORG = "
    ORG_NAME
    "
    $env:INFLUX_TOKEN = "
    API_TOKEN
    "
    set INFLUX_HOST=https://cloud2.influxdata.com
    set INFLUX_ORG=
    ORG_NAME
    set INFLUX_TOKEN=
    API_TOKEN
    # Make sure to include a space character at the end of this command.

    Replace the following:

    • ORG_NAME: your InfluxDB organization name
    • ORG_ID: your InfluxDB organization ID
    • API_TOKEN: an InfluxDB API token with sufficient permissions to your bucket

    Keep the following in mind when using API clients and client libraries:

    • InfluxDB ignores org and org_id parameters in API write and query requests, but some clients still require the parameters.
    • Some clients use host to refer to your hostname, your InfluxDB Cloud Serverless region URL without https://.

    All API, cURL, and client library examples in this getting started tutorial assume your InfluxDB host, organization, url, and token are provided by environment variables.

  4. Optional: Create a bucket.

    You can use an existing bucket or create a new one specifically for this getting started tutorial. All examples in this tutorial assume a bucket named “get-started”.

    Use the InfluxDB UI, influx CLI, or InfluxDB API to create a bucket.

    1. Go to cloud2.influxdata.com in a browser to log in and access the InfluxDB UI.

    2. Navigate to Load Data > Buckets using the left navigation bar.

    1. Click + Create bucket.

    2. Provide a bucket name (get-started) and select a retention period. Supported retention periods depend on your InfluxDB Cloud Serverless plan.

    3. Click Create.

    1. If you haven’t already, download, install, and configure the influx CLI.

    2. Use the influx bucket create command to create a new bucket.

      Provide the following:

      • -n, --name flag with the bucket name.
      • -r, --retention flag with the bucket’s retention period duration. Supported retention periods depend on your InfluxDB Cloud Serverless plan.
      • Connection and authentication credentials
    influx bucket create \
      --name 
    get-started
    \
    --retention
    7d

    To create a bucket using the InfluxDB HTTP API, send a request to the InfluxDB API /api/v2/buckets endpoint using the POST request method.

    POST https://cloud2.influxdata.com/api/v2/buckets

    Include the following with your request:

    • Headers:
      • Authorization: Token INFLUX_TOKEN
      • Content-Type: application/json
    • Request body: JSON object with the following properties:
      • org: InfluxDB organization name
      • name: Bucket name
      • retentionRules: List of retention rule objects that define the bucket’s retention period. Each retention rule object has the following properties:
        • type: "expire"
        • everySeconds: Retention period duration in seconds. Supported retention periods depend on your InfluxDB Cloud Serverless plan.
    curl --request POST \
    "https://cloud2.influxdata.com/api/v2/buckets" \
      --header "Authorization: Token 
    $INFLUX_TOKEN
    " \
    --header "Content-Type: application/json" \ --data '{ "orgID": "'"
    $INFLUX_ORG_ID
    "'",
    "name": "
    get-started
    ",
    "retentionRules": [ { "type": "expire", "everySeconds": 604800 } ] }'

Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.5

Key enhancements in InfluxDB 3.5 and the InfluxDB 3 Explorer 1.3.

See the Blog Post

InfluxDB 3.5 is now available for both Core and Enterprise, introducing custom plugin repository support, enhanced operational visibility with queryable CLI parameters and manual node management, stronger security controls, and general performance improvements.

InfluxDB 3 Explorer 1.3 brings powerful new capabilities including Dashboards (beta) for saving and organizing your favorite queries, and cache querying for instant access to Last Value and Distinct Value caches—making Explorer a more comprehensive workspace for time series monitoring and analysis.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On November 3, 2025, 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

InfluxDB Cloud Serverless