How to Install Grafana on Ubuntu 20.04

Install Grafana on Ubuntu 20.04

In this article, we will have explained the necessary steps to install and configure Grafana on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Grafana is a feature-rich metrics dashboard and graph editor monitoring that integrates with complex data from sources like Prometheus, ElasticSearch. Grafana lets you create alerts, notifications, and ad-hoc filters for your data while also making collaboration with your teammates easier through built-in sharing features.

Install Grafana on Ubuntu 20.04

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade

Step 2. Install Grafana on the Ubuntu system.

Installation of Grafana is actually quite easy. First, dd Grafana GPG key which allows you to install signed packages:

sudo apt-get install -y gnupg2 curl  software-properties-common
curl | sudo apt-key add -

Next, add the Grafana repository to your APT sources:

sudo add-apt-repository "deb stable main"

Once the repository is added, proceed to update your Apt repositories and install Grafana:

sudo apt update
sudo apt install grafana

When the installation completes, start and enable Grafana with the commands:

sudo systemctl enable --now grafana-server

Step 3. Configure Firewall.

You’ll need to allow access to port 3000 on the firewall. Ubuntu comes with ufw firewall:

sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 3000/tcp

Step 4. Accessing Grafana Web Interface.

Once installation is complete, point a web browser to http://SERVER_IP:3000 (where SERVER_IP is the IP address of the hosting Grafana server) or http://Your-Domain:3000. You’ll be prompted for the default login credentials, which are: admin/admin.

That’s all you need to do to install Grafana on Ubuntu 20.04 Focal Fossa. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.