{"id":2702,"date":"2024-09-07T13:12:57","date_gmt":"2025-05-08T14:49:19","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-grafana-and-prometheus-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-grafana-and-prometheus-on-ubuntu-24-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 Grafana and Prometheus on Ubuntu 24.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>Grafana and Prometheus are powerful tools for monitoring and visualizing system performance. In this guide, we\u2019ll show you how to install and configure Grafana and Prometheus on <strong>Ubuntu 24.04<\/strong>. Using a  can enhance your monitoring setup, providing reliable performance and scalability on your VPS server.<\/p>\n<h2>Step 1: Prepare Your VPS Server<\/h2>\n<p>Before installing Grafana and Prometheus, ensure that your <strong>VPS server<\/strong> is up to date. We recommend using a  for optimal performance and stability. First, update your Ubuntu 24.04 system:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install Prometheus<\/h2>\n<p>Prometheus is an open-source system monitoring and alerting toolkit. To install it, follow these steps:<\/p>\n<ul>\n<ul>\n<li>Create a Prometheus user:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>sudo useradd --no-create-home --shell \/bin\/false prometheus<\/code><\/pre>\n<ul>\n<ul>\n<li>Download the Prometheus package:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>wget https:\/\/github.com\/prometheus\/prometheus\/releases\/download\/v2.42.0\/prometheus-2.42.0.linux-amd64.tar.gz<\/code><\/pre>\n<ul>\n<ul>\n<li>Extract the package and move the binaries:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>\r\ntar -xvzf prometheus-2.42.0.linux-amd64.tar.gz\r\nsudo mv prometheus-2.42.0.linux-amd64\/prometheus \/usr\/local\/bin\/\r\nsudo mv prometheus-2.42.0.linux-amd64\/promtool \/usr\/local\/bin\/\r\n<\/code><\/pre>\n<p>Next, configure Prometheus by creating a configuration file:<\/p>\n<pre><code>sudo nano \/etc\/prometheus\/prometheus.yml<\/code><\/pre>\n<p>Add the following basic configuration:<\/p>\n<pre><code>\r\nglobal:\r\n  scrape_interval: 15s\r\n\r\nscrape_configs:\r\n  - job_name: 'prometheus'\r\n    static_configs:\r\n      - targets: ['localhost:9090']\r\n<\/code><\/pre>\n<p>Start the Prometheus service:<\/p>\n<pre><code>\r\nsudo systemctl enable prometheus\r\nsudo systemctl start prometheus\r\n<\/code><\/pre>\n<h2>Step 3: Install Grafana<\/h2>\n<p>Grafana is a visualization tool that works perfectly with Prometheus to create monitoring dashboards. To install Grafana:<\/p>\n<ul>\n<ul>\n<li>Add the Grafana repository:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>\r\nsudo apt install -y software-properties-common\r\nsudo add-apt-repository \"deb https:\/\/packages.grafana.com\/oss\/deb stable main\"\r\nwget -q -O - https:\/\/packages.grafana.com\/gpg.key | sudo apt-key add -\r\nsudo apt update\r\n<\/code><\/pre>\n<ul>\n<ul>\n<li>Install Grafana:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>sudo apt install grafana -y<\/code><\/pre>\n<ul>\n<ul>\n<li>Start and enable the Grafana service:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>\r\nsudo systemctl enable grafana-server --now\r\n<\/code><\/pre>\n<h2>Step 4: Configure Prometheus as a Data Source in Grafana<\/h2>\n<p>Once both Prometheus and Grafana are installed, the next step is to connect them. Open Grafana in your web browser at <code>http:\/\/your-server-ip:3000<\/code> and log in using the default credentials (<code>admin<\/code>\/<code>admin<\/code>).<\/p>\n<p>After logging in:<\/p>\n<ul>\n<li>Go to &#8220;Configuration&#8221; and click on &#8220;Data Sources.&#8221;<\/li>\n<li>Add a new data source and select &#8220;Prometheus.&#8221;<\/li>\n<li>In the URL field, enter <code>http:\/\/localhost:9090<\/code> and click &#8220;Save &amp; Test&#8221; to connect Grafana to Prometheus.<\/li>\n<\/ul>\n<h2>Step 5: Create a Monitoring Dashboard<\/h2>\n<p>With Prometheus connected, you can now create custom dashboards in Grafana to visualize your server&#8217;s performance. Grafana provides various templates and panels to customize your monitoring setup. Consider hosting your monitoring stack on a  to benefit from the increased reliability and dedicated resources offered by a <strong>VPS server<\/strong>.<\/p>\n<h2>Step 6: Access Grafana and Monitor Your System<\/h2>\n<p>Now that you have Grafana and Prometheus set up on Ubuntu 24.04, you can access your monitoring dashboards anytime to keep an eye on your system\u2019s performance. This setup is ideal for monitoring CPU, memory, disk usage, and network activity in real-time.<\/p>\n<p>For businesses looking for a robust and scalable solution, hosting your monitoring stack on a  is an excellent choice. A <strong>VPS<\/strong> ensures better performance, security, and resource management compared to shared hosting environments.<\/p>\n<h2>Conclusion<\/h2>\n<p>Installing Grafana and Prometheus on Ubuntu 24.04 is a great way to create a powerful monitoring solution for your systems. By using a , you can ensure that your monitoring setup is scalable, reliable, and optimized for your needs. Whether you&#8217;re running a personal project or managing multiple servers, a <strong>VPS server<\/strong> offers the flexibility and control needed to maintain your infrastructure.<\/p>\n<p>For more information on hosting your monitoring stack or getting started with a <strong>VPS server<\/strong>, visit  for the best options available.<\/p>\n<\/article>\n<footer>\n<p>\u00a9 2024 Windows VPS &#8211; All Rights Reserved<\/p>\n<\/footer>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Grafana and Prometheus are powerful tools for monitoring and visualizing system performance. In this guide, we\u2019ll show you how to install and configure Grafana and Prometheus\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2702","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2702"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2702\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}