{"id":22456,"date":"2024-05-06T21:17:11","date_gmt":"2024-05-06T18:17:11","guid":{"rendered":"https:\/\/kifarunix.com\/?p=22456"},"modified":"2024-05-06T21:17:14","modified_gmt":"2024-05-06T18:17:14","slug":"how-to-install-grafana-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-install-grafana-on-ubuntu-24-04\/","title":{"rendered":"How to Install Grafana on Ubuntu 24.04"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1059\" height=\"592\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/install-grafana-in-linux.png\" alt=\"Install Grafana on Ubuntu 24.04\" class=\"wp-image-18925\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/install-grafana-in-linux.png?v=1696440216 1059w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/install-grafana-in-linux-768x429.png?v=1696440216 768w\" sizes=\"(max-width: 1059px) 100vw, 1059px\" \/><\/figure>\n\n\n\n<p>In this guide, we will provide step-by-step instructions on how to install Grafana on Ubuntu 24.04. <a href=\"https:\/\/grafana.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Grafana<\/a> is a powerful open-source analytics and visualization platform that allows you to monitor and analyze your data in real-time. By following the installation process outlined below, you will be able to seamlessly set up Grafana on your Ubuntu 24.04 system.<\/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-24-04\">Installing Grafana on Ubuntu 24.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><ul><li><a href=\"#download-grafana-binary-installer\">Download Grafana Binary Installer<\/a><\/li><li><a href=\"#verify-integrity-of-the-grafana-binary-installer\">Verify Integrity of the Grafana Binary Installer<\/a><\/li><li><a href=\"#install-grafana-using-deb-binary-on-ubuntu-24-04\">Install Grafana using DEB Binary on Ubuntu 24.04<\/a><\/li><\/ul><\/li><li><a href=\"#installing-grafana-from-apt-repository\">Installing Grafana from APT Repository<\/a><ul><li><a href=\"#install-grafana-oss-apt-repository\">Install Grafana OSS APT repository<\/a><\/li><li><a href=\"#install-grafana-oss-apt-repo-gpg-signing-key\">Install Grafana OSS APT repo GPG signing key.<\/a><\/li><li><a href=\"#install-grafana-from-apt-repository-on-ubuntu-24-04\">Install Grafana from APT Repository on Ubuntu 24.04<\/a><\/li><li><a href=\"#verify-grafana-installation\">Verify Grafana Installation<\/a><\/li><\/ul><\/li><li><a href=\"#running-grafana-on-ubuntu-24-04\">Running Grafana on Ubuntu 24.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-24-04\">Installing Grafana on Ubuntu 24.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\">sudo apt update<\/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<h4 class=\"wp-block-heading\" id=\"download-grafana-binary-installer\">Download Grafana Binary Installer<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigate to <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>Execute the installer on the system you are installing Grafana on.<\/li>\n<\/ul>\n\n\n\n<p>As of this writing, Grafana version 10.4.2.<\/p>\n\n\n\n<p>Thus, replace the value of VER variable below with the current Grafana release version number;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VER=10.4.2<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/dl.grafana.com\/oss\/release\/grafana_${VER}_amd64.deb<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"verify-integrity-of-the-grafana-binary-installer\">Verify Integrity of the Grafana Binary Installer<\/h4>\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<pre class=\"wp-block-preformatted\">sha256sum grafana_${VER}_amd64.deb <\/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><strong>ENSURE<\/strong> the hash values match!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-grafana-using-deb-binary-on-ubuntu-24-04\">Install Grafana using DEB Binary on Ubuntu 24.04<\/h4>\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\">sudo apt install .\/grafana_${VER}_amd64.deb<\/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_10.4.2_amd64.deb'\nThe following additional packages will be installed:\n  musl\nThe following NEW packages will be installed:\n  grafana musl\n0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.\nNeed to get 416 kB\/115 MB of archives.\nAfter this operation, 424 MB of additional disk space will be used.\nDo you want to continue? [Y\/n] y\nGet:1 http:\/\/de.archive.ubuntu.com\/ubuntu noble\/universe amd64 musl amd64 1.2.4-2 [416 kB]\nGet:2 \/home\/kifarunix\/grafana_10.4.2_amd64.deb grafana amd64 10.4.2 [114 MB]\nFetched 416 kB in 1s (719 kB\/s)\nSelecting previously unselected package musl:amd64.\n(Reading database ... 84360 files and directories currently installed.)\nPreparing to unpack ...\/musl_1.2.4-2_amd64.deb ...\nUnpacking musl:amd64 (1.2.4-2) ...\nSelecting previously unselected package grafana.\nPreparing to unpack ...\/grafana_10.4.2_amd64.deb ...\nUnpacking grafana (10.4.2) ...\nSetting up musl:amd64 (1.2.4-2) ...\nSetting up grafana (10.4.2) ...\ninfo: Selecting UID from range 100 to 999 ...\n\ninfo: Adding system user `grafana' (UID 112) ...\ninfo: Adding new user `grafana' (UID 112) with group `grafana' ...\ninfo: Not creating home directory `\/usr\/share\/grafana'.\n### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd\n sudo \/bin\/systemctl daemon-reload\n sudo \/bin\/systemctl enable grafana-server\n### You can start grafana-server by executing\n sudo \/bin\/systemctl start grafana-server\nProcessing triggers for man-db (2.12.0-4build2) ...\nScanning processes...                                                                                                                                 \nScanning linux images...                                                                                                                              \n\nRunning kernel seems to be up-to-date.\n\nNo services need to be restarted.\n\nNo containers need to be restarted.\n\nNo user sessions are running outdated binaries.\n\nNo VM guests are running outdated hypervisor (qemu) binaries on this host.\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<h4 class=\"wp-block-heading\" id=\"install-grafana-oss-apt-repository\">Install Grafana OSS APT repository<\/h4>\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<h4 class=\"wp-block-heading\" id=\"install-grafana-oss-apt-repo-gpg-signing-key\">Install Grafana OSS APT repo GPG signing key.<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -s https:\/\/packages.grafana.com\/gpg.key | sudo gpg --dearmor -o \/etc\/apt\/trusted.gpg.d\/grafana.gpg<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-grafana-from-apt-repository-on-ubuntu-24-04\">Install Grafana from APT Repository on Ubuntu 24.04<\/h4>\n\n\n\n<p>After that, re-synchronize your system packages to the latest versions and install Grafana.<\/p>\n\n\n\n<pre id=\"block-4ac08aa0-83e3-4f7e-83b5-e66c27860b11\" class=\"wp-block-preformatted\">sudo apt update<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install grafana<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"verify-grafana-installation\">Verify Grafana Installation<\/h4>\n\n\n\n<p>Verify the installed version of Grafana.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt show grafana<\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>Package: grafana\nVersion: 10.4.2\nPriority: optional\nSection: default\nMaintainer: contact@grafana.com\nInstalled-Size: 423 MB\nDepends: adduser, libfontconfig1, musl\nHomepage: https:\/\/grafana.com\nLicense: AGPLv3\nVendor: \"Grafana Labs\"\nDownload-Size: 114 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<p>Or check the version number;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grafana-server --version<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Version 10.4.2 (commit: 22809dea50455ae875624827dd277b17621b4ed4, branch: HEAD)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"running-grafana-on-ubuntu-24-04\">Running Grafana on Ubuntu 24.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\">sudo systemctl daemon-reload<\/pre>\n\n\n\n<pre id=\"block-ee20c41f-e8bf-4a2b-922f-7d54053b0e02\" class=\"wp-block-preformatted\">sudo systemctl enable grafana-server --now<\/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; preset: enabled)\n     Active: active (running) since Mon 2024-05-06 18:04:39 UTC; 34s ago\n       Docs: http:\/\/docs.grafana.org\n   Main PID: 2652 (grafana)\n      Tasks: 12 (limit: 4614)\n     Memory: 48.6M (peak: 48.9M)\n        CPU: 3.672s\n     CGroup: \/system.slice\/grafana-server.service\n             \u2514\u25002652 \/usr\/share\/grafana\/bin\/grafana server --config=\/etc\/grafana\/grafana.ini --pidfile=\/run\/grafana\/grafana-server.pid --packaging=deb cfg:default.paths.logs=\/var\/log\/grafana cfg:default.paths.da>\n\nMay 06 18:04:47 monitor01 grafana[2652]: logger=ngalert.state.manager t=2024-05-06T18:04:47.218514966Z level=info msg=\"State cache has been initialized\" states=0 duration=9.226307ms\nMay 06 18:04:47 monitor01 grafana[2652]: logger=ngalert.multiorg.alertmanager t=2024-05-06T18:04:47.220113137Z level=info msg=\"Starting MultiOrg Alertmanager\"\nMay 06 18:04:47 monitor01 grafana[2652]: logger=ngalert.scheduler t=2024-05-06T18:04:47.220499798Z level=info msg=\"Starting scheduler\" tickInterval=10s maxAttempts=1\nMay 06 18:04:47 monitor01 grafana[2652]: logger=ticker t=2024-05-06T18:04:47.22061827Z level=info msg=starting first_tick=2024-05-06T18:04:50Z\nMay 06 18:04:47 monitor01 grafana[2652]: logger=plugins.update.checker t=2024-05-06T18:04:47.280749562Z level=info msg=\"Update check succeeded\" duration=61.328152ms\nMay 06 18:04:47 monitor01 grafana[2652]: logger=provisioning.dashboard t=2024-05-06T18:04:47.284989983Z level=info msg=\"starting to provision dashboards\"\nMay 06 18:04:47 monitor01 grafana[2652]: logger=provisioning.dashboard t=2024-05-06T18:04:47.285008641Z level=info msg=\"finished to provision dashboards\"\nMay 06 18:04:47 monitor01 grafana[2652]: logger=grafana.update.checker t=2024-05-06T18:04:47.305229831Z level=info msg=\"Update check succeeded\" duration=86.269636ms\nMay 06 18:04:47 monitor01 grafana[2652]: logger=grafana-apiserver t=2024-05-06T18:04:47.59284037Z level=info msg=\"Adding GroupVersion playlist.grafana.app v0alpha1 to ResourceManager\"\nMay 06 18:04:47 monitor01 grafana[2652]: logger=grafana-apiserver t=2024-05-06T18:04:47.593314421Z level=info msg=\"Adding GroupVersion featuretoggle.grafana.app v0alpha1 to ResourceManager\"\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>sudo tail -f \/var\/log\/grafana\/grafana.log<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>logger=ngalert.multiorg.alertmanager t=2024-05-06T18:04:47.220113137Z level=info msg=\"Starting MultiOrg Alertmanager\"\nlogger=ngalert.scheduler t=2024-05-06T18:04:47.220499798Z level=info msg=\"Starting scheduler\" tickInterval=10s maxAttempts=1\nlogger=ticker t=2024-05-06T18:04:47.22061827Z level=info msg=starting first_tick=2024-05-06T18:04:50Z\nlogger=plugins.update.checker t=2024-05-06T18:04:47.280749562Z level=info msg=\"Update check succeeded\" duration=61.328152ms\nlogger=provisioning.dashboard t=2024-05-06T18:04:47.284989983Z level=info msg=\"starting to provision dashboards\"\nlogger=provisioning.dashboard t=2024-05-06T18:04:47.285008641Z level=info msg=\"finished to provision dashboards\"\nlogger=grafana.update.checker t=2024-05-06T18:04:47.305229831Z level=info msg=\"Update check succeeded\" duration=86.269636ms\nlogger=grafana-apiserver t=2024-05-06T18:04:47.59284037Z level=info msg=\"Adding GroupVersion playlist.grafana.app v0alpha1 to ResourceManager\"\nlogger=grafana-apiserver t=2024-05-06T18:04:47.593314421Z level=info msg=\"Adding GroupVersion featuretoggle.grafana.app v0alpha1 to ResourceManager\"\nlogger=infra.usagestats t=2024-05-06T18:05:22.212856048Z level=info msg=\"Usage stats are ready to report\"\n<\/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. It might take a few minutes for the service to fully come up.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ss -altnp | grep grafana<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>LISTEN 0      4096               *:3000            *:*    users:((\"grafana\",pid=2652,fd=11))<\/code><\/pre>\n\n\n\n<p>To access Grafana UI on the localhost, 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\">sudo ufw allow 3000\/tcp<\/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=\"1465\" height=\"831\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-login-page.png\" alt=\"Install Grafana on Ubuntu 24.04\" class=\"wp-image-18927\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-login-page.png?v=1696440513 1465w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-login-page-768x436.png?v=1696440513 768w\" sizes=\"(max-width: 1465px) 100vw, 1465px\" \/><\/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=\"1907\" height=\"886\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/05\/grafana-default-dashboard.png?v=1715019281\" alt=\"\" class=\"wp-image-22463\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/05\/grafana-default-dashboard.png?v=1715019281 1907w, https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/05\/grafana-default-dashboard-768x357.png?v=1715019281 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/05\/grafana-default-dashboard-1536x714.png?v=1715019281 1536w\" sizes=\"(max-width: 1907px) 100vw, 1907px\" \/><\/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<p>There you go. You have successfully installed Grafana on Ubuntu 24.04 server. Enjoy<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we will provide step-by-step instructions on how to install Grafana on Ubuntu 24.04. Grafana is a powerful open-source analytics and visualization platform<\/p>\n","protected":false},"author":10,"featured_media":18925,"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,7396],"class_list":["post-22456","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-grafana","category-howtos","tag-grafana","tag-ubuntu-24-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\/22456"}],"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\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=22456"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/22456\/revisions"}],"predecessor-version":[{"id":22464,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/22456\/revisions\/22464"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/18925"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=22456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=22456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=22456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}