Documentation

Install InfluxDB OSS v2

The InfluxDB v2 time series platform is purpose-built to collect, store, process and visualize metrics and events.

Download and install InfluxDB v2

Recommended:: Before you open and install packages and downloaded files, use SHA checksum verification and GPG signature verification to ensure the files are intact and authentic.

InfluxDB installation instructions for some OS versions include steps to verify downloaded files before you install them.

For more information about SHA and GPG verifications, see the following:

Choose the InfluxData key-pair for your OS version

Verify download integrity using SHA-256

Verify file integrity and authenticity using GPG

The following instructions include steps for downloading, verifying, and installing InfluxDB:

Install and set up InfluxDB in a container

The following steps show how to use the Docker CLI to set up and run InfluxDB. but you can also use Docker Compose.

The following guide uses Docker mounted volumes to persist InfluxDB configuration and data. Persisting your data to a file system outside the container ensures that your data isn’t deleted if you delete the container.

  1. Install Docker Desktop for your system.

  2. Start a Docker container from the influxdb Docker Hub image–for example, in your terminal, enter the docker run influxdb:2 command with command line flags for initial setup options and file system mounts.

If you don’t specify InfluxDB initial setup options, you can set up manually later using the UI or CLI in a running container.

docker run \
 --name influxdb2 \
 --publish 8086:8086 \
 --mount type=volume,source=influxdb2-data,target=/var/lib/influxdb2 \
 --mount type=volume,source=influxdb2-config,target=/etc/influxdb2 \
 --env DOCKER_INFLUXDB_INIT_MODE=setup \
 --env DOCKER_INFLUXDB_INIT_USERNAME=
ADMIN_USERNAME
\
--env DOCKER_INFLUXDB_INIT_PASSWORD=
ADMIN_PASSWORD
\
--env DOCKER_INFLUXDB_INIT_ORG=
ORG_NAME
\
--env DOCKER_INFLUXDB_INIT_BUCKET=
BUCKET_NAME
\
influxdb:2
  • Copy
  • Fill window

The command passes the following arguments:

  • --publish 8086:8086: Exposes the InfluxDB UI and HTTP API on the host’s 8086 port.

  • --mount type=volume,source=influxdb2-data,target=/var/lib/influxdb2: Creates a volume named influxdb2-data mapped to the InfluxDB data directory to persist data outside the container.

  • --mount type=volume,source=influxdb2-config,target=/etc/influxdb2: Creates a volume named influxdb2-config mapped to the InfluxDB configuration directory to make configurations available outside the container.

  • --env DOCKER_INFLUXDB_INIT_MODE=setup: Environment variable that invokes the automated setup of the initial organization, user, bucket, and token when creating the container.

  • --env DOCKER_INFLUXDB_INIT_<SETUP_OPTION>: Environment variables for initial setup options–replace the following with your own values:

    • ADMIN_USERNAME: The username for the initial user–an admin user with an API Operator token.
    • ADMIN_PASSWORD: The password for the initial user.
    • ORG_NAME: The name for the initial organization.
    • BUCKET_NAME: The name for the initial bucket.

If successful, the command starts InfluxDB initialized with the user, organization, bucket, and Operator token, and logs to stdout.

You can view the Operator token in the /etc/influxdb2/influx-configs file and use it to authorize creating an All Access token.

To run the InfluxDB container in detached mode, include the --detach flag in the docker run command.

For more InfluxDB configuration options, see the influxdb Docker Hub image documentation.

Run InfluxDB CLI commands in a container

When you start a container using the influxdb Docker Hub image, it also installs the influx CLI in the container. With InfluxDB setup and running in the container, you can use the Docker CLI docker exec command to interact with the influx and influxd CLIs inside the container.

Syntax

docker exec -it <CONTAINER_NAME> <CLI_NAME> <COMMAND>`
  • Copy
  • Fill window

Examples

# List CLI configurations
docker exec -it influxdb2 influx config ls
  • Copy
  • Fill window
# View the server configuration
docker exec -it influxdb2 influx server-config
# Inspect server details
docker exec -it influxdb2 influxd inspect -d
  • Copy
  • Fill window

Manage files in mounted volumes

To copy files, such as the InfluxDB server config.yml file, between your local file system and a volume, use the docker container cp command.

Start InfluxDB

If it isn’t already running, follow the instructions to start InfluxDB on your system:

To use the Docker CLI to start an existing container, enter the following command:

docker start influxdb2
  • Copy
  • Fill window

Replace influxdb2 with the name of your container.

To start a new container, follow instructions to install and set up InfluxDB in a container.

If successful, you can view the InfluxDB UI at http://localhost:8086.

InfluxDB starts with default settings, including the following:

  • http-bind-address=:8086: Uses port 8086 (TCP) for InfluxDB UI and HTTP API client-server communication.
  • reporting-disabled=false: Sends InfluxDB telemetry information back to InfluxData.

To override default settings, specify configuration options when starting InfluxDB–for example:

Configure the port or address

Opt-out of telemetry reporting

For information about InfluxDB v2 default settings and how to override them, see InfluxDB configuration options.

With InfluxDB installed and initialized, get started writing and querying data.

Download, install, and configure the influx CLI

Recommended:: Install the influx CLI, which provides a simple way to interact with InfluxDB from a command line. For detailed installation and setup instructions, see Use the influx CLI.

InfluxDB and the influx CLI are separate packages

The InfluxDB server (influxd) and the influx CLI are packaged and versioned separately. Some install methods (for example, the InfluxDB Docker Hub image) include both.


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

InfluxDB 3 Core and Enterprise are now in Beta

InfluxDB 3 Core and Enterprise are now available for beta testing, available under MIT or Apache 2 license.

InfluxDB 3 Core is a high-speed, recent-data engine that collects and processes data in real-time, while persisting it to local disk or object storage. InfluxDB 3 Enterprise is a commercial product that builds on Core’s foundation, adding high availability, read replicas, enhanced security, and data compaction for faster queries. A free tier of InfluxDB 3 Enterprise will also be available for at-home, non-commercial use for hobbyists to get the full historical time series database set of capabilities.

For more information, check out: