Grafana Installation

This post demonstrates the Grafana installation (11.4 Enterprise) on RedHat Enterprise Linux 8.10. We will also take a look at the basic administration.

Prerequisites

All we need to get started is a RedHat Enterprise Linux 8.10 VM. The installation of the VM is described here.

Installing Grafana 11.4

There are different ways to install Grafana on a Linux system. In this guide we will add the official rpm repository. This way future upgrades of Grafana are easy to make. Perform these tasks as the root user:

# we create the repo configuration file
cat << EOF > /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
EOF
# and then install Grafana Enterprise
dnf -y install grafana-enterprise
# enable Grafana to start on boot
systemctl daemon-reload
systemctl enable grafana-server
# start Grafana now
systemctl start grafana-server

Accessing the Grafana web interface

After the Grafana installation you can access the web interface with a URL similar to http://lin1.fritz.box:3000/. The initial username and password is adman / admin. You should change it the first time you log in. After that you will see the following page:

Basic administration of Grafana

The installation created an os user grafana and a system service that will be used to start and stop Grafana:

to start the Grafana server:

systemctl start grafana-server

and to stop the Grafana server:

systemctl stop grafana-server

to restart the Grafana server:

systemctl restart grafana-server

to get the status of the Grafana server:

systemctl status grafana-server
Sample output of systemctl status grafana-server
[root@lin1 data]# systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2025-01-28 07:42:57 CET; 51s ago
     Docs: http://docs.grafana.org
 Main PID: 127704 (grafana)
    Tasks: 16 (limit: 48907)
   Memory: 82.5M
   CGroup: /system.slice/grafana-server.service
           └─127704 /usr/share/grafana/bin/grafana server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=rpm cfg:default.paths.logs>

Jan 28 07:42:57 lin1.fritz.box grafana[127704]: logger=plugin.angulardetectorsprovider.dynamic t=2025-01-28T07:42:57.587995433+01:00 level=info msg="Patterns update finished" d>
Jan 28 07:42:57 lin1.fritz.box grafana[127704]: logger=provisioning.dashboard t=2025-01-28T07:42:57.629677596+01:00 level=info msg="starting to provision dashboards"
Jan 28 07:42:57 lin1.fritz.box grafana[127704]: logger=provisioning.dashboard t=2025-01-28T07:42:57.629722241+01:00 level=info msg="finished to provision dashboards"
Jan 28 07:42:57 lin1.fritz.box grafana[127704]: logger=grafana-apiserver t=2025-01-28T07:42:57.927713688+01:00 level=info msg="Adding GroupVersion playlist.grafana.app v0alpha1>
Jan 28 07:42:57 lin1.fritz.box grafana[127704]: logger=grafana-apiserver t=2025-01-28T07:42:57.928405563+01:00 level=info msg="Adding GroupVersion featuretoggle.grafana.app v0a>
Jan 28 07:42:57 lin1.fritz.box grafana[127704]: logger=grafana-apiserver t=2025-01-28T07:42:57.92991001+01:00 level=info msg="Adding GroupVersion iam.grafana.app v0alpha1 to Re>
Jan 28 07:42:58 lin1.fritz.box grafana[127704]: logger=plugin.installer t=2025-01-28T07:42:58.805433195+01:00 level=info msg="Installing plugin" pluginId=grafana-lokiexplore-ap>
Jan 28 07:42:59 lin1.fritz.box grafana[127704]: logger=installer.fs t=2025-01-28T07:42:59.068182526+01:00 level=info msg="Downloaded and extracted grafana-lokiexplore-app v1.0.>
Jan 28 07:42:59 lin1.fritz.box grafana[127704]: logger=plugins.registration t=2025-01-28T07:42:59.132812662+01:00 level=info msg="Plugin registered" pluginId=grafana-lokiexplor>
Jan 28 07:42:59 lin1.fritz.box grafana[127704]: logger=plugin.backgroundinstaller t=2025-01-28T07:42:59.132857115+01:00 level=info msg="Plugin successfully installed" pluginId=>


Deinstallation of Grafana

To remove Grafana from your system run these tasks as root:

# stop and remove grafana
systemctl stop grafana-server
dnf -y remove grafana-enterprise
# remove the rpm repo definition
rm -f /etc/yum.repos.d/grafana.repo
# delete the gpg repo key
rpm -e `rpm -qa --qf 'gpg-pubkey-%{VERSION}-%{RELEASE} %{SUMMARY}\n' gpg-pubkey*|grep Grafana|awk {'print $1'}`
# delete the os user grafana and its home directory
userdel grafana && rm -rf /usr/share/grafana

Further info