Raspberry Pi

How to Install InfluxDB on Raspberry Pi

InfluxDB is an open-source highspeed time-series database management system that handles high write and query loads. Each data point within the database contains a time stamp, and those users who need to work on time-series data must choose this database. It helps you monitor different events such as your room temperature, getting information about IoT sensor data, or other real-time analytics. Another plus point of this database is that you can easily integrate Grafana to InfluxDB; thus, you can visualize your time-series data on the web interface.

This article is a detailed guideline for installing InfluxDB on the Raspberry Pi.

Installing InfluxDB to the Raspberry Pi

To install the latest version of InfluxDB on Raspberry Pi, you will need to add its repository to the Raspberry Pi source list. Afterward, you will be able to install InfluxDB on your device. If you don’t know how it’s done, you can follow the steps given below:

Step 1: Update Raspberry Pi Source list

First execute the following command to update the Raspberry Pi source list so that the packages on your device list must be up to date:

$ sudo apt update && sudo apt upgrade -y

Step 2: Add InfluxDB GPG Key

Now, add the InfluxDB GPG key using the following command so that it will help to verify the packages during the addition of the InfluxDB repository.

$ curl https://repos.influxdata.com/influxdb.key | gpg --dearmor | sudo tee /usr/share/keyrings/influxdb-archive-keyring.gpg >/dev/null

Step 3: Add InfluxDB repository

After adding the GPG key, you can now add the InfluxDB repository into the Raspberry Pi source list using the following command:

$ echo "deb [signed-by=/usr/share/keyrings/influxdb-archive-keyring.gpg] https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

The above command adds the InfluxDB repository to the source list.

Step 4: Update Source List

After adding the InfluxDB repository, you will also need to run the following command in order to update the Raspberry Pi source list:

$ sudo apt update

Step 5: Install InfluxDB to Raspberry Pi

Once the source list is updated, you can use the below-given command to install the latest version of InfluxDB on your Raspberry Pi.

$ sudo apt install influxdb

Step 6: Use Systemctl commands

After successfully installing InfluxDB on Raspberry Pi, you will need to enable the database service on your Raspberry Pi device so that it automatically starts whenever your device reboots. To perform this process, you will first need to unmask the service using the following command:

$ sudo systemctl unmask influxdb

The above command reveals the identity of the InfluxDB service on your Raspberry Pi device. Afterward, you can execute the below-mentioned command to enable the InfluxDB service on your device:

$ sudo systemctl enable influxdb

With the service successfully enabled, execute the following command to start the InfluxDB service on your device.

$ sudo systemctl start influxdb

You can check the InfluxDB service status using the below-given command line:

$ sudo systemctl status influxdb

The active (running) status confirms that the InfluxDB service is successfully running on your Raspberry Pi.

Step 7: Run InfluxDB on Raspberry Pi

In the final step, you will need to execute the following command to run InfluxDB on your Raspberry Pi device:

$ influx

The above output confirms that InfluxDB is successfully setup on your Raspberry Pi device and you can start creating your time-series data with ease. For detailed guidance, you can get help from the official website of InfluxDB.

Conclusion

InfluxDB is a robust database management system that allows users to work on time-series data at a quick pace. With this database, you can efficiently perform your monitoring tasks without relying on other complex systems. You can install InfluxDB on your Raspberry Pi through the steps mentioned above, as they are easy to follow and will help you set up the database on your device within a few minutes. You can also integrate Grafana with this database, enabling you to use the web-based monitoring platform with ease.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.