Skip to content

Grafana – Installation

Purpose

In this post we install Grafana on a Debian based system such as Ubuntu, Raspberry Pi OS.

Scope

The scope of this post is limited to the installation of Grafana on a Debian based systems only. Other Linux distributions will vary slightly depending on their package managers. Configuring Grafana will be documented in other posts.

Background

Grafana is an observability platform used to visualize, monitor, and analyze data from diverse sources including databases, cloud services, and telemetry pipelines. It’s widely adopted for building dashboards that track system performance, application health, and business metrics across distributed environments.

The installation steps were sources from the Grafana official documentation here: https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/

1. Update system

sudo apt update

sudo apt upgrade -y

1. Install software prerequisites

Use elevated privileges to install system packages.

  • apt-transport-https (Enables APT to fetch packages over HTTPS)
  • software-properties-common (tool for installing 3rd party tools. i.e Grafana)
  • wget (tool for downloading from the web)
$ sudo apt-get install -y apt-transport-https software-properties-common wget

2. Add Grafana’s GPG (GNU Privacy Guard) key

  • Use elevated privileges to make the keyrings directory, if its not already there.
  • Use wget to download and store the GPG key.
$ sudo mkdir -p /etc/apt/keyrings
$ wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null

3. Add Grafana repo

  • The echo command outputs the repository line in APT format. This tells APT where to fetch Grafana packages.
  • From the previous step we use the GPG key used to verify packages from this repo. It’s a security measure to ensure authenticity.
  • Pipes the output into tee, which writes it to the grafana.list file under APT sources. sudo is needed for write access.
$ echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list

4. Update package list

  • Update your servers list of available software.
$ sudo apt-get update

5. Install Grafana OSS

  • Install the Grafana software application
$ sudo apt-get install grafana

6. Start and enable Grafana

  • Start the Grafana-server service (start)
  • Enable to grafana-server service to start at boot (enable)
$ sudo systemctl start grafana-server
$ sudo systemctl enable grafana-server

7. Test in Web Browser

Test to see if Grafana is running. Open a browser tab and enter:

http://<your_server_ip_address>:3000

Login with the below credentials

  • Login: admin
  • Password: admin

8. Check Grafana logging

Note the permissions are limited to user grafana and root.

$ cd /var/log/grafana

$ ls -l
total 1244
-rw-r----- 1 grafana grafana  16573 Aug 19 09:42 grafana.log
-rw-r----- 1 grafana grafana  71306 Aug 12 23:55 grafana.log.2025-08-13.001
-rw-r----- 1 grafana grafana  47961 Aug 13 23:55 grafana.log.2025-08-14.001
-rw-r----- 1 grafana grafana 162097 Aug 14 23:55 grafana.log.2025-08-15.001
-rw-r----- 1 grafana grafana  68198 Aug 15 23:55 grafana.log.2025-08-16.001
-rw-r----- 1 grafana grafana  60519 Aug 16 23:55 grafana.log.2025-08-17.001
-rw-r----- 1 grafana grafana 729009 Aug 17 23:54 grafana.log.2025-08-18.001
-rw-r----- 1 grafana grafana  70638 Aug 18 23:51 grafana.log.2025-08-19.001
$

That concludes the installation process. You can now begin to build dashboards.

EOF