How to install Grafana on Ubuntu 20.04?

Overview

An open-source utility for monitoring and data visualization called Grafana integrates with complex data from ElasticSearch, Graphite, InfluxDB, and Prometheus, among other sources. Grafana simplifies teamwork through built-in sharing features while allowing you to create notifications, alarms, and filters for your data.

You will learn how to install & set up Grafana in this guide. After installing Grafana, you can check whether the status is running or not.

Prerequisites

There are certain prerequisites that need to be met before you begin.

  1. Ubuntu 20.04 LTS configured on your system.

  2. Non-root sudo user privileges.

    sudo apt-get update

Get started

1. Before starting with Grafana installation, you need to install some packages that are necessary for Grafana to run properly, which are, apt-transport, and software-properties-common.

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget

2. Pipe the output of the Grafana GPG key downloaded using wget to apt-key. By doing this, you can get the GPG-signed Grafana package and verify it against the key collection of trusted keys in your APT installation.

wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

3. Then, include the Grafana repository in your list of APT sources.

sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

4. update your APT cache, to keep your package inventories up to date.

sudo apt-get update

5. You can start with the installation, by using the below command.

sudo apt-get install grafana

6. After Grafana has been loaded, launch the Grafana server using systemctl command, and examine the status of the service to ensure that Grafana is running.

sudo systemctl start grafana-server
sudo systemctl status grafana-server

Conclusion

In this tutorial, you learned how to install and check the status of Grafana on your Ubuntu 20.04 machine. Check out the official Grafana documentation to learn more about using it generally, also check the list of official and community-built dashboards and plugins to expand your existing Grafana installation.

Last updated