{"id":18920,"date":"2023-10-04T20:29:20","date_gmt":"2023-10-04T17:29:20","guid":{"rendered":"https:\/\/kifarunix.com\/?p=18920"},"modified":"2024-05-06T21:03:09","modified_gmt":"2024-05-06T18:03:09","slug":"how-to-install-grafana-on-debian-12","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-install-grafana-on-debian-12\/","title":{"rendered":"How to Install Grafana on Debian 12"},"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 Debian 12\" 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 Debian 12. <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 Debian 12 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-debian-12\">Installing Grafana on Debian 12<\/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-debian-12\">Install Grafana using DEB Binary on Debian 12<\/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-by-running-the-command-below\">Install Grafana OSS APT repository by running the command below;<\/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-debian-12\">Install Grafana from APT Repository on Debian 12<\/a><\/li><li><a href=\"#verify-grafana-installation\">Verify Grafana Installation<\/a><\/li><\/ul><\/li><li><a href=\"#running-grafana-on-debian-12\">Running Grafana on Debian 12<\/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-debian-12\">Installing Grafana on Debian 12<\/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.1.4.<\/p>\n\n\n\n<p>Thus, replace the value of VER variable below with the current release version number;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VER=10.1.4<\/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-debian-12\">Install Grafana using DEB Binary on Debian 12<\/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.1.4_amd64.deb'\nThe following additional packages will be installed:\n  fontconfig-config fonts-dejavu-core libfontconfig1 musl\nThe following NEW packages will be installed:\n  fontconfig-config fonts-dejavu-core grafana libfontconfig1 musl\n0 upgraded, 5 newly installed, 0 to remove and 8 not upgraded.\nNeed to get 2,174 kB\/104 MB of archives.\nAfter this operation, 380 MB of additional disk space will be used.\nDo you want to continue? [Y\/n] y\nGet:1 http:\/\/deb.debian.org\/debian bookworm\/main amd64 fonts-dejavu-core all 2.37-6 [1,068 kB]\nGet:2 http:\/\/deb.debian.org\/debian bookworm\/main amd64 fontconfig-config amd64 2.14.1-4 [315 kB]\nGet:3 http:\/\/deb.debian.org\/debian bookworm\/main amd64 libfontconfig1 amd64 2.14.1-4 [386 kB]\nGet:4 http:\/\/deb.debian.org\/debian bookworm\/main amd64 musl amd64 1.2.3-1 [406 kB]\nGet:5 \/root\/grafana_10.1.4_amd64.deb grafana amd64 10.1.4 [102 MB]\nFetched 2,174 kB in 1s (3,305 kB\/s)\nPreconfiguring packages ...\nSelecting previously unselected package fonts-dejavu-core.\n(Reading database ... 36275 files and directories currently installed.)\nPreparing to unpack ...\/fonts-dejavu-core_2.37-6_all.deb ...\nUnpacking fonts-dejavu-core (2.37-6) ...\nSelecting previously unselected package fontconfig-config.\nPreparing to unpack ...\/fontconfig-config_2.14.1-4_amd64.deb ...\nUnpacking fontconfig-config (2.14.1-4) ...\nSelecting previously unselected package libfontconfig1:amd64.\nPreparing to unpack ...\/libfontconfig1_2.14.1-4_amd64.deb ...\nUnpacking libfontconfig1:amd64 (2.14.1-4) ...\nSelecting previously unselected package musl:amd64.\nPreparing to unpack ...\/musl_1.2.3-1_amd64.deb ...\nUnpacking musl:amd64 (1.2.3-1) ...\nSelecting previously unselected package grafana.\nPreparing to unpack \/root\/grafana_10.1.4_amd64.deb ...\nUnpacking grafana (10.1.4) ...\nSetting up fonts-dejavu-core (2.37-6) ...\nSetting up musl:amd64 (1.2.3-1) ...\nSetting up fontconfig-config (2.14.1-4) ...\nSetting up libfontconfig1:amd64 (2.14.1-4) ...\nSetting up grafana (10.1.4) ...\nAdding system user `grafana' (UID 102) ...\nAdding new user `grafana' (UID 102) with group `grafana' ...\nNot 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.11.2-2) ...\nProcessing triggers for libc-bin (2.36-9+deb12u1) ...\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-by-running-the-command-below\">Install Grafana OSS APT repository by running the command below;<\/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-debian-12\">Install Grafana from APT Repository on Debian 12<\/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.1.4\nPriority: optional\nSection: default\nMaintainer: contact@grafana.com\nInstalled-Size: 375 MB\nDepends: adduser, libfontconfig1, musl\nHomepage: https:\/\/grafana.com\nLicense: AGPLv3\nVendor: \"Grafana Labs\"\nDownload-Size: 102 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-debian-12\">Running Grafana on Debian 12<\/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 (\/lib\/systemd\/system\/grafana-server.service; enabled; preset: enabled)\n     Active: active (running) since Wed 2023-10-04 12:49:42 EDT; 8min ago\n       Docs: http:\/\/docs.grafana.org\n   Main PID: 7738 (grafana)\n      Tasks: 13 (limit: 2304)\n     Memory: 105.3M\n        CPU: 6.723s\n     CGroup: \/system.slice\/grafana-server.service\n             \u2514\u25007738 \/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\nOct 04 12:52:04 debian grafana[7738]: logger=modules t=2023-10-04T12:52:04.887098665-04:00 level=info msg=\"All modules healthy\" modules=\"[provisioning background-services http-server secret-migrator]\"\nOct 04 12:52:04 debian grafana[7738]: logger=ngalert.state.manager t=2023-10-04T12:52:04.887690829-04:00 level=info msg=\"Warming state cache for startup\"\nOct 04 12:52:04 debian grafana[7738]: logger=ngalert.state.manager t=2023-10-04T12:52:04.888708392-04:00 level=info msg=\"State cache has been initialized\" states=0 duration=1.01291ms\nOct 04 12:52:04 debian grafana[7738]: logger=ngalert.scheduler t=2023-10-04T12:52:04.889174027-04:00 level=info msg=\"Starting scheduler\" tickInterval=10s\nOct 04 12:52:04 debian grafana[7738]: logger=ticker t=2023-10-04T12:52:04.889799448-04:00 level=info msg=starting first_tick=2023-10-04T12:52:10-04:00\nOct 04 12:52:04 debian grafana[7738]: logger=grafanaStorageLogger t=2023-10-04T12:52:04.895448725-04:00 level=info msg=\"storage starting\"\nOct 04 12:52:04 debian grafana[7738]: logger=ngalert.multiorg.alertmanager t=2023-10-04T12:52:04.898749478-04:00 level=info msg=\"Starting MultiOrg Alertmanager\"\nOct 04 12:52:05 debian grafana[7738]: logger=grafana.update.checker t=2023-10-04T12:52:05.816085002-04:00 level=info msg=\"Update check succeeded\" duration=922.559943ms\nOct 04 12:52:05 debian grafana[7738]: logger=plugins.update.checker t=2023-10-04T12:52:05.834322446-04:00 level=info msg=\"Update check succeeded\" duration=940.440361ms\nOct 04 12:53:38 debian grafana[7738]: logger=infra.usagestats t=2023-10-04T12:53:38.90452924-04:00 level=info msg=\"Usage stats are ready to report\"\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. It might take a few minutes for the service to fully come up.<\/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      4096               *:3000            *:*    users:((\"grafana\",pid=7738,fd=11))<\/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\">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 Debian 12\" 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=\"1471\" height=\"837\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-dashboard.png\" alt=\"\" class=\"wp-image-18928\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-dashboard.png?v=1696440522 1471w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-dashboard-768x437.png?v=1696440522 768w\" sizes=\"(max-width: 1471px) 100vw, 1471px\" \/><\/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=\"1469\" height=\"808\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-menu.png\" alt=\"\" class=\"wp-image-18929\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-menu.png?v=1696440527 1469w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/10\/grafana-menu-768x422.png?v=1696440527 768w\" sizes=\"(max-width: 1469px) 100vw, 1469px\" \/><\/figure>\n\n\n\n<p>There you go. You have successfully installed Grafana on Debian 12 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 will provide step-by-step instructions on how to install Grafana on Debian 12. 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":[7260,7258],"class_list":["post-18920","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-grafana","category-howtos","tag-grafana-install-debian-12","tag-install-grafana-on-debian-12","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\/18920"}],"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=18920"}],"version-history":[{"count":7,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18920\/revisions"}],"predecessor-version":[{"id":22462,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18920\/revisions\/22462"}],"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=18920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=18920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=18920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}