Installing the Elasticsearch and Kibana on Rocky Linux (part-01)

Kusal TharinduKusal Tharindu
2 min read

Kibana is a powerful visualization tool that integrates with Elasticsearch, offering insights into your data. This guide will help you install the latest versions of Elasticsearch and Kibana on Rocky Linux from scratch.

Step 1: Update Your System

Start by updating your system to ensure all packages are up-to-date. Open a terminal and run the following command:

sudo dnf update -y

Step 2: Install Java (OpenJDK)

Elasticsearch requires Java to run. Install OpenJDK using the following command:

sudo dnf install java-11-openjdk-devel -y

Verify the Java installation:

java -version

You should see output confirming Java 11 is installed.

Step 3: Add the Elasticsearch Repository

To install Elasticsearch, you need to add its official repository. First, import the Elasticsearch GPG key:

sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

Then, create a repository file for Elasticsearch:

sudo tee /etc/yum.repos.d/elasticsearch.repo <<EOF
[elasticsearch-8.x]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

Step 4: Install Elasticsearch

Now that the repository is configured, install the latest Elasticsearch:

sudo dnf install elasticsearch -y

Step 5: Start and Enable Elasticsearch

Enable and start the Elasticsearch service:

sudo systemctl enable --now elasticsearch

Verify that Elasticsearch is running:

sudo systemctl status elasticsearch

Step 6: Install Kibana

Next, install Kibana using the following command:

sudo dnf install kibana -y

Step 7: Configure Kibana

Once Kibana is installed, configure it by editing the kibana.yml configuration file:

sudo nano /etc/kibana/kibana.yml

Update the following lines:

server.port: 5601
server.host: "localhost"
elasticsearch.hosts: ["http://localhost:9200"]

This configuration sets Kibana to run on port 5601 and connects it to Elasticsearch.

Step 8: Start and Enable Kibana

Start and enable the Kibana service:

sudo systemctl enable --now kibana

Verify that Kibana is running:

sudo systemctl status kibana

Step 9: Access Kibana

Kibana should now be accessible at http://localhost:5601. If you are running Kibana on a remote server, replace localhost with your server’s IP address.

Firewall Configuration (Optional)

If you want to access Kibana from other machines, you need to open port 5601 in the firewall:

sudo firewall-cmd --add-port=5601/tcp --permanent
sudo firewall-cmd --reload

Conclusion

You’ve successfully installed the latest versions of Elasticsearch and Kibana on Rocky Linux. Kibana is now ready for use, allowing you to visualize your Elasticsearch data. Be sure to secure your setup if your instances are accessible over a network, especially for production environments.

0
Subscribe to my newsletter

Read articles from Kusal Tharindu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Kusal Tharindu
Kusal Tharindu

As a dedicated DevOps Engineer, I've immersed myself in the dynamic world of DevOps, sharing my insights through blogs to support the community. I aim to simplify complex processes, empowering both beginners and experts to navigate DevOps with confidence and ease, fostering collective growth in this ever-evolving field.