How To Set up Grafana on Rocky Linux 9

This guide intends to teach you to Set up Grafana visualization and analytics software on Rocky Linux 9.

Grafana is an open-source solution for running data analytics with the help of metrics that give us an insight into the complex infrastructure and massive amount of data that our services deal with, with the use of customizable dashboards.

Grafana connects with every possible data source such as Graphite, Prometheus, Influx DB, ElasticSearch, MySQL, PostgreSQL, etc. The solution’s open-source nature helps us write custom plugins to connect with any data source of our choice.

Steps To Set up Grafana on Rocky Linux 9

To complete this guide, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. For this purpose, you can visit this guide on Initial Server Setup with Rocky Linux 9.

Grafna Installation on Rocky Linux 9

First, you need to update your local package index with the following command:

sudo dnf update 

You can install Grafana in a few ways on your server. In this guide, you will learn to install Grafana by using an RPM package.

Download Grafana

Visit the  Grafana Downloads page and get the package with the wget command below:

sudo wget https://dl.grafana.com/oss/release/grafana-VERSION.x86_64.rpm
sudo wget https://dl.grafana.com/oss/release/grafana-9.1.6-1.x86_64.rpm

Install Grafana on Rocky Linux 9

Then, use the following command to install Grafana:

sudo dnf install grafana-9.1.6-1.x86_64.rpm

Manage Grafana Service

Once the installation is complete, reload the system daemon with the command:

sudo systemctl daemon-reload

Now start and enable the Grafana service by running the commands below:

# sudo systemctl start grafana-server
# sudo systemctl enable grafana-server

Verify your Grafana service is active and running on Rocky Linux 9:

sudo systemctl status grafana-server
Output
● grafana-server.service - Grafana instance
     Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; v>
     Active: active (running) since Thu 2022-09-22 04:09:53 EDT; 11s ago
       Docs: http://docs.grafana.org
   Main PID: 5010 (grafana-server)
      Tasks: 7 (limit: 23609)
     Memory: 39.7M
        CPU: 942ms
     CGroup: /system.slice/grafana-server.service
             └─5010 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini 

Configure Firewall For Grafana

The Grafana server listens on port 3000 by default, you can verify this with the command below:

sudo ss -plunt|grep grafana
Output
tcp   LISTEN 0      4096               *:3000            *:*    users:(("grafana-server",pid=5010,fd=8))

At this point, you need to allow traffic for Grafana on port 3000 through the firewall on Rocky Linux 9. To do this, run the following command:

sudo firewall-cmd --add-port=3000/tcp --permanent

Now reload the firewall to apply the new rules:

sudo firewall-cmd --reload

Note: You can customize Grafana by editing the configuration file at /etc/grafana/grafana.ini to suit your preference.

Access Grafana Dashboard

At this step, you can access the Grafana web interface on Rocky Linux 9 by typing your server’s IP address in your web browser followed by 3000:

http://your-server-ip-address:3000

You will see the Grafana login screen. At this window, enter admin for the username and password and click Log in.

Grafana Login screen

Then, change the default password of Grafana and click submit.

Change Grafana password

At this point, you will see the Grafana welcome dashboard screen:

Grafana Dashboard on Rocky Linux 9

The Grafana dashboard is pretty equipped with various features and is continually evolving which helps us make sense of complex data. From displaying graphs to heatmaps, histograms, Geo maps, and so on. 

Conclusion

At this point, you have learned to Set up Grafana on Rocky Linux 9.

Hope you enjoy it. You may be interested in these articles on the orcacore website:

How To Install Apache Maven on Rocky Linux 9

Install and Use Traceroute Command in Linux

How To Set up Webmin on Rocky Linux 8

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!