Mar 08, 2023

9 min read

How To Install and Configure Grafana on Ubuntu 22.04

Written by

Abdelhadi Dyouri

Grafana is an open-source monitoring and data visualization software. It provides analytics and interactive visualization on the web for your servers, with features offering charts, graphs, and alerts. It supports integration with complex data sources such as Prometheus, Graphite, and ElasticSearch.

This tutorial will guide you through installing and configuring Grafana on your Ubuntu server.


To follow this tutorial you need:

  • Basic knowledge of the Linux command line.
  • An Ubuntu 22.04 server with a non-root user with sudo privileges. You can get affordable, and powerful Ubuntu servers from our website, and you can check out our How to access your server using SSH guide to learn how to access your server and create a sudo user.
  • The LEMP stack (Nginx, MariaDB, and PHP) installed on your server. Use our Installing LEMP on Ubuntu 22.04 LTS guide to set it up.

Note: You can use our LEMP 1-Click App to set up LEMP automatically when creating a server. Just visit our website, choose a server, and while prompted to choose the operating system, choose LEMP from the dropdown menu, complete your checkout, and in a couple of minutes our algorithms will take care of all the complex technicalities for you.

  • A TLS/SSL certificate, because Grafana can access sensitive information about your infrastructure.

Step 1: Updating the Package Cache

Start by updating the packages in the package manager cache to the latest available versions using the following command:

sudo apt update

Step 2: Install Grafana

To install Grafana, you will need to first add its APT repository. First get the official GPG key from the Grafana website and using the following command:

wget -q -O - | gpg --dearmor | sudo tee /usr/share/keyrings/grafana.gpg > /dev/null

This downloads and stores the key in /usr/share/keyrings/grafana.gpg.

With the GPG key downloaded, add the Grafana repository to your APT sources using the

Continue reading this article
by subscribing to our newsletter.
Subscribe now