2019-01-22 21:35:11 +00:00
---
title: Get started with InfluxDB
2019-01-23 23:38:25 +00:00
description: Download, install, and setup InfluxDB, creating a default organization, user, and bucket.
2019-01-22 21:35:11 +00:00
menu:
v2_0:
name: Get started
2019-02-06 16:24:44 +00:00
weight: 1
2019-02-20 00:04:06 +00:00
v2.0/tags: [get-started, install]
2019-01-22 21:35:11 +00:00
---
2019-01-23 23:38:25 +00:00
Get started with InfluxDB v2.0 by downloading InfluxDB, installing the necessary
2019-02-20 21:55:01 +00:00
executables, and running the initial setup process.
2019-01-22 23:31:35 +00:00
2019-03-19 23:02:43 +00:00
{{% cloud-msg %}}
2019-03-26 22:31:01 +00:00
This article describes how to get started with InfluxDB OSS. To get started with {{< cloud-name " short " > }}, see [Get Started with {{< cloud-name >}} ](/v2.0/cloud/get-started/ ).
2019-03-19 23:02:43 +00:00
{{% /cloud-msg %}}
2019-01-23 23:38:25 +00:00
{{< tabs-wrapper > }}
{{% tabs %}}
[macOS ](# )
[Linux ](# )
[Docker ](# )
2019-12-03 17:59:28 +00:00
[Kubernetes ](# )
2019-01-23 23:38:25 +00:00
{{% /tabs %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BEGIN macOS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
{{% tab-content %}}
2019-12-30 21:27:18 +00:00
### Download and install InfluxDB v2.0 beta
Download InfluxDB v2.0 beta for macOS.
2019-01-23 23:38:25 +00:00
2020-02-14 21:23:12 +00:00
< a class = "btn download" href = "https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-beta.5_darwin_amd64.tar.gz" download > InfluxDB v2.0 beta (macOS)< / a >
2019-01-23 23:38:25 +00:00
2019-04-24 22:20:55 +00:00
### Unpackage the InfluxDB binaries
2019-10-18 16:30:10 +00:00
To unpackage the downloaded archive, **double click the archive file in Finder**
2019-10-18 19:37:39 +00:00
or run the following command in a macOS command prompt application such
**Terminal** or ** [iTerm2 ](https://www.iterm2.com/ )**:
2019-01-23 23:38:25 +00:00
```sh
2019-01-24 20:45:22 +00:00
# Unpackage contents to the current working directory
2020-02-14 21:23:12 +00:00
tar zxvf ~/Downloads/influxdb_2.0.0-beta.5_darwin_amd64.tar.gz
2019-04-24 22:20:55 +00:00
```
2019-01-24 20:45:22 +00:00
2019-10-18 16:30:10 +00:00
#### (Optional) Place the binaries in your $PATH
If you choose, you can place `influx` and `influxd` in your `$PATH` or you can
prefix the executables with `./` to run then in place.
2019-01-24 20:45:22 +00:00
2019-04-24 22:20:55 +00:00
```sh
# (Optional) Copy the influx and influxd binary to your $PATH
2020-02-14 21:23:12 +00:00
sudo cp influxdb_2.0.0-beta.5_darwin_amd64/{influx,influxd} /usr/local/bin/
2019-01-23 23:38:25 +00:00
```
2019-01-24 20:45:22 +00:00
{{% note %}}
Both InfluxDB 1.x and 2.x include `influx` and `influxd` binaries.
If InfluxDB 1.x binaries are already in your `$PATH` , run the 2.0 binaries in place
or rename them before putting them in your `$PATH` .
If you rename the binaries, all references to `influx` and `influxd` in this documentation refer to your renamed binaries.
{{% /note %}}
2019-01-23 23:38:25 +00:00
### Networking ports
2019-04-18 14:59:43 +00:00
By default, InfluxDB uses TCP port `9999` for client-server communication over
the [InfluxDB HTTP API ](/v2.0/reference/api/ ).
2019-01-23 23:38:25 +00:00
## Start InfluxDB
Start InfluxDB by running the `influxd` daemon:
```bash
influxd
```
2019-11-14 11:23:37 +00:00
{{% warn %}}
2019-11-14 18:58:24 +00:00
#### 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` or `influx` , macOS will prevent it from running.
To manually authorize the InfluxDB binaries:
1. Attempt to run the `influx` or `influxd` commands.
2019-12-04 17:07:45 +00:00
2. Open **System Preferences** and click **Security & Privacy** .
2019-11-14 18:58:24 +00:00
3. Under the **General** tab, there is a message about `influxd` or `influx` being blocked.
Click **Open Anyway** .
4. Repeat this process for both binaries.
We are in the process of updating our build process to ensure released binaries are signed by InfluxData.
2019-11-14 11:23:37 +00:00
{{% /warn %}}
2019-01-23 23:38:25 +00:00
_See the [`influxd` documentation ](/v2.0/reference/cli/influxd ) for information about
available flags and options._
{{% note %}}
#### InfluxDB "phone home"
By default, InfluxDB sends telemetry data back to InfluxData.
The [InfluxData telemetry ](https://www.influxdata.com/telemetry ) page provides
information about what data is collected and how it is used.
2019-02-19 16:38:48 +00:00
To opt-out of sending telemetry data back to InfluxData, include the
2019-01-23 23:38:25 +00:00
`--reporting-disabled` flag when starting `influxd` .
```bash
influxd --reporting-disabled
```
{{% /note %}}
{{% /tab-content %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - END macOS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BEGIN Linux - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
{{% tab-content %}}
2019-12-30 21:27:18 +00:00
### Download and install InfluxDB v2.0 beta
Download the InfluxDB v2.0 beta package appropriate for your chipset.
2019-01-23 23:38:25 +00:00
2020-02-14 21:23:12 +00:00
< a class = "btn download" href = "https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-beta.5_linux_amd64.tar.gz" download > InfluxDB v2.0 beta (amd64)< / a >
< a class = "btn download" href = "https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-beta.5_linux_arm64.tar.gz" download > InfluxDB v2.0 beta (arm)< / a >
2019-01-23 23:38:25 +00:00
### Place the executables in your $PATH
2019-01-24 20:45:22 +00:00
Unpackage the downloaded archive and place the `influx` and `influxd` executables in your system `$PATH` .
_**Note:** The following commands are examples. Adjust the file names, paths, and utilities to your own needs._
2019-01-23 23:38:25 +00:00
```sh
2019-01-24 20:45:22 +00:00
# Unpackage contents to the current working directory
2020-02-14 21:23:12 +00:00
tar xvzf path/to/influxdb_2.0.0-beta.5_linux_amd64.tar.gz
2019-01-24 20:45:22 +00:00
# Copy the influx and influxd binary to your $PATH
2020-02-14 21:23:12 +00:00
sudo cp influxdb_2.0.0-beta.5_linux_amd64/{influx,influxd} /usr/local/bin/
2019-01-23 23:38:25 +00:00
```
2019-01-24 20:45:22 +00:00
{{% note %}}
Both InfluxDB 1.x and 2.x include `influx` and `influxd` binaries.
If InfluxDB 1.x binaries are already in your `$PATH` , run the 2.0 binaries in place
or rename them before putting them in your `$PATH` .
If you rename the binaries, all references to `influx` and `influxd` in this documentation refer to your renamed binaries.
{{% /note %}}
2019-01-23 23:38:25 +00:00
### Networking ports
2019-04-18 14:59:43 +00:00
By default, InfluxDB uses TCP port `9999` for client-server communication over
the [InfluxDB HTTP API ](/v2.0/reference/api/ ).
2019-01-23 23:38:25 +00:00
## Start InfluxDB
Start InfluxDB by running the `influxd` daemon:
```bash
influxd
```
_See the [`influxd` documentation ](/v2.0/reference/cli/influxd ) for information about
available flags and options._
{{% note %}}
#### InfluxDB "phone home"
By default, InfluxDB sends telemetry data back to InfluxData.
The [InfluxData telemetry ](https://www.influxdata.com/telemetry ) page provides
information about what data is collected and how it is used.
2019-02-19 16:38:48 +00:00
To opt-out of sending telemetry data back to InfluxData, include the
2019-01-23 23:38:25 +00:00
`--reporting-disabled` flag when starting `influxd` .
```bash
influxd --reporting-disabled
```
{{% /note %}}
{{% /tab-content %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - END Linux - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BEGIN Docker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
{{% tab-content %}}
2019-12-30 21:27:18 +00:00
### Download and run InfluxDB v2.0 beta
Use `docker run` to download and run the InfluxDB v2.0 beta Docker image.
2019-04-18 14:59:43 +00:00
Expose port `9999` , which InfluxDB uses for client-server communication over
the [InfluxDB HTTP API ](/v2.0/reference/api/ ).
2019-01-23 23:38:25 +00:00
```sh
2020-02-03 21:48:11 +00:00
docker run --name influxdb -p 9999:9999 quay.io/influxdb/influxdb:2.0.0-beta
2019-01-23 23:38:25 +00:00
```
2020-02-06 22:14:35 +00:00
_To run InfluxDB in [detached mode ](https://docs.docker.com/engine/reference/run/#detached-vs-foreground ), include the `-d` flag in the `docker run` command._
2020-02-03 21:48:11 +00:00
2019-01-23 23:38:25 +00:00
{{% note %}}
#### InfluxDB "phone home"
By default, InfluxDB sends telemetry data back to InfluxData.
The [InfluxData telemetry ](https://www.influxdata.com/telemetry ) page provides
information about what data is collected and how it is used.
2019-02-19 16:38:48 +00:00
To opt-out of sending telemetry data back to InfluxData, include the
2019-01-23 23:38:25 +00:00
`--reporting-disabled` flag when starting the InfluxDB container.
```bash
2019-12-30 21:27:18 +00:00
docker run -p 9999:9999 quay.io/influxdb/influxdb:2.0.0-beta --reporting-disabled
2019-01-23 23:38:25 +00:00
```
{{% /note %}}
### Console into the InfluxDB Container (Optional)
2019-01-23 23:50:34 +00:00
To use the `influx` command line interface, console into the `influxdb` Docker container:
2019-01-23 23:38:25 +00:00
```bash
docker exec -it influxdb /bin/bash
```
{{% /tab-content %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - END Docker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2019-12-03 17:59:28 +00:00
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BEGIN kubernetes - - - - - - - - - - - - - - - - - - - - - - - - - - -->
{{% tab-content %}}
2019-12-16 20:13:19 +00:00
### Install InfluxDB in a Kubernetes cluster
2019-12-03 17:59:28 +00:00
2019-12-17 20:10:28 +00:00
{{% note %}}
2019-12-16 20:13:19 +00:00
The instructions below use Minikube, but the steps should be similar in any Kubernetes cluster.
2019-12-17 20:10:28 +00:00
{{% /note %}}
2019-12-03 17:59:28 +00:00
2019-12-16 20:13:19 +00:00
1. [Install Minikube ](https://kubernetes.io/docs/tasks/tools/install-minikube/ ).
2019-12-03 17:59:28 +00:00
2019-12-16 20:13:19 +00:00
2. Start Minikube:
2019-12-03 17:59:28 +00:00
```
minikube start
```
2019-12-17 20:49:46 +00:00
3. Apply the [sample InfluxDB configuration ](https://github.com/influxdata/docs-v2/blob/master/static/downloads/influxdb-k8-minikube.yaml ) by running:
2019-12-03 17:59:28 +00:00
```
2019-12-17 20:49:46 +00:00
kubectl apply -f https://raw.githubusercontent.com/influxdata/docs-v2/master/static/downloads/influxdb-k8-minikube.yaml
2019-12-03 17:59:28 +00:00
```
2020-01-09 22:24:19 +00:00
< div class = "warn block" >
< p >
Always inspect YAML manifests before running < code > kubectl apply -f < url> < / code > !
< / p >
< / div >
2019-12-17 20:49:46 +00:00
2020-01-09 22:31:30 +00:00
This creates an `influxdb` Namespace, Service, and StatefulSet.
A PersistentVolumeClaim is also created to store data written to InfluxDB.
2019-12-20 18:47:29 +00:00
4. Ensure the Pod is running:
2019-12-17 18:19:24 +00:00
```
kubectl get pods -n influxdb
```
2019-12-18 10:12:52 +00:00
2019-12-20 18:47:29 +00:00
5. Ensure the Service is available:
2019-12-03 17:59:28 +00:00
```
2019-12-18 10:12:52 +00:00
kubectl describe service -n influxdb influxdb
2019-12-03 17:59:28 +00:00
```
2019-12-18 17:42:20 +00:00
You should see an IP address after `Endpoints` in the command's output.
2019-12-17 20:49:46 +00:00
6. Forward port 9999 from inside the cluster to localhost:
2019-12-03 17:59:28 +00:00
2019-12-13 17:55:34 +00:00
```
2019-12-18 17:42:20 +00:00
kubectl port-forward -n influxdb service/influxdb 9999:9999
2019-12-13 17:55:34 +00:00
```
2019-12-16 16:00:04 +00:00
2019-12-03 17:59:28 +00:00
{{% /tab-content %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - END kubernetes - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2019-01-23 23:38:25 +00:00
{{< / tabs-wrapper > }}
2019-03-19 23:02:43 +00:00
## Set up InfluxDB
2019-01-23 23:38:25 +00:00
The initial setup process for InfluxDB walks through creating a default organization,
user, and bucket.
The setup process is available in both the InfluxDB user interface (UI) and in
the `influx` command line interface (CLI).
{{< tabs-wrapper > }}
{{% tabs %}}
[UI Setup ](# )
[CLI Setup ](# )
{{% /tabs %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BEGIN UI Setup - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
{{% tab-content %}}
### Set up InfluxDB through the UI
2019-01-23 23:50:34 +00:00
1. With InfluxDB running, visit [localhost:9999 ](http://localhost:9999 ).
2019-01-23 23:38:25 +00:00
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.
2019-05-03 19:43:28 +00:00
You are ready to [write or collect data ](/v2.0/write-data ).
2019-01-23 23:38:25 +00:00
2019-04-01 22:19:13 +00:00
{{% note %}}
#### Using the influx CLI after setting up InfluxDB through the UI
To use the [`influx` CLI ](/v2.0/reference/cli/influx ) after setting up InfluxDB through the UI,
use one of the following methods to provide your [authentication token ](/v2.0/users/tokens/ ) to the CLI:
1. Pass your token to the `influx` CLI using the `-t` or `--token` flag.
2. Set the `INFLUX_TOKEN` environment variable using your token.
3. Store your token in `~/.influxdbv2/credentials` .
_The content of the `credentials` file should be only your token._
2019-04-16 21:50:11 +00:00
_See [View tokens ](/v2.0/security/tokens/view-tokens/ ) for information about
2019-04-01 22:19:13 +00:00
retrieving authentication tokens._
{{% /note %}}
2019-01-23 23:38:25 +00:00
{{% /tab-content %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - END UI Setup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - BEGIN CLI Setup - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
{{% tab-content %}}
### Set up InfluxDB through the influx CLI
Begin the InfluxDB setup process via the `influx` CLI by running:
```bash
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** (in hours) for your primary bucket.
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, and bucket.
2019-05-03 19:43:28 +00:00
You are ready to [write or collect data ](/v2.0/write-data ).
2019-01-23 23:38:25 +00:00
{{% /tab-content %}}
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - END UI Setup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
{{< / tabs-wrapper > }}