Installing Grafana on Centos/Ubuntu

Grafana is a a popular open source application for visualizing large-scale timescale data . It support all the popular  time-series databases like Influxdb, Graphite and Prometheus.
Grafana UI is beautiful and its very easy to create dashboards using data stored in the Backend databases. This guide provides an introduction to the installation of Grafana on Centos and Ubuntu Operating Systems.

How to install Grafana on Ubuntu?

We will use “apt-get” package manager to install Grafana on Ubuntu machine

First, Add the following line to  /etc/apt/sources.list file on your machine

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

Now let us add the Package Cloud key. This allows you to install signed packages.

curl https://packagecloud.io/gpg.key | sudo apt-key add –

Update the apt-get Repositories to include the newly added repo

sudo apt-get update

Now Install Grafana

sudo apt-get install grafana

Once installation finixed successfull, you will be able see the binary file at “/usr/sbin/grafana-server”

Now we will start Grafana service (using init.d service)

sudo service grafana-server start

By defualt Grafana server will bind on port number 3000 and you should be able to launch Grafana UI by using the URL

http://127.0.0.1:3000

To configure the Grafana server to start at boot time:

sudo update-rc.d grafana-server defaults

To Start it using systemctl,

systemctl start grafana-server

Enable the systemd service so that Grafana starts at boot.

sudo systemctl enable grafana-server.service

How to install Grafana on Centos?

We can install Grafana on Centos using yum . There are multiple ways to do this

Running yum directly

yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.4-1464167696.x86_64.rpm

Using Yum repository

Add the following to a new file at /etc/yum.repos.d/grafana.repo

[grafana]
name=grafana
baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

Then install using

yum install grafana

Start the server (On Centos6)

service grafana-server start

configure Grafana to start on boot time

chkconfig –add grafana-server

Start Grafana On Centos7

systemctl start grafana

Configure Grafana to start on boot time

systemctl enable grafana

Leave a Reply

Your email address will not be published. Required fields are marked *