Optimize Your AWS Workflow: Installing Kibana on Ubuntu 22.04 EC2 Instance

Buse Kaylan
5 min readMay 11, 2024

--

Welcome back, data enthusiasts! If you’ve been following along, you know we’ve embarked on an exciting journey exploring the realm of data analytics and management. From setting up Spark with PySpark for data processing, to orchestrating data flows with Apache NiFi, and harnessing the power of Elasticsearch for indexing and searching, we’ve covered a lot of ground. Today, we’re delving into another integral component of our data ecosystem: Kibana. In this installment, I’ll guide you through the process of launching Kibana on an Ubuntu 22.04 AWS EC2 instance, completing the final piece of our puzzle.

Let’s elevate our data insights to new heights!

Before accessing your EC2 instance, it’s essential to configure the security settings in your AWS account to allow access to the Kibana service. This involves adding a security rule that permits inbound traffic on port 5601, which is the default port for Kibana.

To do this, you’ll navigate to the AWS Management Console and access the security group associated with your EC2 instance. Then, you’ll add an inbound rule that allows traffic from your desired source (e.g., your IP address or 0.0.0.0) on port 5601.

By configuring the security group in this way, you ensure that only authorized users or systems can access Kibana running on your EC2 instance, enhancing the security of your data infrastructure.

Once the security rule is added and applied, you can proceed to connect to your EC2 instance and access Kibana with confidence, knowing that access is restricted to authorized entities.

After connecting to your instance, your first step is to obtain the relevant Kibana documentation from the official website. In this instance, we’ll be downloading Kibana version 7.17.0. It’s crucial to maintain compatibility between Elasticsearch and Kibana versions. Since we previously installed Elasticsearch 7.17, we’ll ensure compatibility by installing Kibana 7.17.0. If you’re considering a different Kibana version, it’s essential to verify its compatibility with your Elasticsearch version. You can refer to the compatibility matrix provided by Elasticsearch for this purpose. For checking compatibility of versions, you can visit Compatibility matrixes — Elasticsearch — Alibaba Cloud Documentation Center

To download Kibana 7.17.0, execute the following command. This command will fetch the Kibana 7.17.0 package for the AMD64 architecture. Make sure to adjust the command accordingly if you’re using a different architecture.

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.17.0-amd64.deb

After downloading the Kibana package, it’s a good practice to verify its integrity using a checksum. The shasum command with the -a 512 flag calculates the SHA-512 checksum of the downloaded file. By comparing this checksum with the one provided by the official source, you can ensure that the downloaded file hasn't been tampered with or corrupted during the download process. This step adds an extra layer of security to your installation process and helps prevent potential issues that could arise from using a compromised package. Here's the command to calculate the SHA-512 checksum for the downloaded Kibana package:

shasum -a 512 kibana-7.17.0-amd64.deb

After verifying the integrity of the downloaded Kibana package, the next step is to install it using the dpkg package manager. The dpkg -i command is used to install Debian packages, and with sudo, it ensures that the installation is performed with administrative privileges, allowing system-level changes to be made. Running this command will initiate the installation process for Kibana on your Ubuntu system. The installation process will handle tasks such as unpacking the package, configuring files, and setting up Kibana to run as a service on your system.

Here’s the command to install the downloaded Kibana package:

sudo dpkg -i kibana-7.17.0-amd64.deb

After installing Kibana, the next step is to configure it according to your requirements. This is typically done by editing the kibana.yml configuration file. The sudo nano /etc/kibana/kibana.yml command opens the kibana.yml file for editing using the Nano text editor with administrative privileges (sudo).

The kibana.yml file contains various settings, including defining the server host, specifying Elasticsearch server URLs, configuring logging parameters, and more. This flexibility allows you to customize Kibana's behavior to suit your environment.

To edit the kibana.yml file, execute the following command:

sudo nano /etc/kibana/kibana.yml

In the kibana.yml file, you'll make adjustments to specific sections. First of all, you should set server.host to "0.0.0.0" to allow Kibana to listen on all available network interfaces. Additionally, you should configure elasticsearch.hosts to specify the URL of your Elasticsearch instance, typically including the AWS public IP address and port number ["https://AWS_Public_IP:9200"]

Once you’ve made the necessary modifications, save the changes to the kibana.yml file and exit the Nano editor. To apply these configurations, you'll need to restart the Kibana service. This ensures that your adjustments take effect and enables Kibana to operate seamlessly within your data infrastructure.

Customizing the kibana.yml file according to your requirements is essential for optimizing Kibana's performance and functionality, enabling you to leverage its capabilities effectively for data visualization and analysis.

After making the necessary configurations in the kibana.yml file, the next step is to enable the Kibana service to ensure it starts automatically upon system boot. This is accomplished by running the following command:

sudo systemctl enable kibana

Executing this command registers Kibana as a systemd service, allowing it to start automatically when the system boots up. This ensures that Kibana remains available and operational without manual intervention, enhancing the reliability of your data infrastructure.

Once enabled, you can start the Kibana service using following command:

sudo systemctl start kibana

Well done, you’re all set! Now you can access your Kibana instance via the following link:

https://AWS_Public_IP:5601/

By navigating to this URL in your web browser, you’ll be able to access the Kibana interface and begin exploring your data for visualization and analysis. Ensure that your AWS public IP address is substituted appropriately in the link to access Kibana from your browser.

In the upcoming blog posts, we’ll delve into NiFi, exploring how we can leverage it to extract data from AWS S3, process it, and then seamlessly ingest it into Elasticsearch. Subsequently, we’ll discuss how to visualize this data by transferring it to Kibana, where we’ll craft insightful dashboards. Through this process, we’ll construct an end-to-end ETL pipeline example, showcasing the power of orchestrating data workflows.

Additionally, we’ll delve into the installation and configuration of Superset, a powerful tool for data exploration and visualization. By examining its setup and usage, we’ll further expand our toolkit for analyzing and presenting data effectively.

As we embark on this journey of data exploration and integration, we aim to equip ourselves with comprehensive knowledge and practical skills to harness the full potential of our data infrastructure.

Stay tuned for an enlightening dive into the world of data pipelines and visualization tools, where we’ll unlock new insights and possibilities!

--

--