{"id":3130,"date":"2019-05-27T21:06:28","date_gmt":"2019-05-27T18:06:28","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3130"},"modified":"2024-03-11T22:45:01","modified_gmt":"2024-03-11T19:45:01","slug":"install-grafana-on-ubuntu","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-grafana-on-ubuntu\/","title":{"rendered":"Install Grafana on Ubuntu 22.04\/20.04\/18.04"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to install Grafana on Ubuntu 22.04\/20.04\/18.04 servers. <em>Grafana<\/em>&nbsp;is the open source analytics &amp; monitoring solution for every database.<\/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-ubuntu-22-04-20-04-18-04\">Installing Grafana on Ubuntu 22.04\/20.04\/18.04<\/a><ul><li><a href=\"#run-system-update\">Run System Update<\/a><\/li><li><a href=\"#installing-grafana-using-deb-package\">Installing Grafana using DEB Package<\/a><\/li><li><a href=\"#installing-grafana-from-apt-repository\">Installing Grafana from APT Repository<\/a><\/li><li><a href=\"#running-grafana-on-ubuntu-22-04-20-04-18-04\">Running Grafana on Ubuntu 22.04\/20.04\/18.04<\/a><\/li><li><a href=\"#access-grafana-ui\">Access Grafana UI<\/a><\/li><li><a href=\"#naviagate-through-grafana-menu\">Naviagate through Grafana Menu<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-grafana-on-ubuntu-22-04-20-04-18-04\">Installing Grafana on Ubuntu 22.04\/20.04\/18.04<\/h2>\n\n\n\n<p>There exist different editions of Grafana. There is <a href=\"https:\/\/grafana.com\/products\/enterprise\/\" target=\"_blank\" rel=\"noreferrer noopener\">Grafana Enterprise<\/a> and Grafana opensource (OSS).<\/p>\n\n\n\n<p>We will be installing Grafana OSS version in this guide.<\/p>\n\n\n\n<p>Grafana can be installed using the DEB binary or directly from the APT repository.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#installing-grafana-using-deb-package\">Install Grafana using DEB Binary Package<\/a><\/li>\n\n\n\n<li><a href=\"#installing-grafana-from-apt-repository\">Install Grafana from APT repository<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"run-system-update\">Run System Update<\/h3>\n\n\n\n<p>Before you can proceed to install Grafana, ensure that your system packages are up-to-date.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-grafana-using-deb-package\">Installing Grafana using DEB Package<\/h3>\n\n\n\n<p>To install Grafana using DEB binary package;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigate to &nbsp;<a href=\"https:\/\/grafana.com\/grafana\/download\" target=\"_blank\" rel=\"noreferrer noopener\">Grafana downloads page<\/a>;<\/li>\n\n\n\n<li>Select the current release version of Grafana<\/li>\n\n\n\n<li>Select the edition, Enterprise or OSS (this guide installs OSS)<\/li>\n\n\n\n<li>Copy the Grafana download and execute it on the system you are installing Grafana on;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/dl.grafana.com\/oss\/release\/grafana_9.4.7_amd64.deb<\/code><\/pre>\n\n\n\n<p>Once the download is done, verify the integrity of the downloaded package by calculating its checksum and comparing it to the one provided on the downloads page;<\/p>\n\n\n\n<p>Update the version according to the current releases.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VER=9.4.7<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sha256sum grafana_${VER}_amd64.deb <\/code><\/pre>\n\n\n\n<p>Compare the resulting hash value with the value on the download&#8217;s page.<\/p>\n\n\n\n<p>If all is well, proceed to install Grafana as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install .\/grafana_${VER}_amd64.deb<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>Reading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\nNote, selecting 'grafana' instead of '.\/grafana_9.4.7_amd64.deb'\nThe following additional packages will be installed:\n  fontconfig-config fonts-dejavu-core libfontconfig1\nThe following NEW packages will be installed:\n  fontconfig-config fonts-dejavu-core grafana libfontconfig1\n0 upgraded, 4 newly installed, 0 to remove and 79 not upgraded.\nNeed to get 1,202 kB\/85.2 MB of archives.\nAfter this operation, 312 MB of additional disk space will be used.\nDo you want to continue? [Y\/n] y\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-grafana-from-apt-repository\">Installing Grafana from APT Repository<\/h3>\n\n\n\n<p>To install Grafana from APT repository;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Grafana OSS APT repository by running the command below;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install software-properties-common curl gnupg2 -y<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"deb https:\/\/packages.grafana.com\/oss\/deb stable main\" | sudo tee  \/etc\/apt\/sources.list.d\/grafana.list<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Grafana OSS APT repo GPG signing key.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -s https:\/\/packages.grafana.com\/gpg.key | sudo gpg --dearmor &gt; \/etc\/apt\/trusted.gpg.d\/grafana.gpg<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After that, re-synchronize your system packages to the latest versions and install Grafana.<\/li>\n<\/ul>\n\n\n\n<pre id=\"block-4ac08aa0-83e3-4f7e-83b5-e66c27860b11\" class=\"wp-block-preformatted\">sudo apt update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install grafana<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verify the installed version of Grafana.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt show grafana<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>Package: grafana\nVersion: 9.4.7\nPriority: optional\nSection: default\nMaintainer: contact@grafana.com\nInstalled-Size: 309 MB\nDepends: adduser, libfontconfig1\nHomepage: https:\/\/grafana.com\nLicense: AGPLv3\nVendor: Grafana\nDownload-Size: 84.0 MB\nAPT-Manual-Installed: yes\nAPT-Sources: https:\/\/packages.grafana.com\/oss\/deb stable\/main amd64 Packages\nDescription: Grafana\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"running-grafana-on-ubuntu-22-04-20-04-18-04\">Running Grafana on Ubuntu 22.04\/20.04\/18.04<\/h3>\n\n\n\n<p>Once the installation is done, reload systemd unit configuration files and start and enable Grafana to run on system boot.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo systemctl daemon-reload<\/code><\/pre>\n\n\n\n<pre id=\"block-ee20c41f-e8bf-4a2b-922f-7d54053b0e02\" class=\"wp-block-preformatted\">sudo systemctl enable grafana-server --now<\/code><\/pre>\n\n\n\n<p>You can check the status;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status grafana-server<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\u25cf grafana-server.service - Grafana instance\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/grafana-server.service; enabled; vendor preset: enabled)\n   Active: active (running) since Sun 2023-03-26 10:55:54 UTC; 11s ago\n     Docs: http:\/\/docs.grafana.org\n Main PID: 5148 (grafana)\n    Tasks: 5 (limit: 2314)\n   CGroup: \/system.slice\/grafana-server.service\n           \u2514\u25005148 \/usr\/share\/grafana\/bin\/grafana server --config=\/etc\/grafana\/grafana.ini --pidfile=\/run\/grafana\/grafana-server.pid --packaging=deb cfg:default.paths.logs=\/\n\nMar 26 10:56:04 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:04.694526782Z level=info msg=\"Executing migration\" id=\"Add index for dashboard_id in dashboard_tag\nMar 26 10:56:04 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:04.814790312Z level=info msg=\"Executing migration\" id=\"Update dashboard table charset\"\nMar 26 10:56:04 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:04.969435137Z level=info msg=\"Executing migration\" id=\"Update dashboard_tag table charset\"\nMar 26 10:56:05 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:05.101265042Z level=info msg=\"Executing migration\" id=\"Add column folder_id in dashboard\"\nMar 26 10:56:05 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:05.244748848Z level=info msg=\"Executing migration\" id=\"Add column isFolder in dashboard\"\nMar 26 10:56:05 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:05.387277739Z level=info msg=\"Executing migration\" id=\"Add column has_acl in dashboard\"\nMar 26 10:56:05 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:05.530016602Z level=info msg=\"Executing migration\" id=\"Add column uid in dashboard\"\nMar 26 10:56:05 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:05.672765618Z level=info msg=\"Executing migration\" id=\"Update uid column values in dashboard\"\nMar 26 10:56:05 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:05.805234882Z level=info msg=\"Executing migration\" id=\"Add unique index dashboard_org_id_uid\"\nMar 26 10:56:05 osboxes grafana[5148]: logger=migrator t=2023-03-26T10:56:05.936297751Z level=info msg=\"Executing migration\" id=\"Remove unique index org_id_slug\"\n<\/code><\/pre>\n\n\n\n<p>You can check the logs on;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f \/var\/log\/grafana\/grafana.log<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"access-grafana-ui\">Access Grafana UI<\/h3>\n\n\n\n<p>Grafana listens on TCP port 3000 by default;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -altnp | grep grafana<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>LISTEN   0         128                       *:3000                   *:*        users:((\"grafana\",pid=5148,fd=9))<\/code><\/pre>\n\n\n\n<p>To access Grafana UI, navigate to the browser and enter the address, <strong>http:\/\/localhost:3000<\/strong>.<\/p>\n\n\n\n<p>To access Grafana from an externally, use the address, <strong>http:\/\/grafana-server-IP:3000<\/strong>.<\/p>\n\n\n\n<p>However, for external access, you need to open TCP port 3000 on UFW if it is running.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo ufw allow 3000\/tcp<\/code><\/pre>\n\n\n\n<p>If using iptables;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo iptables -I INPUT -p tcp -m tcp --dport 3000 -j ACCEPT<\/code><\/pre>\n\n\n\n<p>Login as <strong>admin<\/strong> for both username and password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1378\" height=\"894\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-login-page.png\" alt=\"Install Grafana on Ubuntu\" class=\"wp-image-15921\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-login-page.png?v=1679829000 1378w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-login-page-768x498.png?v=1679829000 768w\" sizes=\"(max-width: 1378px) 100vw, 1378px\" \/><\/figure>\n\n\n\n<p>Once you login, you will be prompted to change the password.<\/p>\n\n\n\n<p>You can choose to keep the default credentials and compromise the security of your Grafana or do change the password and proceed to Grafana dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1886\" height=\"933\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-dashboard.png\" alt=\"\" class=\"wp-image-15922\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-dashboard.png?v=1679829101 1886w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-dashboard-768x380.png?v=1679829101 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-dashboard-1536x760.png?v=1679829101 1536w\" sizes=\"(max-width: 1886px) 100vw, 1886px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"naviagate-through-grafana-menu\">Naviagate through Grafana Menu<\/h3>\n\n\n\n<p>On the left menu, you can explore more about Grafana.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1435\" height=\"660\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-configuration-menu.png\" alt=\"\" class=\"wp-image-15923\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-configuration-menu.png?v=1679829637 1435w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/03\/grafana-configuration-menu-768x353.png?v=1679829637 768w\" sizes=\"(max-width: 1435px) 100vw, 1435px\" \/><\/figure>\n\n\n\n<p>There you go. You have successfully installed Grafana on Ubuntu 22.04\/20.04\/18.04 server. Enjoy<\/p>\n\n\n\n<p>See our other related guides by following the links below;<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-and-setup-tig-stack-on-fedora-30\/\" target=\"_blank\">Install and Setup TIG Stack on Fedora 30<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-elastic-stack-7-on-ubuntu-18-04-debian-9-8\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Elastic Stack 7 on Ubuntu 18.04\/Debian 9.8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-graylog-3-0-on-centos-7\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Graylog 3.0 on CentOS 7<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install Grafana on Ubuntu 22.04\/20.04\/18.04 servers. Grafana&nbsp;is the open source analytics &amp; monitoring solution for<\/p>\n","protected":false},"author":1,"featured_media":15930,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,301,121],"tags":[6476,6478,6479,6477,6480,67],"class_list":["post-3130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-grafana","category-howtos","tag-install-grafana-on-ubuntu","tag-install-grafana-on-ubuntu-18-04","tag-install-grafana-on-ubuntu-20-04","tag-install-grafana-on-ubuntu-22-04","tag-latest-grafana-install-ubuntu","tag-ubuntu-18-04","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\/3130"}],"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=3130"}],"version-history":[{"count":10,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3130\/revisions"}],"predecessor-version":[{"id":21148,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3130\/revisions\/21148"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/15930"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}