Good day all. Welcome to our guide on how to install Grafana data visualization tool on Ubuntu 18.04. Grafana is an opensource tool for visualizing data collected from different types of data stores such as Prometheus, InfluxDB, Elasticsearch, Graphite, MySQL and several other databases.
Install Grafana Data Visualization Tool on Ubuntu 18.04
The default Ubuntu 18.04 repositories do not have the Grafana package. Hence, in order to install Grafana data visualization tool on Ubuntu 18.04, you can either of the following methods:
Before you can check these methods, it would be a good idea to update system packages.
sudo apt update sudo apt upgrade
Installing Grafana using DEB file
Download the latest Grafana DEB file from Grafana Downloads page.
wget https://dl.grafana.com/oss/release/grafana_5.4.2_amd64.deb
Once the package is downloaded, you can install it using the apt
package manager. This will take care of the required dependencies.
sudo apt install ./grafana_5.4.2_amd64.deb
If the installation completes successfully, such an output will be displayed.
Processing triggers for systemd (237-3ubuntu10.11) ........................] Setting up grafana (5.4.2) ... ### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable grafana-server ### You can start grafana-server by executing sudo /bin/systemctl start grafana-server Processing triggers for systemd (237-3ubuntu10.11) ... Processing triggers for ureadahead (0.100.0-20) ...
Installing Grafana from APT repository
This method involves the use of APT repository. Hence, create Grafana source list with the following content;
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
Import the Grafana GPG APT key.
curl https://packages.grafana.com/gpg.key | sudo apt-key add - % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1694 100 1694 0 0 632 0 0:00:02 0:00:02 --:--:-- 632 OK
After that, update your system APT repositories
sudo apt update
Install Grafana using the APT package manager.
apt install grafana
Just like the installation output shown above, it is similar for this method;
... Setting up grafana (5.4.2) ... ### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable grafana-server ### You can start grafana-server by executing sudo /bin/systemctl start grafana-server Processing triggers for systemd (237-3ubuntu10.11) ... Processing triggers for ureadahead (0.100.0-20) ...
Grafana v6.2.1 has been released. Check the installation guide by following the lini below;
Install Grafana 6.2.x on Ubuntu 18.04/Debian 9
Start Grafana Server service
As stated on the install output, run the commands above to reload systemd unit configuration file, start and enable Grafana to run on system reboot.
sudo systemctl daemon-reload sudo systemctl start grafana-server sudo systemctl enable grafana-server
You might want to check the state of Grafana Server service by executing the command below;
sudo systemctl status grafana-server ● grafana-server.service - Grafana instance Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-01-14 18:31:48 EAT; 1min 15s ago Docs: http://docs.grafana.org Main PID: 32204 (grafana-server) Tasks: 8 (limit: 1110) CGroup: /system.slice/grafana-server.service ...
Beautiful, Grafana is ready to show its beautiful part.
To access the Grafana default dashboard from web interface, use the URL http://server-IP:3000
. Be sure to open Grafana default port, TCP port 3000 on firewall.
sudo ufw allow 3000/tcp
To login to Grafana User Interface, use admin
as the login username and password. Upon successful login, change admin password and continue to Grafana default dashboard.
Congratulations. That is all it takes to Install Grafana Data Visualization Tool on Ubuntu 18.04. In our next tutorial, we will learn how to add various data sources to Grafana for system metrics visualization and analysis. Happy monitoring.
You can check our other guides by following the links below;