October 21, 2021
How to install Grafana on Debian 11

How To Install Grafana On Debian 11

On this tutorial we will learn how to install Grafana version 8 OSS edition on Debian 11 operating system

Introduction

Grafana is a multi-platform open source analytics and interactive visualization web based application. Grafana provides charts, graphs, and alerts, ussually when it is connected to supported data sources (Graphite, Elasticsearch, OpenTSDB, Prometheus, and InfluxDB). On this tutorial, we will learn how to install Grafana version 8 on Debian 11 operating system.

There are available two edition of Grafana, namely: Enterprise and OSS edition. On this article we will install Grafana OSS stable edition. We can run Grafana on our own hardware or use Grafana Cloud. We can install Grafana using Grafana official APT repository, by downloading a .deb package, or by downloading a binary .tar.gz file.

Grafana Installation On Debian 11

On this tutorial, we install Grafana using APT repository of Grafana OSS stable edition version 8.0 (the latest version when this article is being written) which was released on August 25, 2021. The installation of grafana on Debian 11 will consist of several stages, namely:

Prerequisite

Before continuing Grafana installation, we have to prepare our Debian 11 environment. Grafana installation has requirement as follow :

  • user with sudo either as root privileges,
  • sufficient space (Grafanan requires about 170 MB dsik space)
  • good internet connection for downloading required package
  • the last update system, this step could be achieved by submitting command line sudo apt update

Add Grafana OSS stable release Repository

At this step, we will add Grafana repository to the system. Here is the series command line :

udo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
ramansah@otodiginet:~$ sudo apt-get install -y apt-transport-https
[sudo] password for ramansah:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 160 kB of archives.
After this operation, 166 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 apt-transport-https all 2.2.4 [160 kB]
Fetched 160 kB in 2s (87.2 kB/s)             
Selecting previously unselected package apt-transport-https.
(Reading database ... 137093 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.2.4_all.deb ...
Unpacking apt-transport-https (2.2.4) ...
Setting up apt-transport-https (2.2.4) ...
ramansah@otodiginet:~$ sudo apt-get install -y software-properties-common wget
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
software-properties-common is already the newest version (0.96.20.2-2.1).
software-properties-common set to manually installed.
wget is already the newest version (1.21-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
ramansah@otodiginet:~$ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
ramansah@otodiginet:~$ echo "deb https://packages.grafana.com/oss/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
deb https://packages.grafana.com/oss/deb beta main

Install Grafana OSS Version 8

After adding Grafana OSS repository, then we wil update and l install it on the system. By updating our system, it will refresh the local list of available packages software to the newer stable version. To update Debian 11 system repositories, we will use the command line:

sudo apt-get update
sudo apt-get install grafana
ramansah@otodiginet:~$ sudo apt-get update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://ftp.debian.org/debian stretch-backports InRelease                                         
Hit:3 http://deb.debian.org/debian bullseye InRelease                                                  
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease                                          
Hit:5 http://deb.debian.org/debian bullseye-backports InRelease                                        
Get:6 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]                                  
Hit:7 https://downloads.apache.org/cassandra/debian 40x InRelease
Get:8 https://packages.grafana.com/oss/deb beta InRelease [12.1 kB]
Get:9 https://packages.grafana.com/oss/deb stable/main amd64 Packages [24.8 kB]
Get:10 https://packages.grafana.com/oss/deb beta/main amd64 Packages [9,264 B]
Fetched 58.2 kB in 4s (16.3 kB/s)
Reading package lists... Done
ramansah@otodiginet:~$ sudo apt-get install grafana
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  grafana
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 66.5 MB of archives.
After this operation, 224 MB of additional disk space will be used.
Get:1 https://packages.grafana.com/oss/deb beta/main amd64 grafana amd64 8.2.0~beta2 [66.5 MB]
Fetched 66.5 MB in 1min 12s (918 kB/s)                                                                 
Selecting previously unselected package grafana.
(Reading database ... 137097 files and directories currently installed.)
Preparing to unpack .../grafana_8.2.0~beta2_amd64.deb ...
Unpacking grafana (8.2.0~beta2) ...
Setting up grafana (8.2.0~beta2) ...
Adding system user `grafana' (UID 117) ...
Adding new user `grafana' (UID 117) with group `grafana' ...
Not creating home directory `/usr/share/grafana'.
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server

Start Grafana Server

On this section we will start the grafana-server process as the grafana user, which was created during the package installation. To start the service and verify that the service has started:

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
ramansah@otodiginet:~$ sudo systemctl daemon-reload
ramansah@otodiginet:~$ sudo systemctl start grafana-server
ramansah@otodiginet:~$ sudo systemctl status grafana-server
? grafana-server.service - Grafana instance
     Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-10-04 05:05:07 EDT; 13s ago
       Docs: http://docs.grafana.org
   Main PID: 4887 (grafana-server)
      Tasks: 10 (limit: 4623)
     Memory: 89.3M
        CPU: 1.123s
     CGroup: /system.slice/grafana-server.service
             ??4887 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/run/grafana/g>

Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="Executing mig>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="migrations co>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="Created defau>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="Created defau>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="Starting plug>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="Registering p>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="External plug>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="Live Push Gat>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="Writing PID f>
Oct 04 05:05:09 otodiginet grafana-server[4887]: t=2021-10-04T05:05:09-0400 lvl=info msg="HTTP Server L>
Install Grafana  |  Grafana Server Service
Grafana Server Service

Access Grafana Dashboard

Grafana dashboard can be accessed via web browser using the server IP address or hostname with default port 3000. The default credential for login is :

User name : admin
Password  : admin

We have to change the password for the first time login.

Grafana Dashboard
Grafana First Login
Grafana changing admin password
Changing admin password
Grafana Home Dashboard
Grafana Home Dashboard

Conclusion

On this tutorial, we have shown you how to install Grafana on Debian 11 operating system. For more information about Grafana, just visit https://grafana.com/Grafana official website.

Share this article via :

Leave a Reply

Your email address will not be published. Required fields are marked *