Use our guide to install the InfluxDB database server on Ubuntu 22.04 LTS Jammy using the command terminal.
What is InfluxDB?
InfluxDB is an open-source database developed by InfluxData that prioritizes maximum efficiency with limited complexity, unlike relational databases such as MySQL and MariaDB or structured databases such as Redis. Although the software is distributed under an open-source license, the company also offers commercial extensions such as access controls for business customers within its root server and cloud services with graphical data analysis via a web interface. Some of its key features are Specialization in time series; Combination of several sources in one central instance; Very high processing efficiency; Support of Flux as a scripting language for administration and Collection of data from different sources, for example via the third-party API.
Steps to install InfluxDB on Ubuntu 22.04 LTS Linux
The steps given below to install InfluxDB for Ubuntu 22.04 LTS can also be used for the Linux system based on it. Such as Linux Mint, POP OS, Elementary OS, and more…
1. Start with a System update
As we are about to install a database server on Ubuntu 22.04, hence it is better to run the system update command first. This will ensure that we have important security updates on our system.
sudo apt update
2. Import the InfluxDB GPG key
As the packages for the installation of InfluxDB are not available through the default system repository. Therefore, we need to add the one manually, however, the system has to ensure the packages getting from a particular repo are the same as they were released by its developers. And for that purpose, it needs the GPG Key. Follow the given command to add the one offered by the developers of InfluxDB.
wget -q https://repos.influxdata.com/influxdata-archive_compat.key
3. Add APT repository
Next, add the repository officially issued by the developers of InfluxDB. The given command will automatically detect the version of your system and the InfluxDb package repository corresponding to that.
echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
Perform the system update:
After adding the repo, run the system update command to rebuild the APT package index cache.
sudo apt update
4. Installing InfluxDB on Ubuntu 22.04
We have prepared our system by following the above commands to fetch the packages of InfluxDB using the APT package manager. Now, to install it, run the given command:
sudo apt install influxdb2
5. Start and Enable the Influxdb service
To let the database server service start automatically with the system boot, start and enable it using the given commands.
sudo systemctl start influxdb
sudo systemctl enable influxdb
Whereas to check the status of the service, you can see:
sudo systemctl status influxdb
In the future to stop and restart the database server, the commands are:
sudo systemctl restart influxdb
sudo systecmtl stop influxdb
6. Allow InfluxDB TCP port 8086 in the Firewall
If you have enabled the system firewall then allow port 8086 in it to access InfluxDb from the client over its HTTP API.
sudo ufw allow 8086/tcp
In the same way, we can also open TCP port 8088 using the above command, if needed. This port is used by the RPC service for backup and restore.
6. Setup InfluxDB
You can use the command line or the GUI to set up the primary username and password.
For the command line:
Open the browser and type: http://server-ip-address:8086
This was the quick way to install InfluxDB Database Server and use it on Ubuntu 22.04. To know more about security and authentication- see the official documentation.