How to install the Grafana surveillance system on CentOS 8

s2 0

Grafana is a widely used open source system monitoring solution for Linux servers. It is used by PayPal, eBay, and Red Hat, for example. Grafana is a great choice for any engineer looking to use a scalable and robust dashboard monitoring tool. This monitoring tool monitors various data sources. With Grafana you can bind time series databases like Prometheus or Influx DB and relational databases like PostgreSQL or MySQL.

This tutorial shows how to install Grafana on CentOS 8.


You must log in as the root user on your system to run all administrative commands.

Installation of Grafana on CentOS 8

The Grafana installation is completed in the number of steps listed below:

Step 1: add Grafana Yum repository

To install Grafana using the Yum package manager, add the Grafana repository to the local Yum repository. To do this, open the terminal via the “Activities” section and click on the terminal symbol in the left sidebar of the CentOS 8 desktop. Now create a new file ‘grafana.repo’ in the Yum repository and run the following commands with administrator rights on the terminal application:

$ cat <<EOF | sudo tee /etc/yum.repos.d/grafana.repo


Enter the sudo password and you will see the following output on the terminal:

Step 2: update the Yum repository

Update the available system packages with the following command:

$ sudo dnf makecache

Run Makecache

All packages in your system are now updated.

Step 3: Install Grafana with dnf

Once the Grafana repository has been added and configured on your system, install Grafana by running the following command:

$ sudo dnf -y install grafana

Use the dnf command to install Grafanaadvertising

The above command imports the GPG key and installs all the necessary Grafana packages on CentOS 8.

Grafana installation completed

Once the Grafana installation is complete, you can use the following command to verify the installation and view the details of the Grafana package:

$ rpm -qi grafana

Step 4: Activate the Grafana systemd service

Systemd manages the grafana service on your system. So enable it by running the ‘systemctl’ command like this:

$ sudo systemctl enable --now grafana-server.service

Activate systemd service for Grafana

Step 5: Start the Grafana systemd service

The Grafana systemd service is now activated. Start the service and then check the running or active status of the Grafana service by running the following commands:

$ systemctl start grafana-server.service
$ systemctl status grafana-server.service

Start Grafana

Step 6: Activate firewall rules

By default, the grafana service runs on port 3000. So with the firewalld service running on your system, run the following command to allow access to port 3000 for the grafana service:

 $ sudo firewall-cmd --add-port=3000/tcp --permanent
$ sudo firewall-cmd –reload

Configure the firewall

To make sure everything is working properly, use the following command:

$ sudo firewall-cmd --list-all | grep ports

List firewall ports

Step 7: Grafana configuration files

All grafana configurations regarding port and path are saved in the configuration file ‘/etc/grafana/grafana.ini’. You can change ‘http_port = 3000’ according to your system requirements. The grafana log is written to the ‘/ var / log / grafana’ directory by default. The grafana SQLite database can be found under ‘/var/lib/grafana/grafana.db’.

Step 8: Launch Grafana on CentOS 8 from the web UI

Start the Grafana web user interface on CentOS 8. Open the browser and enter the following URL in the address bar:

http: // localhost: 3000


http: // server-ip: 3000

The Grafana web UI is displayed in your browser as follows:

Grafana login

Enter username = admin and password = admin to access the Grafana dashboard. The following Grafana dashboard is then displayed in the browser:

Grafana monitoring dashboard

Congratulations! The Grafana installation is complete. You are now ready to use the Grafana monitoring dashboard on the CentOS 8 system.

Remove or uninstall the Grafana monitoring tool from CentOS 8

After using Grafana on your system, you can uninstall this monitoring tool dashboard from CentOS 8 by using the following command:

$ sudo dnf remove grafana


Grafana is an open source system monitoring tool for Linux servers that is widely used. These instructions will guide you through the installation of Grafana on CentOS. It’s an excellent option for any engineer looking for a scalable and reliable dashboard monitoring solution.

How to install the Grafana surveillance system on CentOS 8