{"id":15834,"date":"2025-10-10T12:07:32","date_gmt":"2025-10-10T06:37:32","guid":{"rendered":"https:\/\/www.skynats.com\/?p=15834"},"modified":"2025-10-13T12:07:59","modified_gmt":"2025-10-13T06:37:59","slug":"how-to-install-and-configure-prometheus-on-ubuntu-for-system-monitoring","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-install-and-configure-prometheus-on-ubuntu-for-system-monitoring\/","title":{"rendered":"How to Install and Configure Prometheus on Ubuntu for System Monitoring"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-introduction\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Prometheus is a powerful open-source monitoring system designed for collecting metrics from targets, storing them efficiently, and allowing users to query and analyze them in real time. In this blog we&#8217;ll learn how to install Prometheus on Ubuntu server, which will serve as the monitoring server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 1: Download and Install Prometheus<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-download-the-latest-stable-prometheus-release\"><strong>Download the latest stable Prometheus release:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/github.com\/prometheus\/prometheus\/releases\/download\/v2.37.6\/prometheus-2.37.6.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the version number with the latest one if needed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-extract-the-tarball\"><strong>Extract the tarball:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>tar xvfz prometheus-2.37.6.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-remove-the-archive-optional\"><strong>Remove the archive (optional):<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>rm prometheus-2.37.6.linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-create-necessary-directories\"><strong>Create necessary directories:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/etc\/prometheus \/var\/lib\/prometheus<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-move-into-the-extracted-directory\"><strong>Move into the extracted directory:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cd prometheus-2.37.6.linux-amd64<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-move-prometheus-binaries-to-the-system-path\"><strong>Move Prometheus binaries to the system path:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mv prometheus promtool \/usr\/local\/bin\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-move-config-and-support-files\"><strong>Move config and support files:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mv prometheus.yml \/etc\/prometheus\/\nsudo mv consoles\/ console_libraries\/ \/etc\/prometheus\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-verify-the-installation\"><strong>Verify the installation:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>prometheus --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>prometheus, version 2.37.6<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-step-2-configure-prometheus-as-a-systemd-service\"><strong>Step 2: Configure Prometheus as a systemd Service<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-create-a-prometheus-system-user\"><strong>Create a Prometheus system user:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo useradd -rs \/bin\/false prometheus<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-set-directory-ownership\"><strong>Set directory ownership:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown -R prometheus: \/etc\/prometheus \/var\/lib\/prometheus<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-create-a-systemd-service-file\"><strong>Create a systemd service file:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/systemd\/system\/prometheus.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=Prometheus\nWants=network-online.target\nAfter=network-online.target\n\n&#91;Service]\nUser=prometheus\nGroup=prometheus\nType=simple\nRestart=on-failure\nRestartSec=5s\nExecStart=\/usr\/local\/bin\/prometheus \\\n  --config.file \/etc\/prometheus\/prometheus.yml \\\n  --storage.tsdb.path \/var\/lib\/prometheus\/ \\\n  --web.console.templates=\/etc\/prometheus\/consoles \\\n--web.console.libraries=\/etc\/prometheus\/console_libraries \\\n  --web.listen-address=0.0.0.0:9090 \\\n  --web.enable-lifecycle \\\n  --log.level=info\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-reload-systemd-and-enable-the-service\"><strong>Reload systemd and enable the service:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\nsudo systemctl enable prometheus<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-start-prometheus\"><strong>Start Prometheus:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start prometheus<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-check-status\"><strong>Check status:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status prometheus<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see active (running) status.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 3: Access the Prometheus Web UI<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open a browser and go to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;&lt;your-server-ip&gt;:9090<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll see the Prometheus web UI. It\u2019s currently monitoring only itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Successfully installed and configured Prometheus on <a href=\"https:\/\/ubuntu.com\/\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">Ubuntu<\/mark><\/a> server, running it as a systemd service. This sets the stage for monitoring other systems by adding them to the prometheus.yml configuration later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up Prometheus for efficient system monitoring can be challenging without the right expertise. If you\u2019re looking for reliable assistance on how to install Prometheus on Ubuntu or need complete <a href=\"https:\/\/www.skynats.com\/server-management\/\">Server Management services<\/a>, our experienced engineers are here to help<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Prometheus is a powerful open-source monitoring system designed for collecting metrics from targets, storing them efficiently, and allowing users to query and analyze them in real time. In this blog we&#8217;ll learn how to install Prometheus on Ubuntu server, which will serve as the monitoring server. Step 1: Download and Install Prometheus Download the [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[302],"class_list":["post-15834","post","type-post","status-publish","format-standard","hentry","category-blog","tag-server-management-services"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=15834"}],"version-history":[{"count":4,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15834\/revisions"}],"predecessor-version":[{"id":15840,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15834\/revisions\/15840"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=15834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=15834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=15834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}