Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building IoT Visualizations using Grafana

You're reading from   Building IoT Visualizations using Grafana Power up your IoT projects and monitor with Prometheus, LibreNMS, and Elasticsearch

Arrow left icon
Product type Paperback
Published in Jul 2022
Publisher Packt
ISBN-13 9781803236124
Length 360 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Rodrigo Juan Hernandez Rodrigo Juan Hernandez
Author Profile Icon Rodrigo Juan Hernandez
Rodrigo Juan Hernandez
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1: Meeting Grafana
2. Chapter 1: Getting Started with Grafana FREE CHAPTER 3. Chapter 2: Exploring Grafana 4. Part 2: Collecting Data from IoT Devices
5. Chapter 3: Connecting IoT Devices 6. Chapter 4: Data Sources for Grafana 7. Chapter 5: Using Time Series Databases 8. Part 3: Connecting Data Sources and Building Dashboards
9. Chapter 6: Getting Data and Building Dashboards 10. Chapter 7: Managing Plugins 11. Chapter 8: Organizing and Managing Dashboards 12. Part 4: Performing Analytics and Notifications
13. Chapter 9: Performing Analytics in Grafana 14. Chapter 10: Alerting and Notifications in Grafana 15. Part 5: Integrating Grafana with Other Platforms
16. Chapter 11: Using Grafana with Prometheus 17. Chapter 12: Using Grafana with OpenSearch 18. Chapter 13: Showing Data from LibreNMS in Grafana 19. Chapter 14: Integrations for Grafana Cloud 20. Other Books You May Enjoy

Installing Grafana on Ubuntu Server

Ubuntu is one of the most popular operating systems for servers, so we will learn how to install Grafana on it.

Installing Grafana on Ubuntu is a very straightforward procedure because there are Ubuntu packages.

Installation instructions

Let’s look at what we need to do here:

  1. As before, we first run updates:
    $ sudo apt-get update 
    $ sudo apt-get upgrade
  2. Next, if you do not have wget installed on your server, you can install it as follows:
    $ sudo apt-get install apt-transport-https
    $ sudo apt-get install software-properties-common wget
  3. Then you can use wget to download the GPG key and add it to the APT keys. In this way, you authorize Grafana packages to be installed on the system:
    $ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add –
  4. After that, you can add the Grafana repository (stable release) to the APT source list:
    $ echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
  5. Finally, run the following commands:
    $ sudo apt-get update
    $ sudo apt-get install grafana

Now that you have installed Grafana on Ubuntu Server, let’s see how to run it.

Running Grafana on Ubuntu Server

There are two ways of running Grafana as a service. Let’s have a look at them.

Running Grafana using systemd

Grafana services can be managed by systemd.

To start Grafana, simply execute the following:

$ sudo systemctl start grafana-server

To see the Grafana service status, run this command:

$ sudo systemctl status grafana-server

To stop the service, use this command:

$ sudo systemctl stop grafana-server

And to enable start at boot, use this command:

$ sudo systemctl enable grafana-server.service

Now that you know how to do it with systemd, let’s see how to do it with initd.

Running Grafana with initd

You can run Grafana as follows:

$ sudo service grafana-server start

To stop Grafana, use this command:

$ sudo service grafana-server stop

To get the service status, run this command:

$ sudo service grafana-server status

To configure it to start at boot, use the following command:

$ sudo update-rc.d grafana-server defaults

You have now installed and executed Grafana on Ubuntu Server. You also configured it to start on boot. Now let’s see how to access Grafana from a browser.

Accessing Grafana

Before trying to access Grafana, make sure that the service is running. You can check it using the preceding commands. If it is stopped, you must start it as shown earlier.

As soon as you have Grafana installed and running, you can access it by pointing the browser to http://your-server-ip-or-name:3000.

The default credentials are admin/admin.

Now that you have learned how to install and run Grafana on Ubuntu Server as well as how to manage start-up at boot using two different methods, let’s move on to the next section, where you will learn how to deploy Grafana using Docker.

You have been reading a chapter from
Building IoT Visualizations using Grafana
Published in: Jul 2022
Publisher: Packt
ISBN-13: 9781803236124
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime