Installing InfluxDB on Ubuntu
Hi there! This post is part of a series I am doing where I attempt to move most of the applications I use at home over to Linux. If you find this interesting you may enjoy the other posts too!
This is a brief guide to get InfluxDB up and running on Ubuntu Server, you can refer to the official documentation should you run into any issues.
Installation
Installing InfluxDB on Ubuntu is pretty straightforward and can be completed in a few simple steps.
First Time Only
The first time you install any of the Influx Data products you will need to add their repository using the below commands:
1
2
3
$ sudo wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
$ source /etc/lsb-release
$ echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Install InfluxDB
After updating apt-get you can install InfluxDB with the following command:
1
$ sudo apt-get update && sudo apt-get install influxdb
Configure InfluxDB
Should you want to make any changes to the default configuration you can edit the configuration file with the following command:
1
$ sudo nano /etc/influxdb/influxdb.conf
The most common changes I make to this file when installing InfluxDB are:
- Enable the HTTP endpoint
- Set the bind address to
0.0.0.0
Starting the service
Once installed you can start, stop and restart InfluxDB with the below commands:
1
2
3
$ sudo systemctl start influxd.service
$ sudo systemctl stop influxd.service
$ sudo systemctl restart influxd.service
Testing Install
To confirm InfluxDB is working (and the HTTP endpoint is enabled) you can try listing all databases using the following URL template (http://
You should see something like the below if all went well:
If you have any issues resolving your InfluxDB URL you can try running the following command on your server to see if there are any errors relating to InfluxDB
1
$ tail -f /var/log/syslog | grep influx
Hopefully it will shed some more light on the issue.
Quick Reference
Some helpful commands and paths to save you some time.
Configuration File
1
$ sudo nano /etc/influxdb/influxdb.conf
Service Management
1
2
3
$ sudo systemctl start influxd.service
$ sudo systemctl stop influxd.service
$ sudo systemctl restart influxd.service
Troubleshooting
1
$ tail -f /var/log/syslog | grep influx
Data Directories
1
2
3
4
5
6
# Where the metadata/raft database is stored
dir = "/var/lib/influxdb/meta"
# The directory where the TSM storage engine stores TSM files.
dir = "/var/lib/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/var/lib/influxdb/wal"
Ports
TCP
port8086
client-server communication (InfluxDB HTTP API).TCP
port8088
RPC service (for backup and restore operations).