Install InfluxDB
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:
The following instructions include steps for downloading, verifying, and installing InfluxDB:
To install InfluxDB, do one of the following:
We recommend using Homebrew to install InfluxDB v2 on macOS.
InfluxDB and the influx CLI are separate packages
The InfluxDB server (influxd
) and the
influx
CLI are packaged and
versioned separately.
You’ll install the influx CLI
in a later step.
Install using Homebrew
brew update
brew install influxdb
Manually download and install for macOS
In your browser or your terminal, download the InfluxDB package.
# Download using cURL curl --location -O \ "https://download.influxdata.com/influxdb/releases/influxdb2-2.7.11_darwin_amd64.tar.gz"
Recommended:: Verify the integrity of the download–for example, enter the following command in your terminal:
# Use 2 spaces to separate the checksum from the filename
echo "964e1de641a43a0e1743aa5ead243e935a05631ba0bc570fb8bff486542173c1 influxdb2-2.7.11_darwin_amd64.tar.gz" \
| shasum --algorithm 256 --quiet --check -
Replace the following:
964e1de641a43a0e1743aa5ead243e935a05631ba0bc570fb8bff486542173c1
: the SHA checksum from the downloads page
Unpackage the InfluxDB binary.
Do one of the following:
- In Finder, double-click the downloaded package file.
- In your terminal (for example, Terminal or iTerm2), use
tar
to unpackage the file–for example, enter the following command to extract it into the current directory:
# Unpackage contents to the current working directory tar zxvf ./influxdb2-2.7.11_darwin_amd64.tar.gz
Optional: Place the
influxd
binary in your$PATH
–for example, copy the binary to/usr/local/bin
:# (Optional) Copy the influxd binary to your $PATH sudo cp influxdb2-2.7.11/influxd /usr/local/bin/
With the
influxd
binary in your$PATH
(/usr/local/bin
), you can enterinfluxd
in your terminal to start the server.If you choose not to move the
influxd
binary into your$PATH
, enter the path to the binary to start the server–for example:./influxdb2-2.7.11/influxd
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 v2 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.
To install InfluxDB on Linux, 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.
You’ll install the influx CLI
in a later step.
Install InfluxDB as a service with systemd
Run the command for your OS version to install the InfluxData key, add the InfluxData repository, and install
influxdb
.Before running the command, replace the checksum and key filename with the key-pair from the preceding step.
# Ubuntu and Debian # Add the InfluxData key to verify downloads and add the repository curl --silent --location -O \ https://repos.influxdata.com/influxdata-archive.key echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \ | sha256sum --check - && cat influxdata-archive.key \ | gpg --dearmor \ | tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null \ && echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \ | tee /etc/apt/sources.list.d/influxdata.list # Install influxdb sudo apt-get update && sudo apt-get install influxdb2
# RedHat and CentOS # Add the InfluxData key to verify downloads curl --silent --location -O \ https://repos.influxdata.com/influxdata-archive.key \ && echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \ | sha256sum --check - && cat influxdata-archive.key \ | gpg --dearmor \ | tee /etc/pki/rpm-gpg/RPM-GPG-KEY-influxdata > /dev/null # Add the InfluxData repository to the repository list. cat <<EOF | tee /etc/yum.repos.d/influxdata.repo [influxdata] name = InfluxData Repository - Stable baseurl = https://repos.influxdata.com/stable/${basearch}/main enabled = 1 gpgcheck = 1 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-influxdata EOF # Install influxdb sudo yum install influxdb2
Start the InfluxDB service:
sudo service influxdb start
Installing the InfluxDB package creates a service file at
/lib/systemd/system/influxdb.service
to start InfluxDB as a background service on startup.To verify that the service is running correctly, restart your system and then enter the following command in your terminal:
sudo service influxdb status
If successful, the output is the following:
● influxdb.service - InfluxDB is an open-source, distributed, time series database Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enable> Active: active (running)
For information about where InfluxDB stores data on disk when running as a service, see File system layout.
Pass configuration options to the service
You can use systemd to customize InfluxDB configuration options and pass them to the InfluxDB service.
Edit the
/etc/default/influxdb2
service configuration file to assign configuration directives toinfluxd
command line flags–for example, add one or more<ENV_VARIABLE_NAME>=<COMMAND_LINE_FLAG>
lines like the following:ARG1="--http-bind-address :8087" ARG2="--storage-wal-fsync-delay=15m"
Edit the
/lib/systemd/system/influxdb.service
file to pass the variables to theExecStart
value:ExecStart=/usr/bin/influxd $ARG1 $ARG2
Manually download and install the influxd binary
If necessary, adjust the example file paths and utilities for your system.
In your browser or your terminal, download the InfluxDB binary for your system architecture (AMD64 or ARM).
InfluxDB v2 (amd64) InfluxDB v2 (arm)
# Use curl to download the amd64 binary. curl --location -O \ https://download.influxdata.com/influxdb/releases/influxdb2-2.7.11_linux_amd64.tar.gz
# Use curl to download the arm64 binary. curl --location -O \ https://download.influxdata.com/influxdb/releases/influxdb2-2.7.11_linux_arm64.tar.gz
Recommended:: Verify the authenticity of the downloaded binary–for example, enter the following command in your terminal.
Before running the command for your system, replace
https://repos.influxdata.com/influxdata-archive.key
with the key URL from the preceding step.# amd64 # Download and import the key curl --silent --location https://repos.influxdata.com/influxdata-archive.key \ | gpg --import - 2>&1 \ | grep 'InfluxData Package Signing Key <support@influxdata.com>' \ && # Download and verify the binary's signature file curl --silent --location "https://download.influxdata.com/influxdb/releases/influxdb2-2.7.11_linux_amd64.tar.gz.asc" \ | gpg --verify - influxdb2-2.7.11_linux_amd64.tar.gz \ 2>&1 | grep 'InfluxData Package Signing Key <support@influxdata.com>'
# arm64 # Download and import the key curl --silent --location https://repos.influxdata.com/influxdata-archive.key \ | gpg --import - 2>&1 \ | grep 'InfluxData Package Signing Key <support@influxdata.com>' \ && # Download and verify the binary's signature file curl --silent --location "https://download.influxdata.com/influxdb/releases/influxdb2-2.7.11_linux_arm64.tar.gz.asc" \ | gpg --verify - influxdb2-2.7.11_linux_arm64.tar.gz \ 2>&1 | grep 'InfluxData Package Signing Key <support@influxdata.com>'
If successful, the output is similar to the following:
gpg: Good signature from "InfluxData Package Signing Key <support@influxdata.com>" [unknown]
Extract the downloaded binary–for example, enter the following command for your system:
# amd64 tar xvzf ./influxdb2-2.7.11_linux_amd64.tar.gz
# arm64 tar xvzf ./influxdb2-2.7.11_linux_arm64.tar.gz
Optional: Place the extracted
influxd
executable binary in your system$PATH
.# amd64 sudo cp ./influxdb2-2.7.11/usr/bin/influxd /usr/local/bin/
# arm64 sudo cp ./influxdb2-2.7.11/usr/bin/influxd /usr/local/bin/
If you choose to not move the
influxd
binary into your$PATH
, enter the path to the binary to start the server–for example:./influxdb2-2.7.11/usr/bin/influxd
System requirements
- Windows 10
- 64-bit AMD architecture
- Powershell or Windows Subsystem for Linux (WSL)
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.
InfluxDB and the influx CLI are separate packages
The InfluxDB server (influxd
) and the
influx
CLI are packaged and
versioned separately.
You’ll install the influx CLI
in a later step.
Expand the downloaded archive into C:\Program Files\InfluxData\
and rename the
files if desired.
Expand-Archive .\influxdb2-2.7.11-windows.zip -DestinationPath 'C:\Program Files\InfluxData\'
mv 'C:\Program Files\InfluxData\influxdb2-2.7.11' 'C:\Program Files\InfluxData\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.
Install Docker Desktop for your system.
Start a Docker container from the
influxdb
Docker Hub image–for example, in your terminal, enter thedocker 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
The command passes the following arguments:
--publish 8086:8086
: Exposes the InfluxDB UI and HTTP API on the host’s8086
port.--mount type=volume,source=influxdb2-data,target=/var/lib/influxdb2
: Creates a volume namedinfluxdb2-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 namedinfluxdb2-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>`
Examples
# List CLI configurations
docker exec -it influxdb2 influx config ls
# View the server configuration
docker exec -it influxdb2 influx server-config
# Inspect server details
docker exec -it influxdb2 influxd inspect -d
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.
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.
Start a local cluster:
# with minikube minikube start
# with kind kind create cluster
Apply the sample InfluxDB configuration by running:
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>
!Ensure the Pod is running:
kubectl get pods -n influxdb
Ensure the Service is available:
kubectl describe service -n influxdb influxdb
You should see an IP address after
Endpoints
in the command’s output.Forward port 8086 from inside the cluster to localhost:
kubectl port-forward -n influxdb service/influxdb 8086:8086
Requirements
To run InfluxDB on Raspberry Pi, you need:
- a Raspberry Pi 4+ or 400
- a 64-bit operating system. Recommended:: 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.
Start InfluxDB
If it isn’t already running, follow the instructions to start InfluxDB on your system:
To start InfluxDB, run the influxd
daemon:
influxd
(macOS Catalina and newer) Authorize the influxd binary
macOS 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, follow the instructions for your macOS version to allow downloaded applications.
Run InfluxDB on macOS Ventura
- Follow the preceding instructions to attempt to start
influxd
. - Open System Settings and click Privacy & Security.
- Under the Security heading, there is a message about “influxd” being blocked, click Allow Anyway.
- When prompted, enter your password to allow the setting.
- Close System Settings.
- Attempt to start
influxd
. - A prompt appears with the message “macOS cannot verify the developer of “influxd”…”". Click Open.
Run InfluxDB on macOS Catalina
- Attempt to start
influxd
. - Open System Preferences and click Security & Privacy.
- Under the General tab, there is a message about
influxd
being blocked. Click Open Anyway.
We are in the process of updating the 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:
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
.
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:
influxd
In Powershell, navigate into C:\Program Files\InfluxData\influxdb
and start
InfluxDB by running the influxd
daemon:
cd -Path 'C:\Program Files\InfluxData\influxdb'
./influxd
Grant network access
When starting InfluxDB for the first time, Windows Defender appears with the following message:
Windows Defender Firewall has blocked some features of this app.
- Select Private networks, such as my home or work network.
- Click Allow access.
To use the Docker CLI to start an existing container, enter the following command:
docker start influxdb2
Replace influxdb2
with the name of your container.
To start a new container, follow instructions to install and set up InfluxDB in a container.
To start InfluxDB using Kubernetes, follow instructions to install InfluxDB in a Kubernetes cluster.
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 port8086
(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:
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!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.