How To Install Grafana Monitoring Tool on Ubuntu 18.04 LTS

How To Install Grafana Monitoring Tool on Ubuntu 18.04 LTS

Introduction

Grafana is an open source, enterprise-level monitoring system that is supported by Graphite, Prometheus, InfluxDB, Elasticsearch, and other databases. With this tool, it’s easy to create your dashboard to manage apps or for the purpose of monitoring infrastructure performance.

In this article, we will take you through the Installation process of Grafana on Ubuntu 18.04 LTS.

Prerequisites

Before you begin, you will need the following:

  • A virtual machine running on Ubuntu 18.04 server
  • A non-root user with sudo privileges

If everything is set, then let’s start the installation process.

Step 1-
Installing Grafana

Grafana is not available in Ubuntu’s default repository. Therefore, to get started, you must add grafana repository to Ubuntu 18.04 system.

$ sudo nano /etc/apt/sources.list

This will a file with detailed content. Now copy the line below and paste it after the last line of the file’s content.

deb https://packagecloud.io/grafana/stable/debian/ stretch main

Now, save and exit the file.

Next, execute the command below to download the  GNU Privacy Guard (GPG) key.

$ sudo curl https://packagecloud.io/gpg.key

The key, will be downloaded automatically, but you need to execute the command below to install it.

$ sudo apt-key add -

The next step is to perform an update on Grafana repository, then install the application using the command below:

$ sudo apt-get update -y
$ sudo apt-get install grafana -y

After the installation process is complete, you will get an output similar to the one below:

Preparing to unpack .../grafana_5.1.3_amd64.deb ...
Unpacking grafana (5.1.3) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10) ...
Setting up grafana (5.1.3) ...
Adding system user `grafana' (UID 112) ...
Adding new user `grafana' (UID 112) with group `grafana' ...
Not creating home directory `/usr/share/grafana'.
### 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 ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10) ...

Now, execute the commands below to start Grafana and enable it so that it starts on boot time:

$ sudo systemctl daemon-reload
$ sudo systemctl enable grafana-server
$ sudo systemctl start grafana-server

Go ahead and check Grafana status:

$ sudo systemctl status grafana-server

The output should look like this:

? grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-06-13 15:43:13 UTC; 11s ago
     Docs: http://docs.grafana.org
 Main PID: 19946 (grafana-server)
    Tasks: 8 (limit: 1114)
   CGroup: /system.slice/grafana-server.service
           ??19946 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid cfg:default.paths.l

Jun 13 15:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Executing migration" logger=migrator id="createuser
Jun 1315:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Executing migration" logger=migrator id="create inde
Jun 13 15:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Executing migration" logger=migrator id="alter user_
Jun 1315:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Created default admin user: admin"
Jun 1315:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Starting plugin search" logger=plugins
Jun 1315:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Plugin dir created" logger=plugins dir=/var/lib/graf
Jun 1315:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Initializing Alerting" logger=alerting.engine
Jun 1315:43:19 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:19+0000 lvl=info msg="Initializing CleanUpService" logger=cleanup
Jun 1315:43:20 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:20+0000 lvl=info msg="Initializing Stream Manager"
Jun 1315:43:20 ubuntu1804 grafana-server[19946]: t=2018-06-13T15:43:20+0000 lvl=info msg="Initializing HTTP Server" logger=http.server address
lines1-19/19 (END)

Once you get this, now try to access Grafana.

Step 2 –
Accessing Grafana

Now that Grafana is fully installed and successfully configured, try to access its dashboard.

To do so, go to your browser and enter the address http://your-server-ip:3000. You should be directed to a new page that looks like the one below:

How To Install Grafana Monitoring Tool on Ubuntu 18.04 LTS

Enter your admin credentials (username and password) for Grafana, in this case, use “admin” on both cases, then press the Log In. The Grafana dashboard should appear as shown below:

How To Install Grafana Monitoring Tool on Ubuntu 18.04 LTS

Now, everything is set and you have successfully installed Grafana monitoring tool on Ubuntu 18.04 LTS.

Conclusion

Congratulations! Grafana is now up and running and set to update you on what is happening with the systems and servers in your data center.

This monitoring system eliminates the guesswork on the actual activities taking place in your Linux machines as well as the services they offer. We hope it will be worth your time.

Check out these top 3 Linux hosting services

FastComet
$1.79 /mo
Starting price
Visit FastComet
Rating based on expert review
  • User Friendly
    4.7
  • Support
    5.0
  • Features
    4.8
  • Reliability
    4.5
  • Pricing
    5.0
HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
Hostinger
$2.99 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7

How to Install Own Cloud On an an Ubuntu 18.04 Dedicated Server or VPS

You can create your own self-hosted cloud storage services by installing the ope
3 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to Enable Two-Factor Authentication on an Ubuntu 18.04 VPS or Dedicated Server

This guide will show you how you enable two-factor authentication to improve the
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Install a Let’s Encrypt Certificate on your Ubuntu 18.04 Dedicated Server or VPS

If you are hosting your website on a VPS server running Ubuntu 18.04, we will sh
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to install OpenLiteSpeed on an Ubuntu 18.04 VPS or Dedicated Server

OpenLiteSpeed is an open source web server characterized by high-performance, li
3 min read
Kennedy Mbuvi
Kennedy Mbuvi
Author
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top