{"id":1582,"date":"2024-04-27T02:41:13","date_gmt":"2024-04-26T23:41:13","guid":{"rendered":"https:\/\/www.fibacloud.com\/community\/tutorials\/?p=1582"},"modified":"2026-10-04T22:57:46","modified_gmt":"2026-10-04T19:57:46","slug":"installing-grafana-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.fibacloud.com\/community\/tutorials\/en\/installing-grafana-on-ubuntu\/","title":{"rendered":"Install Grafana OSS on Ubuntu 24.04"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1582\" class=\"elementor elementor-1582\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b2002b9 e-con-full e-flex e-con e-parent\" data-id=\"b2002b9\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-06be95a elementor-widget elementor-widget-text-editor\" data-id=\"06be95a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.21.0 - 08-05-2024 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>This guide installs <strong>Grafana OSS on Ubuntu 24.04 LTS<\/strong> and verifies a first dashboard. Grafana does not necessarily collect your metrics: it queries and visualizes sources such as Prometheus or InfluxDB. Verify the package series, repository and data-source compatibility together.<\/p>\n<figure class=\"fc-editorial-figure\" data-fc-visual=\"20260920\" aria-labelledby=\"fc-editorial-caption-1582\"><a href=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-grafana-en-inline-20260920.webp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Open full-size illustration\"><picture><source media=\"(max-width: 600px)\" srcset=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-grafana-en-mobile-20260920.webp\" width=\"720\" height=\"1140\"><img loading=\"lazy\" src=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-grafana-en-inline-20260920.webp\" srcset=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-grafana-en-inline-20260920.webp 1440w, https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-grafana-en-inline-20260920-300x242.webp 300w, https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-grafana-en-inline-20260920-1024x825.webp 1024w, https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-grafana-en-inline-20260920-768x619.webp 768w\" sizes=\"auto, (max-width: 900px) 100vw, 820px\" width=\"1440\" height=\"1160\" alt=\"How Grafana makes data visible\" class=\"wp-image-2524\"  decoding=\"async\"><\/picture><\/a><figcaption id=\"fc-editorial-caption-1582\"><strong>How Grafana makes data visible<\/strong> Grafana queries a connected data source and displays results in panels. Alert rules evaluate results from supported data sources.<details><summary>Step-by-step explanation<\/summary><ol><li>Connect: Configure a compatible data source.<\/li><li>Query: Select a metric and time window.<\/li><li>Visualize: Turn results into clear panels.<\/li><li>Alert: Notify when a rule requires attention.<\/li><\/ol><\/details><\/figcaption><\/figure>\n<h2>Before you begin<\/h2>\n<p>You need sudo privileges, console\/SSH access and a saved configuration backup. If Grafana or its database already exists, use the documented upgrade and plugin-compatibility procedures rather than treating it as a new installation.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9f052d0 elementor-widget elementor-widget-text-editor\" data-id=\"9f052d0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">cat \/etc\/os-release\ndpkg-query -W 'grafana*' 2&gt;\/dev\/null\nss -lnt | awk '$4 ~ \/:3000$\/ {print}'\nsudo apt-get update\nsudo apt-get install ca-certificates curl gnupg<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-11d19ac elementor-widget elementor-widget-text-editor\" data-id=\"11d19ac\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>This example uses loopback and an SSH tunnel without exposing port 3000 publicly. Shared HTTPS access requires a reverse proxy, correct <code>root_url<\/code> and an appropriate authentication design.<\/p>\n<h2>Add the official Grafana repository<\/h2>\n<p>Use the key and stable repository in the <a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/installation\/debian\/\" rel=\"nofollow noopener\" target=\"_blank\">official Debian\/Ubuntu guide<\/a>. The OSS package is <code>grafana<\/code>; Enterprise is <code>grafana-enterprise<\/code>. Do not select them interchangeably within one installation.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b4dd963 elementor-widget elementor-widget-text-editor\" data-id=\"b4dd963\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">key_dir=$(mktemp -d)\ncurl --fail --show-error --location https:\/\/apt.grafana.com\/gpg-full.key \\\n  -o \"$key_dir\/grafana.asc\"\ngpg --show-keys --with-fingerprint \"$key_dir\/grafana.asc\"\nsudo install -d -m 755 \/etc\/apt\/keyrings\nsudo install -m 644 \"$key_dir\/grafana.asc\" \/etc\/apt\/keyrings\/grafana.asc\nprintf '%s\\n' 'deb [signed-by=\/etc\/apt\/keyrings\/grafana.asc] https:\/\/apt.grafana.com stable main' \\\n  | sudo tee \/etc\/apt\/sources.list.d\/grafana.list\nsudo apt-get update\napt-cache policy grafana<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9192571 elementor-widget elementor-widget-text-editor\" data-id=\"9192571\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Match the key source to the official documentation. Do not bypass a signature failure. Confirm that the APT candidate comes from <code>apt.grafana.com<\/code> stable and record the version you will install. <code>apt-get update<\/code> refreshes package indexes; it does not, by itself, upgrade an installed Grafana package.<\/p>\n<h2>Start the service with local access<\/h2>\n<p>On a new installation, prevent package installation from starting the service prematurely:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6912f8b elementor-widget elementor-widget-text-editor\" data-id=\"6912f8b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">sudo systemctl mask grafana-server.service\nsudo apt-get install grafana\nsudo install -d -m 755 \/etc\/systemd\/system\/grafana-server.service.d\nprintf '%s\\n' '[Service]' 'Environment=GF_SERVER_HTTP_ADDR=127.0.0.1' \\\n  'Environment=GF_USERS_ALLOW_SIGN_UP=false' \\\n  'Environment=GF_AUTH_ANONYMOUS_ENABLED=false' \\\n  | sudo tee \/etc\/systemd\/system\/grafana-server.service.d\/local-access.conf\nsudo systemctl daemon-reload\nsudo systemctl unmask grafana-server.service\nsudo systemctl enable --now grafana-server.service\nsudo systemctl status grafana-server.service --no-pager\ndpkg-query -W -f='${Package} ${Version}\\n' grafana\nss -lnt | awk '$4 ~ \/:3000$\/ {print}'\ncurl --fail --show-error http:\/\/127.0.0.1:3000\/api\/health<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f6c367b elementor-widget elementor-widget-text-editor\" data-id=\"f6c367b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><code>\/api\/health<\/code> should report a healthy database; the listener must be only <code>127.0.0.1:3000<\/code>. Environment variables in the systemd drop-in override Grafana configuration values: do not change a value in <code>grafana.ini<\/code> and forget an existing override. Do not edit <code>\/usr\/share\/grafana\/conf\/defaults.ini<\/code>, which packages may replace.<\/p>\n<h2>Open the first session through SSH<\/h2>\n<p>On your own computer, substitute the example user and host with your server&#8217;s verified identity:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2ed0507 elementor-widget elementor-widget-text-editor\" data-id=\"2ed0507\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">ssh -N -L 13000:127.0.0.1:3000 kullanici@sunucu.example.com<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e15079c elementor-widget elementor-widget-text-editor\" data-id=\"e15079c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Open <code>http:\/\/127.0.0.1:13000<\/code> in your browser. On an unchanged new installation, replace the default administrator password immediately after the first login with a strong, unique password. Do not share the administrator account for everyday viewing or application integrations. Do not assume default credentials apply to an existing environment.<\/p>\n<h2>Verify a data source and dashboard<\/h2>\n<p>Begin with Grafana&#8217;s <strong>TestData<\/strong> source to create a synthetic panel. Add TestData under Connections\/Data sources, select it in a new dashboard&#8217;s time-series panel, choose a scenario and save both panel and dashboard. Reopening it should display the saved configuration and expected synthetic data. That proves the initial visualization flow, not that your actual infrastructure is monitored.<\/p>\n<p>For real data, if you followed the <a href=\"https:\/\/www.fibacloud.com\/community\/tutorials\/en\/installing-influxdb-on-ubuntu\/\">InfluxDB 2.x guide<\/a>, select an InfluxDB source, choose <strong>Flux<\/strong> as the query language, organization <code>fibacloud-lab<\/code> and default bucket <code>metrics_lab<\/code>. Use a separate token with <strong>read-only<\/strong> access to that bucket. Do not give a dashboard an operator\/admin or write token.<\/p>\n<p>When both services run on the same server, the data-source URL can be <code>http:\/\/127.0.0.1:8086<\/code>. This is <strong>the Grafana server&#8217;s<\/strong> loopback address, not the browser&#8217;s. A separate host\/container needs the correct private-network address and TLS. Check Save &amp; test, then query the <code>usage_user<\/code> field of the <code>cpu<\/code> measurement in the relevant time range. For an empty panel, check the range, synchronized clocks, bucket and token privileges first.<\/p>\n<h2>Troubleshooting, backups and rollback<\/h2>\n<p>For startup failures, inspect <code>sudo journalctl -u grafana-server -n 80 --no-pager<\/code>, port conflicts and drop-in values. Resolve networking, CA or permission problems instead of disabling TLS validation or supplying an administrator token to a failing data source.<\/p>\n<p>Back up configuration, provisioning files, the plugin inventory and Grafana&#8217;s database with appropriate consistency. A dashboard JSON export alone does not back up users, secrets or the complete server state. Before upgrading, verify data-source\/plugin compatibility and restoration in a separate environment. Stop a failed new installation without deleting its data. Do not try to undo database migrations with an ordinary package downgrade.<\/p>\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/installation\/debian\/\" rel=\"nofollow noopener\" target=\"_blank\">Grafana: Debian\/Ubuntu installation and OSS packages<\/a><\/li>\n<li><a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/configure-grafana\/\" rel=\"nofollow noopener\" target=\"_blank\">Grafana: configuration and environment overrides<\/a><\/li>\n<li><a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/datasources\/influxdb\/configure-influxdb-data-source\/\" rel=\"nofollow noopener\" target=\"_blank\">Grafana: configuring an InfluxDB data source<\/a><\/li>\n<\/ul>\n<p class=\"fc-article-review-date\">Technical content and sources reviewed on October 4, 2026. Recheck the relevant official documentation when a version or provider changes.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Install Grafana OSS on Ubuntu 24.04 with a signed package source, local access, a first dashboard, an InfluxDB data source and backup checks.<\/p>\n","protected":false},"author":1,"featured_media":2523,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[96,78,100],"class_list":["post-1582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials-en","tag-linux","tag-security","tag-ubuntu"],"lang":"en","translations":{"en":1582,"tr":1488},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts\/1582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/comments?post=1582"}],"version-history":[{"count":25,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts\/1582\/revisions"}],"predecessor-version":[{"id":1619,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts\/1582\/revisions\/1619"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/media\/2523"}],"wp:attachment":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/media?parent=1582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/categories?post=1582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/tags?post=1582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}