{"id":9527,"date":"2021-07-08T21:50:03","date_gmt":"2021-07-08T18:50:03","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9527"},"modified":"2024-05-06T20:54:32","modified_gmt":"2024-05-06T17:54:32","slug":"install-grafana-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-grafana-on-rocky-linux-8\/","title":{"rendered":"Install Grafana on Rocky Linux 8"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to install Grafana on Rocky Linux 8.\u00a0<a href=\"https:\/\/grafana.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Grafana<\/a>\u00a0is the open source analytics and monitoring solution that enables you to query, visualize and alert on various systems metrics that can be pulled from various time series databases such as Graphite, InfluxDB &amp; Prometheus etc.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#installing-grafana-on-rocky-linux-8\">Installing Grafana on Rocky Linux 8<\/a><ul><li><a href=\"#runs-system-update\">Runs system update<\/a><\/li><li><a href=\"#installing-grafana-from-yum-repository\">Installing Grafana from YUM Repository<\/a><\/li><li><a href=\"#installing-grafana-manually-via-rpm-package-manager\">Installing Grafana manually via RPM package manager<\/a><\/li><li><a href=\"#installing-grafana-via-grafana-standalone-binary\">Installing Grafana via Grafana Standalone Binary<\/a><\/li><li><a href=\"#running-grafana\">Running Grafana<\/a><ul><li><a href=\"#managing-grafana-service-with-systemd\">Managing Grafana Service with Systemd<\/a><\/li><li><a href=\"#managing-grafana-service-with-sys-v\">Managing Grafana Service with SysV<\/a><\/li><li><a href=\"#managing-grafana-service-with-standalone-binary\">Managing Grafana Service with Standalone Binary<\/a><\/li><\/ul><\/li><li><a href=\"#accessing-grafana-from-web\">Accessing Grafana from Web<\/a><ul><li><a href=\"#open-grafana-port-on-firewall\">Open Grafana Port on Firewall<\/a><\/li><\/ul><\/li><li><a href=\"#reference\">Reference<\/a><\/li><li><a href=\"#other-tutorials\">Other Tutorials<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-grafana-on-rocky-linux-8\">Installing Grafana on Rocky Linux 8<\/h2>\n\n\n\n<p>There are different methods on how to install Grafana. These include;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#grafana-repo\">Installing Grafana automatically from Grafana YUM Repos<\/a><\/li>\n\n\n\n<li><a href=\"#grafana-rpm\">Installing Grafana manually via RPM package manager<\/a><\/li>\n\n\n\n<li><a href=\"#grafana-binary\">Installing Grafana via Grafana Standalone Binary<\/a><\/li>\n<\/ul>\n\n\n\n<p>In this guide, we are going to learn how to demonstrate how to install Grafana using all these three methods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"runs-system-update\">Runs system update<\/h3>\n\n\n\n<p>To begin with, update your system packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-grafana-from-yum-repository\">Installing Grafana from YUM Repository<\/h3>\n\n\n\n<p>To install Grafana from YUM repository, you need to create YUM repos as follows<\/p>\n\n\n\n<p>Well, there are two kinds of repos; <strong>Enterprise<\/strong> and <strong>Open-source software&nbsp;(OSS)<\/strong> repos.<\/p>\n\n\n\n<p>In this demo, we are installing the Open source version of Grafana.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\ncat > \/etc\/yum.repos.d\/grafana.repo << 'EOL'\nname=grafana\nbaseurl=https:\/\/packages.grafana.com\/oss\/rpm\nrepo_gpgcheck=1\nenabled=1\ngpgcheck=1\ngpgkey=https:\/\/packages.grafana.com\/gpg.key\nsslverify=1\nsslcacert=\/etc\/pki\/tls\/certs\/ca-bundle.crt\nEOL\n<\/code><\/pre>\n\n\n\n<p>Once the repos are in place, run the command below to install Grafana.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install grafana -y<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-grafana-manually-via-rpm-package-manager\">Installing Grafana manually via RPM package manager<\/h3>\n\n\n\n<p>Instead of creating Grafana repos as shown above, you would simply download latest stable release Grafana RPM binary from&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/grafana\/download\" target=\"_blank\">Grafana downloads page<\/a>&nbsp;and install it using YUM package manager.<\/p>\n\n\n\n<p>Grafana 8.0.5 is the current stable release as of this writing.<\/p>\n\n\n\n<p>Obtain the link of the latest stable release version install Grafana by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install <a href=\"https:\/\/dl.grafana.com\/oss\/release\/grafana-8.0.5-1.x86_64.rpm\" target=\"_blank\" rel=\"noopener\">https:\/\/dl.grafana.com\/oss\/release\/grafana-8.0.5-1.x86_64.rpm<\/a><\/code><\/pre>\n\n\n\n<p>Similarly, you can download the RPM package and install it as follows;<\/p>\n\n\n\n<p>First, Install required dependencies;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install initscripts urw-fonts wget -y<\/code><\/pre>\n\n\n\n<p>Next, download and install Grafana.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget <a href=\"https:\/\/dl.grafana.com\/oss\/release\/grafana-8.0.5-1.x86_64.rpm\" target=\"_blank\" rel=\"noopener\">https:\/\/dl.grafana.com\/oss\/release\/grafana-8.0.5-1.x86_64.rpm<\/a><\/code><\/pre>\n\n\n\n<p>Then install Grafana as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rpm -Uvh <a href=\"https:\/\/dl.grafana.com\/oss\/release\/grafana-8.0.5-1.x86_64.rpm\" target=\"_blank\" rel=\"noopener\">grafana-8.0.5-1.x86_64.rpm<\/a><\/code><\/pre>\n\n\n\n<p>Any of the methods:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Installs binary to&nbsp;<code>\/usr\/sbin\/grafana-server<\/code><\/li>\n\n\n\n<li>Copies init.d script to&nbsp;<code>\/etc\/init.d\/grafana-server<\/code><\/li>\n\n\n\n<li>Installs default file (environment vars) to&nbsp;<code>\/etc\/sysconfig\/grafana-server<\/code><\/li>\n\n\n\n<li>Copies configuration file to&nbsp;<code>\/etc\/grafana\/grafana.ini<\/code><\/li>\n\n\n\n<li>Installs systemd service (if systemd is available) name&nbsp;<code>grafana-server.service<\/code><\/li>\n\n\n\n<li>The default configuration uses a log file at&nbsp;<code>\/var\/log\/grafana\/grafana.log<\/code><\/li>\n\n\n\n<li>The default configuration specifies an sqlite3 database at&nbsp;<code>\/var\/lib\/grafana\/grafana.db<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-grafana-via-grafana-standalone-binary\">Installing Grafana via Grafana Standalone Binary<\/h3>\n\n\n\n<p>Grafana has a ready made standalone Linux binary tarball that can simply downloaded and installed on an appropriate Grafana directory.<\/p>\n\n\n\n<p>Download the latest standalone binary tarball from&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/grafana\/download?platform=linux\" target=\"_blank\">Downloads page<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>VER=8.0.5<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget&nbsp;https:\/\/dl.grafana.com\/oss\/release\/grafana-$VER.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<p>Once the download completes, you can extract the tarball to an appropriate directory.<\/p>\n\n\n\n<p>For example, to extract Grafana files to&nbsp;<strong><code>\/usr\/local\/grafana<\/code><\/strong>&nbsp;directory;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mkdir \/usr\/local\/grafana<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install tar -y<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tar xzf grafana-$VER.linux-amd64.tar.gz --strip-components=1 -C \/usr\/local\/grafana<\/code><\/pre>\n\n\n\n<p>You should now have your Grafana and its configuration files on&nbsp;<code>\/usr\/local\/grafana<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls -1 \/usr\/local\/grafana<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>bin\nconf\nLICENSE\nNOTICE.md\nplugins-bundled\npublic\nREADME.md\nscripts\nVERSION<\/code><\/pre>\n\n\n\n<p>Note that no initialization scripts are installed with this method.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"running-grafana\">Running Grafana<\/h3>\n\n\n\n<p>Depending on the installation method you choose, Grafana can be run in different ways.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"managing-grafana-service-with-systemd\">Managing Grafana Service with Systemd<\/h4>\n\n\n\n<p>Reload the systemd manager configuration.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p>To start, stop, restart, check status or enable Grafana server to run on system boot, run the commands below respectively.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl start grafana-server<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl stop grafana-server<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart grafana-server<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable grafana-server<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status grafana-server<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"managing-grafana-service-with-sys-v\">Managing Grafana Service with SysV<\/h4>\n\n\n\n<p>To start, stop, check status or enable Grafana to run on system boot, run the commands below respectively;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service grafana-server start<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service grafana-server stop<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service grafana-server status<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chkconfig --add grafana-server<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"managing-grafana-service-with-standalone-binary\">Managing Grafana Service with Standalone Binary<\/h4>\n\n\n\n<p>If you installed using the standalone Linux binary, then you need to navigate to the directory on which you extracted its configuration files to and execute the Grafana server binary as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cd \/usr\/local\/grafana<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>.\/bin\/grafana-server web<\/code><\/pre>\n\n\n\n<p>You can stop by pressing Ctrl+c.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"accessing-grafana-from-web\">Accessing Grafana from Web<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"open-grafana-port-on-firewall\">Open Grafana Port on Firewall<\/h4>\n\n\n\n<p>Grafana listens on TCP port 3000 by default. To allow external access, open the port on FirewallD.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --add-port=3000\/tcp --permanent<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p>You can then access Grafana via the url,&nbsp;<strong>http:\/\/grafana-server-IP:3000<\/strong>.<\/p>\n\n\n\n<p>Use the credentials&nbsp;<code><strong>admin<\/strong><\/code>&nbsp;for both username and password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1113\" height=\"787\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/grafana-interface.png\" alt=\"\" class=\"wp-image-9544\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/grafana-interface.png?v=1625769405 1113w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/grafana-interface-768x543.png?v=1625769405 768w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/><\/figure>\n\n\n\n<p>Reset the password when prompted and proceed to Grafana interface.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1878\" height=\"946\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/grafana-dashboard.png\" alt=\"Install Grafana on Rocky Linux 8\" class=\"wp-image-9545\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/grafana-dashboard.png?v=1625769462 1878w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/grafana-dashboard-768x387.png?v=1625769462 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/grafana-dashboard-1536x774.png?v=1625769462 1536w\" sizes=\"(max-width: 1878px) 100vw, 1878px\" \/><\/figure>\n\n\n\n<p>You have successfully installed Grafana on Rocky Linux 8. In our next guide, we will cover how to visualize various system metrics with Grafana. Stay connected.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"reference\">Reference<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/installation\/rpm\/\" target=\"_blank\">Installing Grafana on RPM-based Linux (CentOS, Fedora, OpenSuse, Red Hat) systems<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"other-tutorials\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/configure-grafana-email-alerting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Configure Grafana Email Alerting<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/monitor-ssl-tls-certificate-expiry-with-prometheus-and-grafana\/\" target=\"_blank\" rel=\"noreferrer noopener\">Monitor SSL\/TLS Certificate Expiry with Prometheus and Grafana<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/monitoring-gitlab-metrics-with-prometheus-and-grafana\/\" target=\"_blank\" rel=\"noreferrer noopener\">Monitoring Gitlab Metrics with Prometheus and Grafana<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install Grafana on Rocky Linux 8.\u00a0Grafana\u00a0is the open source analytics and monitoring solution that enables<\/p>\n","protected":false},"author":3,"featured_media":9547,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,301,121],"tags":[302,3815,3814,3587],"class_list":["post-9527","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-grafana","category-howtos","tag-grafana","tag-grafana-on-rocky-linux-8","tag-install-grafana-rocky-linux-8","tag-rocky-linux-8","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9527"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=9527"}],"version-history":[{"count":7,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9527\/revisions"}],"predecessor-version":[{"id":22461,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9527\/revisions\/22461"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/9547"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=9527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=9527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=9527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}