A Simple Guide to Installing InfluxDB on Ubuntu 22.04
InfluxDB is a popular open-source time series database optimized for high-write-volume workloads such as logs, sensor data, and real-time analytics. This guide will provide you with a step-by-step process for installing InfluxDB on Ubuntu 22.04.
Step 1: Update Your System
Before installing any package, it is always recommended to update the system and package repositories. If you’re using a Linux system, you can do this with the following commands:
sudo apt-get update
sudo apt-get upgrade
Step 2: Download and Install InfluxDB
You can download InfluxDB directly from the InfluxData website or from their repository. For Ubuntu users, the following commands will add the repository and install the software:
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
Now update your repository and install InfluxDB:
sudo apt-get update
sudo apt-get install influxdb
Step 3: Configure and Start InfluxDB
Once you have successfully installed InfluxDB, you need to start the service. Depending on your system, you can use either of the following commands:
sudo service influxdb start
or
sudo systemctl start influxdb
Step 4: Verify Installation
To confirm that InfluxDB is running successfully, you can check its status using this command:
sudo systemctl status influxdb
You should see output indicating that the service is active (running).
Congratulations, you’ve installed InfluxDB!
Note: InfluxDB uses port 8086 by default, so you would need to ensure that your firewall allows connections on this port.
Step 5: Post Installation – Setting Up
After successful installation, you can interact with InfluxDB using its HTTP API on localhost port 8086. To start the InfluxDB shell (CLI), simply type:
influx
In the influx shell, you can create databases, users, and start querying your time-series data.