Grafana is a free and open-source monitoring system that is used for monitoring and visualizing metrics from host machines. It provides intuitive and appealing dashboards, and analytics coupled with the ability to customize your own dashboards for monitoring your infrastructure. In this guide, we will show you how you can install Grafana on Ubuntu 18.04 and Debian 8. Let’s dive in.
Table of Contents
Step 1: Update the system
The first step in installing Grafana is to update system repositories. Log in as a sudo user using SSH and execute the following commands.
# sudo apt update -y
Next, upgrade the system
# sudo apt upgrade -y
Step 2: Add Grafana APt repository
The next step will involve adding Grafana’s APT repository.
For Ubuntu 18.04
But first, add the GPG key which will allow you to install signed packages
curl https://packages.grafana.com/gpg.key | sudo apt-key add -
Next, add the Grafana APT repository as shown
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
Step 3: Install Grafana
Once the repository has been added, update the system repositories
sudo apt update
Next, install Grafana server
# sudo apt install grafana -y
By default, Grafana should be running by default once installed. Additionally, you can check it’s status by running
# systemctl status grafana-server
If grafana is disabled, you can start it an enable it on boot by executing:
# systemctl start grafana-server
# systemctl enable grafana-server
Step 4: Allowing port 3000 on the UFW firewall
By default, Grafana listens to port 3000 on the UFW firewall. This can be verified using the
netstat command as shown
# netstat -pnltu
To allow the port on the firewall run:
# ufw allow 3000/tcp
# ufw reload
To confirm that you have successfully allowed the port on the firewall, check the firewall status using the command:
# ufw status
Step 5: Accessing Grafana Server
The final step is accessing Grafana via the web browser. To do this, first launch your favorite web browser and browse your server’s URL as shown
This displays a login page as shown below
The default credentials are :
Once you’ve entered the credentials, you will be prompted to change the credentials with a more secure password to safeguard your system. Once done, click on the ‘Save‘ button.
Grafana’s dashboard will be displayed as shown.
Reference: Grafana official website