Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building IoT Visualizations using Grafana

You're reading from  Building IoT Visualizations using Grafana

Product type Book
Published in Jul 2022
Publisher Packt
ISBN-13 9781803236124
Pages 360 pages
Edition 1st Edition
Languages
Author (1):
Rodrigo Juan Hernández Rodrigo Juan Hernández
Profile icon Rodrigo Juan Hernández

Table of Contents (21) Chapters

Preface Part 1: Meeting Grafana
Chapter 1: Getting Started with Grafana Chapter 2: Exploring Grafana Part 2: Collecting Data from IoT Devices
Chapter 3: Connecting IoT Devices Chapter 4: Data Sources for Grafana Chapter 5: Using Time Series Databases Part 3: Connecting Data Sources and Building Dashboards
Chapter 6: Getting Data and Building Dashboards Chapter 7: Managing Plugins Chapter 8: Organizing and Managing Dashboards Part 4: Performing Analytics and Notifications
Chapter 9: Performing Analytics in Grafana Chapter 10: Alerting and Notifications in Grafana Part 5: Integrating Grafana with Other Platforms
Chapter 11: Using Grafana with Prometheus Chapter 12: Using Grafana with OpenSearch Chapter 13: Showing Data from LibreNMS in Grafana Chapter 14: Integrations for Grafana Cloud 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 $15.99/month. Cancel anytime}