{"id":512,"date":"2026-06-25T03:11:35","date_gmt":"2026-06-25T03:11:35","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=512"},"modified":"2026-06-25T03:11:35","modified_gmt":"2026-06-25T03:11:35","slug":"setup-prometheus-grafana-vps-monitoring","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/","title":{"rendered":"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you run a VPS without monitoring, you&#8217;re flying blind. Resource leaks, traffic spikes, and cron jobs gone wrong can silently degrade performance until your site goes down. Prometheus and Grafana together provide battle-tested, open-source monitoring that gives you real-time visibility into CPU, RAM, disk, network, and application metrics. Here&#8217;s how to set them up on a Ubuntu 22.04\/24.04 VPS in under 30 minutes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>A Ubuntu 22.04 or 24.04 VPS with at least 1 GB RAM (2 GB recommended if your app also runs on the same server)<\/li><li>Root or sudo access<\/li><li>Port 9090 (Prometheus) and 3000 (Grafana) open in your firewall \u2014 but restrict to your IP or use a reverse proxy with auth<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t have a VPS yet, check <a href=\"https:\/\/virtualserversvps.com\/#providers\">affordable VPS hosting options<\/a> that provide the resources you need for both your application and monitoring stack.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Install Prometheus<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Prometheus is a time-series database that scrapes and stores metrics from configured targets. Install from the official release (not apt \u2014 the repo version is often outdated):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Create prometheus user\nsudo useradd --no-create-home --shell \/bin\/false prometheus\n\n# Download latest Prometheus (check https:\/\/prometheus.io\/download\/ for latest)\ncd \/tmp\nwget https:\/\/github.com\/prometheus\/prometheus\/releases\/download\/v2.53.1\/prometheus-2.53.1.linux-amd64.tar.gz\ntar xvf prometheus-2.53.1.linux-amd64.tar.gz\ncd prometheus-2.53.1.linux-amd64\n\n# Copy binaries\nsudo cp prometheus promtool \/usr\/local\/bin\/\nsudo chown prometheus:prometheus \/usr\/local\/bin\/prometheus \/usr\/local\/bin\/promtool\n\n# Create directories\nsudo mkdir -p \/etc\/prometheus \/var\/lib\/prometheus\nsudo cp consoles\/ console_libraries\/ \/etc\/prometheus\/ -r\nsudo chown -R prometheus:prometheus \/etc\/prometheus \/var\/lib\/prometheus<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Configure Prometheus<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create \/etc\/prometheus\/prometheus.yml:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>global:\n  scrape_interval: 15s\n  evaluation_interval: 15s\n\nscrape_configs:\n  - job_name: 'prometheus'\n    static_configs:\n      - targets: ['localhost:9090']\n\n  - job_name: 'node_exporter'\n    static_configs:\n      - targets: ['localhost:9100']<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a systemd service at \/etc\/systemd\/system\/prometheus.service and start it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\nsudo systemctl enable prometheus\nsudo systemctl start prometheus\nsudo systemctl status prometheus<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Install Node Exporter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Node Exporter exposes OS-level metrics (CPU, memory, disk, network). Download from the official releases, copy to \/usr\/local\/bin, and run as a systemd service listening on port 9100.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Download and install\ncd \/tmp\nwget https:\/\/github.com\/prometheus\/node_exporter\/releases\/download\/v1.8.2\/node_exporter-1.8.2.linux-amd64.tar.gz\ntar xvf node_exporter-1.8.2.linux-amd64.tar.gz\nsudo cp node_exporter-1.8.2.linux-amd64\/node_exporter \/usr\/local\/bin\/\nsudo useradd --no-create-home --shell \/bin\/false node_exporter\n\n# Start\nsudo systemctl daemon-reload\nsudo systemctl enable node_exporter\nsudo systemctl start node_exporter<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify: <code>curl http:\/\/localhost:9100\/metrics | head -20<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Install Grafana<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get install -y software-properties-common\nsudo add-apt-repository \"deb https:\/\/packages.grafana.com\/oss\/deb stable main\"\nwget -q -O - https:\/\/packages.grafana.com\/gpg.key | sudo apt-key add -\nsudo apt-get update\nsudo apt-get install -y grafana\nsudo systemctl enable grafana-server\nsudo systemctl start grafana-server<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Access Grafana at <code>http:\/\/your-vps-ip:3000<\/code>. Default login: admin \/ admin (change immediately).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Connect Grafana to Prometheus<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to Connections &gt; Add new connection in Grafana<\/li><li>Search for &#8220;Prometheus&#8221; and click it<\/li><li>Click &#8220;Create a Prometheus data source&#8221;<\/li><li>Set URL to <code>http:\/\/localhost:9090<\/code><\/li><li>Click &#8220;Save &amp; Test&#8221;<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Import a Dashboard<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to Dashboards &gt; Import<\/li><li>Enter dashboard ID <strong>1860<\/strong> (Node Exporter Full) and click &#8220;Load&#8221;<\/li><li>Select your Prometheus data source and click &#8220;Import&#8221;<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll immediately see CPU utilization per core, memory breakdown, disk I\/O, network traffic, system load, and uptime \u2014 all populated from your Node Exporter metrics.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7: Set Up Alerts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Grafana, go to Alerting &gt; Contact points and add email, Slack, or Telegram. Create alert rules for common failure conditions:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>High CPU:<\/strong> Alert when CPU usage exceeds 90% for 5 minutes<\/li><li><strong>Low disk:<\/strong> Alert when disk usage drops below 10% free<\/li><li><strong>High memory:<\/strong> Alert when memory usage exceeds 90% for 5 minutes<\/li><li><strong>Instance down:<\/strong> Alert when a target is unreachable (up == 0)<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Resource Usage of the Monitoring Stack<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Component<\/th><th>RAM<\/th><th>CPU<\/th><th>Disk (30d retention)<\/th><\/tr><\/thead><tbody><tr><td>Prometheus<\/td><td>100-200 MB<\/td><td>1-5% of 1 core<\/td><td>~5-15 GB<\/td><\/tr><tr><td>Node Exporter<\/td><td>15-25 MB<\/td><td>&lt;1% of 1 core<\/td><td>0 GB<\/td><\/tr><tr><td>Grafana<\/td><td>80-150 MB<\/td><td>1-3% of 1 core<\/td><td>~1 GB<\/td><\/tr><tr><td><strong>Total<\/strong><\/td><td><strong>~200-375 MB<\/strong><\/td><td><strong>~2-9%<\/strong><\/td><td><strong>~6-16 GB<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This stack fits comfortably alongside your application on a 2 GB VPS. On a 1 GB VPS, reduce Prometheus retention to 7-14 days.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Next Steps: Advanced Monitoring<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Add <strong>cAdvisor<\/strong> to monitor Docker containers<\/li><li>Add <strong>MySQL Exporter<\/strong> for database query performance<\/li><li>Add <strong>Blackbox Exporter<\/strong> for external endpoint uptime checks<\/li><li>Set up <strong>Grafana Loki<\/strong> for centralized log aggregation<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">With Prometheus and Grafana in place, you&#8217;ll catch resource exhaustion before downtime occurs, identify regressions instantly, and make data-driven upgrade decisions. For VPS plans with sufficient resources for both your application and a full observability stack, check <a href=\"https:\/\/virtualserversvps.com\/#providers\">recommended VPS configurations<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you run a VPS without monitoring, you&#8217;re flying blind. Resource leaks, traffic spikes, and cron jobs gone wrong can silently degrade performance until your site goes down. Prometheus and&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-512","post","type-post","status-publish","format-standard","hentry","category-vps-guides-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide - Virtual Servers VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-25T03:11:35+00:00\" \/>\n<meta name=\"author\" content=\"Virtual-Servers-Vps-Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virtual-Servers-Vps-Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/\",\"name\":\"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-06-25T03:11:35+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/\",\"name\":\"Virtual Servers VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\",\"name\":\"Virtual-Servers-Vps-Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"caption\":\"Virtual-Servers-Vps-Editor\"},\"sameAs\":[\"https:\/\/virtualserversvps.com\/blog\"],\"url\":\"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide - Virtual Servers VPS Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/","og_locale":"en_US","og_type":"article","og_title":"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide","og_description":"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide","og_url":"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-06-25T03:11:35+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/","url":"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/","name":"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-06-25T03:11:35+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/setup-prometheus-grafana-vps-monitoring\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Setting Up Prometheus and Grafana for VPS Monitoring: A Step-by-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/virtualserversvps.com\/blog\/#website","url":"https:\/\/virtualserversvps.com\/blog\/","name":"Virtual Servers VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0","name":"Virtual-Servers-Vps-Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","caption":"Virtual-Servers-Vps-Editor"},"sameAs":["https:\/\/virtualserversvps.com\/blog"],"url":"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/"}]}},"_links":{"self":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/comments?post=512"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/512\/revisions"}],"predecessor-version":[{"id":513,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/512\/revisions\/513"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}