(Last Updated On: April 18, 2019)

In this post, I’ll walk you through the installation of Grafana 6 on Ubuntu / Debian. Grafana v6 is out and it can be installed on Ubuntu, Debian and Red Hat based Linux distributions.

Grafana is an open source tool which allows you to query, visualize, alert on and understand your metrics no matter where they are stored. It enables you to easily create, explore, and share dashboards with your team and foster a data-driven culture.

For CentOS 7, check: How to Install Grafana 6 on CentOS 7

Step 1: Update system

Ensure your Ubuntu / Debian system is up to date.

sudo apt-get update
sudo apt-get upgrade
sudo reboot

Step 2: Add Grafana 6 APT repository

Add Grafana gpg key which allows you to install signed packages.

curl https://packages.grafana.com/gpg.key | sudo apt-key add -

Then install Grafana APT repository:

sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

If your system is missing , check How to Install add-apt-repository on Debian / Ubuntu

There is a separate repository if you want beta releases.

sudo add-apt-repository "deb https://packages.grafana.com/oss/deb beta main"

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

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

Start grafana service.

sudo systemctl start grafana-server
sudo systemctl enable grafana-server

The grafana-service should now be running.

$ systemctl status grafana-server
grafana-server.service - Grafana instance
Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2019-04-18 10:49:09 PDT; 1min 38s ago
Docs: http://docs.grafana.org
Main PID: 4064 (grafana-server)
Tasks: 10 (limit: 1110)
CGroup: /system.slice/grafana-server.service
`-4064 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:defa
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing RemoteCache" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing ServerLockService" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing TracingService" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing UsageStatsService" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing UserAuthTokenService" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing CleanUpService" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing NotificationService" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing ProvisioningService" logger=server
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="Initializing Stream Manager"
Apr 18 10:49:15 ubuntu-01 grafana-server[4064]: t=2019-04-18T10:49:15-0700 lvl=info msg="HTTP Server Listen" logger=http.server address=0.0.0.0:300

Ensure the service is set to run on boot.

sudo systemctl enable grafana-server

Step 3: Access Grafana 6 UI

Once the service has been started, you can access its web dashboard by visiting the server IP on port 3000.

If you have an active firewall, mostly ufw, allow port 3000 on the firewall.

sudo ufw allow proto tcp from any to any port 3000

Now open your browser and enter server IP address and port 3000.

Default logins are:

Username: admin
Password: admin

But you’re required to change immediately after authenticating.

Grafana Package details:

  • Installs binary to /usr/sbin/grafana-server
  • Installs Init.d script to /etc/init.d/grafana-server
  • Creates default file (environment vars) to /etc/default/grafana-server
  • Installs configuration file to /etc/grafana/grafana.ini
  • Installs systemd service (if systemd is available) name grafana-server.service
  • The default configuration sets the log file at /var/log/grafana/grafana.log
  • The default configuration specifies a sqlite3 db at /var/lib/grafana/grafana.db
  • Installs HTML/JS/CSS and other Grafana files at /usr/share/grafana

The systemd service file and init.d script both use environment vars on the file located at /etc/default/grafana-server.

Next steps include looking at Adding data sources

Step 4: Monitoring with Grafana

See our sample guides on how you can monitor your infrastructure using Grafana.

Monitor Linux System with Grafana and Telegraf

Monitoring Ceph Cluster with Prometheus and Grafana

How to Monitor BIND DNS server with Prometheus and Grafana

Monitoring MySQL / MariaDB with Prometheus in five minutes

How to Monitor Apache Web Server with Prometheus and Grafana in 5 minutes

How to Monitor Linux Server Performance with Prometheus and Grafana in 5 minutes