Install InfluxDB

The InfluxDB 2.2 time series platform is purpose-built to collect, store, process and visualize metrics and events. Download, install, and set up InfluxDB OSS.

macOS Linux Windows Docker Kubernetes Raspberry Pi

Install InfluxDB v2.2

Do one of the following:

InfluxDB and the influx CLI are separate packages

The InfluxDB server (influxd) and the influx CLI are packaged and versioned separately. For information about installing the influx CLI, see Install and use the influx CLI.

Use Homebrew

We recommend using Homebrew to install InfluxDB v2.2 on macOS:

  1. brew update
  2. brew install influxdb

Homebrew also installs influx-cli as a dependency. For information about using the influx CLI, see the influx CLI reference documentation.

Manually download and install

To download the InfluxDB v2.2 binaries for macOS directly, do the following:

  1. Download the InfluxDB package.

    InfluxDB v2.2 (macOS)

  2. Unpackage the InfluxDB binary.

    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:
    1. # Unpackage contents to the current working directory
    2. tar zxvf ~/Downloads/influxdb2-2.2.0-darwin-amd64.tar.gz
  3. (Optional) Place the binary in your $PATH

    1. # (Optional) Copy the influxd binary to your $PATH
    2. sudo cp influxdb2-2.2.0-darwin-amd64/influxd /usr/local/bin/

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

Recommended – Verify the authenticity of downloaded binary

For added security, use gpg to verify the signature of your download. (Most operating systems include the gpg command by default. If gpg is not available, see the GnuPG homepage for installation instructions.)

  1. Download and import InfluxData’s public key:

    1. curl -s https://repos.influxdata.com/influxdb2.key | gpg --import -
  2. Download the signature file for the release by adding .asc to the download URL. For example:

    1. wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-darwin-amd64.tar.gz.asc
  3. Verify the signature with gpg --verify:

    1. gpg --verify influxdb2-2.2.0-darwin-amd64.tar.gz.asc influxdb2-2.2.0-darwin-amd64.tar.gz

    The output from this command should include the following:

    1. gpg: Good signature from "InfluxData <support@influxdata.com>" [unknown]

Both InfluxDB 1.x and 2.x have associated influxd and influx binaries. If InfluxDB 1.x binaries are already in your $PATH, run the 2.2 binaries in place or rename them before putting them in your $PATH. If you rename the binaries, all references to influxd and influx in this documentation refer to your renamed binaries.

Networking ports

By default, InfluxDB uses TCP port 8086 for client-server communication over the InfluxDB HTTP API.

Start InfluxDB

Start InfluxDB by running the influxd daemon:

  1. influxd

Run InfluxDB on macOS Catalina

macOS Catalina requires downloaded binaries to be signed by registered Apple developers. Currently, when you first attempt to run influxd, macOS will prevent it from running. To manually authorize the influxd binary:

  1. Attempt to run influxd.
  2. Open System Preferences and click Security & Privacy.
  3. Under the General tab, there is a message about influxd being blocked. Click Open Anyway.

We are in the process of updating our build process to ensure released binaries are signed by InfluxData.

“too many open files” errors

After running influxd, you might see an error in the log output like the following:

  1. too many open files

To resolve this error, follow the recommended steps to increase file and process limits for your operating system version then restart influxd.

See the influxd documentation for information about available flags and options.

InfluxDB “phone home”

By default, InfluxDB sends telemetry data back to InfluxData. The InfluxData telemetry page provides information about what data is collected and how it is used.

To opt-out of sending telemetry data back to InfluxData, include the --reporting-disabled flag when starting influxd.

  1. influxd --reporting-disabled

Download and install InfluxDB v2.2

Do one of the following:

InfluxDB and the influx CLI are separate packages

The InfluxDB server (influxd) and the influx CLI are packaged and versioned separately. For information about installing the influx CLI, see Install and use the influx CLI.

Install InfluxDB as a service with systemd

  1. Download and install the appropriate .deb or .rpm file using a URL from the InfluxData downloads page with the following commands:

    1. # Ubuntu/Debian
    2. wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-xxx.deb
    3. sudo dpkg -i influxdb2-2.2.0-xxx.deb
    4. # Red Hat/CentOS/Fedora
    5. wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-xxx.rpm
    6. sudo yum localinstall influxdb2-2.2.0-xxx.rpm

    Use the exact filename of the download of .rpm package (for example, influxdb2-2.2.0-amd64.rpm).

  2. Start the InfluxDB service:

    1. sudo service influxdb start

    Installing the InfluxDB package creates a service file at /lib/systemd/services/influxdb.service to start InfluxDB as a background service on startup.

  3. Restart your system and verify that the service is running correctly:

    1. $ sudo service influxdb status
    2. influxdb.service - InfluxDB is an open-source, distributed, time series database
    3. Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enable>
    4. Active: active (running)

For information about where InfluxDB stores data on disk when running as a service, see File system layout.

To customize your InfluxDB configuration, use either command line flags (arguments), environment variables, or an InfluxDB configuration file. See InfluxDB configuration options for more information.

Pass arguments to systemd

  1. Add one or more lines like the following containing arguments for influxd to /etc/default/influxdb2:

    1. ARG1="--http-bind-address :8087"
    2. ARG2="<another argument here>"
  2. Edit the /lib/systemd/system/influxdb.service file as follows:

    1. ExecStart=/usr/bin/influxd $ARG1 $ARG2

Manually download and install the influxd binary

  1. Download the InfluxDB binary.

    Download the InfluxDB binary from your browser or from the command line.

    Download from your browser

    InfluxDB v2.2 (amd64) InfluxDB v2.2 (arm)

    Download from the command line

    1. # amd64
    2. wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-linux-amd64.tar.gz
    3. # arm
    4. wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-linux-arm64.tar.gz
  2. Extract the downloaded binary.

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

    1. # amd64
    2. tar xvzf path/to/influxdb2-2.2.0-linux-amd64.tar.gz
    3. # arm
    4. tar xvzf path/to/influxdb2-2.2.0-linux-arm64.tar.gz
  3. (Optional) Place the extracted influxd executable binary in your system $PATH.

    1. # amd64
    2. sudo cp influxdb2-2.2.0-linux-amd64/influxd /usr/local/bin/
    3. # arm
    4. sudo cp influxdb2-2.2.0-linux-arm64/influxd /usr/local/bin/

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

Recommended – Verify the authenticity of downloaded binary

For added security, use gpg to verify the signature of your download. (Most operating systems include the gpg command by default. If gpg is not available, see the GnuPG homepage for installation instructions.)

  1. Download and import InfluxData’s public key:

    1. curl -s https://repos.influxdata.com/influxdb2.key | gpg --import -
  2. Download the signature file for the release by adding .asc to the download URL. For example:

    1. wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-linux-amd64.tar.gz.asc
  3. Verify the signature with gpg --verify:

    1. gpg --verify influxdb2-2.2.0-linux-amd64.tar.gz.asc influxdb2-2.2.0-linux-amd64.tar.gz

    The output from this command should include the following:

    1. gpg: Good signature from "InfluxData <support@influxdata.com>" [unknown]

Start InfluxDB

If InfluxDB was installed as a systemd service, systemd manages the influxd daemon and no further action is required. If the binary was manually downloaded and added to the system $PATH, start the influxd daemon with the following command:

  1. influxd

See the influxd documentation for information about available flags and options.

Networking ports

By default, InfluxDB uses TCP port 8086 for client-server communication over the InfluxDB HTTP API.

InfluxDB “phone home”

By default, InfluxDB sends telemetry data back to InfluxData. The InfluxData telemetry page provides information about what data is collected and how it is used.

To opt-out of sending telemetry data back to InfluxData, include the --reporting-disabled flag when starting influxd.

  1. influxd --reporting-disabled

System requirements

Command line examples

Use Powershell or WSL to execute influx and influxd commands. The command line examples in this documentation use influx and influxd as if installed on the system PATH. If these binaries are not installed on your PATH, replace influx and influxd in the provided examples with ./influx and ./influxd respectively.

Download and install InfluxDB v2.2

InfluxDB and the influx CLI are separate packages

The InfluxDB server (influxd) and the influx CLI are packaged and versioned separately. For information about installing the influx CLI, see Install and use the influx CLI.

InfluxDB v2.2 (Windows)

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

  1. > Expand-Archive .\influxdb2-2.2.0-windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\'
  2. > mv 'C:\Program Files\InfluxData\influxdb2-2.2.0-windows-amd64' 'C:\Program Files\InfluxData\influxdb'

Networking ports

By default, InfluxDB uses TCP port 8086 for client-server communication over the InfluxDB HTTP API.

Start InfluxDB

In Powershell, navigate into C:\Program Files\InfluxData\influxdb and start InfluxDB by running the influxd daemon:

  1. > cd -Path 'C:\Program Files\InfluxData\influxdb'
  2. > ./influxd

See the influxd documentation for information about available flags and options.

Grant network access

When starting InfluxDB for the first time, Windows Defender will appear with the following message:

Windows Defender Firewall has blocked some features of this app.

  1. Select Private networks, such as my home or work network.
  2. Click Allow access.

InfluxDB “phone home”

By default, InfluxDB sends telemetry data back to InfluxData. The InfluxData telemetry page provides information about what data is collected and how it is used.

To opt-out of sending telemetry data back to InfluxData, include the --reporting-disabled flag when starting influxd.

  1. ./influxd --reporting-disabled

Download and run InfluxDB v2.2

Use docker run to download and run the InfluxDB v2.2 Docker image. Expose port 8086, which InfluxDB uses for client-server communication over the InfluxDB HTTP API.

  1. docker run --name influxdb -p 8086:8086 influxdb:2.2.0

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

Persist data outside the InfluxDB container

  1. Create a new directory to store your data in and navigate into the directory.

    1. mkdir path/to/influxdb-docker-data-volume && cd $_
  2. From within your new directory, run the InfluxDB Docker container with the --volume flag to persist data from /var/lib/influxdb2 inside the container to the current working directory in the host file system.

    1. docker run \
    2. --name influxdb \
    3. -p 8086:8086 \
    4. --volume $PWD:/var/lib/influxdb2 \
    5. influxdb:2.2.0

Configure InfluxDB with Docker

To mount an InfluxDB configuration file and use it from within Docker:

  1. Persist data outside the InfluxDB container.

  2. Use the command below to generate the default configuration file on the host file system:

    1. docker run \
    2. --rm influxdb:2.2.0 \
    3. influxd print-config > config.yml
  3. Modify the default configuration, which will now be available under $PWD.

  4. Start the InfluxDB container:

    1. docker run -p 8086:8086 \
    2. -v $PWD/config.yml:/etc/influxdb2/config.yml \
    3. influxdb:2.2.0

(Find more about configuring InfluxDB here.)

Open a shell in the InfluxDB container

To use the influx command line interface, open a shell in the influxdb Docker container:

  1. docker exec -it influxdb /bin/bash

InfluxDB “phone home”

By default, InfluxDB sends telemetry data back to InfluxData. The InfluxData telemetry page provides information about what data is collected and how it is used.

To opt-out of sending telemetry data back to InfluxData, include the --reporting-disabled flag when starting the InfluxDB container.

  1. docker run -p 8086:8086 influxdb:2.2.0 --reporting-disabled

Install InfluxDB in a Kubernetes cluster

The instructions below use minikube or kind, but the steps should be similar in any Kubernetes cluster. InfluxData also makes Helm charts available.

  1. Install minikube or kind.

  2. Start a local cluster:

    1. # with minikube
    2. minikube start
    3. # with kind
    4. kind create cluster
  3. Apply the sample InfluxDB configuration by running:

    1. kubectl apply -f https://raw.githubusercontent.com/influxdata/docs-v2/master/static/downloads/influxdb-k8-minikube.yaml

    This creates an influxdb Namespace, Service, and StatefulSet. A PersistentVolumeClaim is also created to store data written to InfluxDB.

    Important: Always inspect YAML manifests before running kubectl apply -f <url>!

  4. Ensure the Pod is running:

    1. kubectl get pods -n influxdb
  5. Ensure the Service is available:

    1. kubectl describe service -n influxdb influxdb

    You should see an IP address after Endpoints in the command’s output.

  6. Forward port 8086 from inside the cluster to localhost:

    1. kubectl port-forward -n influxdb service/influxdb 8086:8086

Install InfluxDB v2.2 on Raspberry Pi

Requirements

To run InfluxDB on Raspberry Pi, you need:

  • a Raspberry Pi 4+ or 400
  • a 64-bit operating system. We recommend installing a 64-bit version of Ubuntu of Ubuntu Desktop or Ubuntu Server compatible with 64-bit Raspberry Pi.

Install Linux binaries

Follow the Linux installation instructions to install InfluxDB on a Raspberry Pi.

Monitor your Raspberry Pi

Use the InfluxDB Raspberry Pi template to easily configure collecting and visualizing system metrics for the Raspberry Pi.

Monitor 32-bit Raspberry Pi systems

If you have a 32-bit Raspberry Pi, use Telegraf to collect and send data to:

  • InfluxDB OSS, running on a 64-bit system
  • InfluxDB Cloud with a Free Tier account
  • InfluxDB Cloud with a paid Usage-Based account with relaxed resource restrictions.

Download and install the influx CLI

The influx CLI lets you manage InfluxDB from your command line.

Download and install the influx CLI

Set up InfluxDB

The initial setup process for InfluxDB walks through creating a default organization, user, bucket, and Operator API token. The setup process is available in both the InfluxDB user interface (UI) and in the influx command line interface (CLI).

Operator token permissions

The Operator token created in the InfluxDB setup process has full read and write access to all organizations in the database. To prevent accidental interactions across organizations, we recommend creating an All-Access token for each organization and using those to manage InfluxDB.

UI Setup CLI Setup

Set up InfluxDB through the UI

  1. With InfluxDB running, visit localhost:8086.
  2. Click Get Started

Set up your initial user

  1. Enter a Username for your initial user.
  2. Enter a Password and Confirm Password for your user.
  3. Enter your initial Organization Name.
  4. Enter your initial Bucket Name.
  5. Click Continue.

InfluxDB is now initialized with a primary user, organization, and bucket. You are ready to write or collect data.

(Optional) Set up and use the influx CLI

To avoid having to pass your InfluxDB API token with each influx command, set up a configuration profile to store your credentials. To do this, complete the following steps:

  1. In a terminal, run the following command:

    1. # Set up a configuration profile
    2. influx config create -n default \
    3. -u http://localhost:8086 \
    4. -o example-org \
    5. -t mySuP3rS3cr3tT0keN \
    6. -a

    This configures a new profile named default and makes the profile active so your influx CLI commands run against the specified InfluxDB instance. For more detail, see influx config.

  2. Learn influx CLI commands. To see all available influx commands, type influx -h or check out influx - InfluxDB command line interface.

Set up InfluxDB through the influx CLI

Begin the InfluxDB setup process via the influx CLI by running:

  1. influx setup
  1. Enter a primary username.
  2. Enter a password for your user.
  3. Confirm your password by entering it again.
  4. Enter a name for your primary organization.
  5. Enter a name for your primary bucket.
  6. Enter a retention period for your primary bucket—valid units are nanoseconds (ns), microseconds (us or µs), milliseconds (ms), seconds (s), minutes (m), hours (h), days (d), and weeks (w). Enter nothing for an infinite retention period.
  7. Confirm the details for your primary user, organization, and bucket.

InfluxDB is now initialized with a primary user, organization, bucket, and API token. InfluxDB also creates a configuration profile for you so that you don’t have to add your InfluxDB host, organization, and token to every command. To view that config profile, use the influx config list command.

To continue to use InfluxDB via the CLI, you need the API token created during setup. To view the token, log into the UI with the credentials created above. (For instructions, see View tokens in the InfluxDB UI.)

You are ready to write or collect data.

To automate the setup process, use flags to provide the required information.

After you’ve installed InfluxDB, you’re ready to get started working with your data in InfluxDB.