Install an InfluxDB Grafana stack on a Raspberrypi

From lechacal
Jump to: navigation, search

Guide was edited and tested using Raspbian image:

Install Influxdb

Access a terminal on the Raspberrypi and enter the commands below to install InfluxDB.

curl -sL | sudo apt-key add -
sudo apt install apt-transport-https
echo "deb buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update
sudo apt-get install influxdb

Setup Influxdb Config

Edit the config file.

sudo nano /etc/influxdb/influxdb.conf

Change the options as shown below.

  # Determines whether HTTP endpoint is enabled.
  enabled = true

  # The bind address used by the HTTP service.
  bind-address = ":8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
  auth-enabled = false

Restart InfluxDB service.

sudo service influxdb restart

Create a database called db01.

curl -i -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE db01"

Use anything else than db01 if you prefer something else.

Install Grafana

curl | sudo apt-key add -
echo "deb stretch main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana
sudo service grafana-server start
# sudo update-rc.d grafana-server defaults
sudo systemctl enable grafana-server

Note. The stretch in the second command is not a mistake at time of writing

Setup Grafana

Using a computer on the same network of the Raspberrypi. Open a web browser and go to address


Grafana will show up. Login using user admin password admin.

Go to Configuration | Data Sources

Then click Add data sources.

Name: InfluxDB_01
Type: InfluxDB
URL: http://localhost:8086
Database: db01

Keep everything else by default. Name must be the raspberrypi hostname. Database can be anything you like.