What news from AWS re:Invent last week will have the most impact on you?
Amazon Q, an AI chatbot for explaining how AWS works.
Super-fast S3 Express storage.
New Graviton 4 processor instances.
Emily Freeman leaving AWS.
I don't use AWS, so none of this will affect me.
Data / Linux

Install the InfluxDB Time-Series Database on Ubuntu Server 22.04

Chances are pretty good, at some point in time, you're business or your application will require the use of a time-series database. When that time comes, you'll want to be ready for it.
Oct 21st, 2023 6:00am by
Featued image for: Install the InfluxDB Time-Series Database on Ubuntu Server 22.04
Feature image by valentinsimon0 from Pixabay.

InfluxDB is a time-series database that is, well, optimized for time-series data. For those who aren’t certain what time-series data is, think about them as a collection of data that is collected over consistent intervals of time.

Time-series data is useful for things like commodity prices, stock prices, housing prices (over a period of time), weather, sales data, patient health metrics, and more. This type of data allows admins, managers, developers, and other user types to measure and analyze change, which can be very useful in forecasting trends and other measurables.

In other words, it’s quite valuable.

Time-series databases are used for operations monitoring, application metrics, IoT sensor data, real-time analytics, and much more.

To find out more about time-series databases, make sure to check out “What Are Time Series Databases, and Why Do You Need Them?

Chances are pretty good, at some point in time, you’re business or your application will require the use of a time-series database. When that time comes, you’ll want to be ready for it. That’s why I’m here to walk you through the installation of the time-series database, InfluxDB. I’m going to demonstrate installing the open-source version of InfluxDB on Ubuntu Server 20.04, as that is one of the most widely used distributions deployed on cloud hosts around the world.

InfluxDB includes features such as:

  • RESTful API
  • Built on an SQL-like query language, called InfluxQL
  • Client libraries for languages like C#, Go, Java, JavaScript, Kotlin, Node.js, PHP, Python, R, and more
  • Series cardinality and high throughput
  • Batch and streaming to inget and join data
  • Flexible storage
  • High availability that can be run on three clouds, four continents, and 20 regions
  • Write data with AWS Lambda or InfluxDB CLI
  • Run Flux scripts natively and view results in VS Code
  • Connectors to Grafana, Google Data Studio, and PTC ThingWorkx

InfluxDB is a great choice for any application that requires high performance and storage at scale. If this has piqued your interest, let’s get to the installation of this fantastic time-series database.

What You’ll Need

The only things you’ll need for this are a running instance of Ubuntu Server 22.04 and a user with sudo privileges. Your Ubuntu instance can be local, in a data center, or hosted via a third-party cloud provider.

Make sure your instance of Ubuntu Server is up to date and fully patched against known vulnerabilities. To do that, make sure you run the following two commands:

If the kernel is upgraded, you’ll need to reboot the server so the changes will take effect. To reboot the server, issue the command:

Installing InfluxDB

The first thing we must do is download the official InfluxDB GPG key with the following command:

Install the key with:

Next, add the required repository with the following command:

Once you’ve added the key, update apt sources with the command:

Finally, install InfluxDB with:

With the installation complete, start and enable the service with the command:

I ran into an instance where InfluxDB refused to enable. To resolve that issue, I rebooted the server once again and all was fine. You can check on the status with:

You should see it listed as active (running).

Finally, you’ll need to open the required firewall port with the command:

Access the Web-Based Portal

Open a web browser and point it to http://SERVER:8086 (where SERVER is either the IP address or domain of the hosting server). You’ll be greeted by a Get Started button (Figure 1).

Figure 1: The InfluxDB Get Started button is where you begin.

Click that button and you’ll then be required to create an initial user (Figure 2).

Figure 2: Creating your first user for InfluxDB..

Fill out all of the required information and click Continue.

In the resulting window (Figure 3), you’ll be presented with an API token. Make sure you copy and save that token somewhere safe because it enables superuser privileges.

Figure 3: Make sure to copy and paste the token for later use.

You can then click either Quick Start if you’re new to InfluxDB or click Advanced if you’re familiar with the database. If you click Quick Start, InfluxDB will automatically set up local metric collection and dump you right into the main window (Figure 4), where you can get to work with the database.

Figure 4: The InfluxDB Get Started window is a great place to learn more about how to use your new database.

If you’re unfamiliar with InfluxDB, I would highly recommend visiting each of the Useful Links listed in the main window.

And that’s the basics of getting InfluxDB up and running on Ubuntu Server 20.04. This powerful time-series database will come in very useful for your business and the data it depends on.

Group Created with Sketch.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.