{"id":5297,"date":"2020-03-27T22:17:52","date_gmt":"2020-03-27T19:17:52","guid":{"rendered":"https:\/\/kifarunix.com\/?p=5297"},"modified":"2024-03-14T19:49:39","modified_gmt":"2024-03-14T16:49:39","slug":"install-latest-grafana-on-centos-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-latest-grafana-on-centos-8\/","title":{"rendered":"Install Latest Grafana on CentOS 8"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to install latest Grafana on CentOS 8. <a rel=\"noreferrer noopener\" aria-label=\"Grafana (opens in a new tab)\" href=\"https:\/\/grafana.com\/\" target=\"_blank\">Grafana<\/a>&nbsp;is 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<h2 class=\"wp-block-heading\">Installing Grafana on CentOS 8<\/h2>\n\n\n\n<p>There are different methods on how to install Grafana on CentOS 8. These include;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Installing Grafana automatically via YUM package manager<\/li>\n\n\n\n<li>Installing Grafana manually via RPM package manager<\/li>\n\n\n\n<li>Installing Grafana via Grafana Standalone Binary<\/li>\n<\/ul>\n\n\n\n<p>In this guide, we are going to learn how to install Grafana using all these three methods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">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\">Installing Grafana automatically via YUM Package Manager<\/h3>\n\n\n\n<p>To install Grafana automatically via YUM package manager, there are two ways;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the Grafana repos and install directly from these repos.<\/li>\n\n\n\n<li>Download Grafana RPM binary and install it using YUM package manager.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Installing Grafana from YUM repository<\/h4>\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 repos; Enterprise and Open-source software&nbsp;(OSS) repos. Our demo involves the use of the later.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &gt; \/etc\/yum.repos.d\/grafana.repo &lt;&lt; 'EOL'\n&#91;grafana]\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<\/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<p>Instead of creating Grafana repos as shown above, you would simply download latest stable release Grafana RPM binary from <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/grafana.com\/grafana\/download\" target=\"_blank\">Grafana downloads page<\/a> and install it using YUM package manager.<\/p>\n\n\n\n<p>Obtain the download link of the latest stable release version and pull the RPM binary using wget. Grafana 6.7.1 is the current stable release as of this writing.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/dl.grafana.com\/oss\/release\/grafana-6.7.1-1.x86_64.rpm<\/code><\/pre>\n\n\n\n<p>Once the download completes, install it as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install grafana-6.7.1-1.x86_64.rpm<\/code><\/pre>\n\n\n\n<p>You can as well install it directly without having to download it;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install https:\/\/dl.grafana.com\/oss\/release\/grafana-6.7.1-1.x86_64.rpm<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf localinstall https:\/\/dl.grafana.com\/oss\/release\/grafana-6.7.1-1.x86_64.rpm<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Grafana manually via RPM package manager<\/h2>\n\n\n\n<p>To manually install Grafana via RPM package manager, you have to download the latest RPM binary installer from the Grafana downloads page.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/dl.grafana.com\/oss\/release\/grafana-6.7.1-1.x86_64.rpm<\/code><\/pre>\n\n\n\n<p>Install required dependencies;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install initscripts urw-fonts -y<\/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 grafana-6.7.1-1.x86_64.rpm<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">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 <a rel=\"noreferrer noopener\" aria-label=\"Downloads page (opens in a new tab)\" href=\"https:\/\/grafana.com\/grafana\/download?platform=linux\" target=\"_blank\">Downloads page<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget&nbsp;https:\/\/dl.grafana.com\/oss\/release\/grafana-6.7.1.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<p>Once the download completes, you can extract the tarball to an appropriate directory. For example, to extract Grafana files to <strong><code>\/usr\/local\/grafana<\/code><\/strong> 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>tar xzf grafana-6.7.1.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 <code>\/usr\/local\/grafana<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls \/usr\/local\/grafana<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>bin<\/strong>  <strong>conf<\/strong>  LICENSE  NOTICE.md  <strong>public<\/strong>  README.md  <strong>scripts<\/strong>  <strong>tools<\/strong>  VERSION<\/code><\/pre>\n\n\n\n<p>Note that no initialization scripts are installed with this method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running Grafana<\/h2>\n\n\n\n<p>Depending on the installation method you choose, Grafana can be run in different ways.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Managing Grafana Service with Systemd<\/h3>\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<p>To start and enable Grafana to run on boot at the same time;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now grafana-server<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Managing Grafana Service with SysV<\/h3>\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<h3 class=\"wp-block-heading\">Managing Grafana Service with Standalone Binary<\/h3>\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\">Accessing Grafana from Web<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">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, <strong>http:\/\/grafana-server-IP:3000<\/strong>. Use the credentials <code><strong>admin<\/strong><\/code> for both username and password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"475\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/grafana-login.png\" alt=\"Install Latest Grafana on CentOS 8\" class=\"wp-image-5298\" title=\"\"><\/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=\"1349\" height=\"653\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/grafana-interface.png\" alt=\"\" class=\"wp-image-5299\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/grafana-interface.png?v=1585336148 1349w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/grafana-interface-768x372.png?v=1585336148 768w\" sizes=\"(max-width: 1349px) 100vw, 1349px\" \/><\/figure>\n\n\n\n<p>You have successfully installed Grafana on CentOS 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\">Reference<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\"Installing Grafana on RPM-based Linux (CentOS, Fedora, OpenSuse, Red Hat) systems (opens in a new tab)\" 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\">Related Tutorials<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/integrate-prometheus-with-grafana-for-monitoring\/\" target=\"_blank\">Integrate Prometheus with Grafana for Monitoring<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-grafana-plugins-behind-a-proxy-server\/\" target=\"_blank\">Install Grafana Plugins Behind a Proxy server<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-grafana-6-2-x-on-ubuntu-18-04-debian-9\/\" target=\"_blank\">Install Grafana 6.2.x on Ubuntu 18.04\/Debian 9<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-grafana-monitoring-tool-on-fedora-29\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Grafana Monitoring Tool on Fedora 29<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install latest Grafana on CentOS 8. Grafana&nbsp;is the open source analytics and monitoring solution that<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,301,121],"tags":[1142,1381,1383,1382,1384],"class_list":["post-5297","post","type-post","status-publish","format-standard","hentry","category-monitoring","category-grafana","category-howtos","tag-centos-8","tag-grafana-on-centos-8","tag-grafana-server-centos-8","tag-install-grafana-centos-8","tag-monitoring-with-grafana","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5297"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=5297"}],"version-history":[{"count":6,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5297\/revisions"}],"predecessor-version":[{"id":21337,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5297\/revisions\/21337"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=5297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=5297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=5297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}