Skip to main content
This guide walks through installing Prometheus on a Linux system using a dedicated non-login system user and a systemd unit. The steps place Prometheus binaries, configuration, console files, and time-series data in conventional filesystem locations so the service runs securely and predictably. Overview
  1. Create a system user for Prometheus.
  2. Create directories for configuration and storage.
  3. Download and install Prometheus binaries.
  4. Install console files and the configuration file.
  5. Create the systemd service unit.
  6. Start, enable, and verify the Prometheus service.
Prerequisites
  • A Linux host with systemd (most modern distributions).
  • sudo or root privileges.
  • A Prometheus release tarball from the official downloads page: https://prometheus.io/download/
Step 1 — Create a dedicated Prometheus user Create a system user that cannot log in and does not create a home directory. Running Prometheus under its own user improves security and makes ownership straightforward.
Step 2 — Create directories for configuration and storage Create standard directories for Prometheus configuration and TSDB data, set secure permissions, and ensure ownership is assigned to the prometheus user:
Step 3 — Download and install Prometheus binaries Download the appropriate Prometheus tarball from the official releases page and extract it. From the extracted prometheus-<version>.linux-<arch> directory, copy the prometheus and promtool binaries into a directory on the system PATH and make them executable:
Step 4 — Install console files and the configuration file Copy the default consoles and console_libraries directories and the prometheus.yml configuration file into /etc/prometheus. Ensure the prometheus user owns everything under /etc/prometheus:
Step 5 — Create the systemd service unit Create the systemd unit file at /etc/systemd/system/prometheus.service with the following contents. This unit runs Prometheus as the prometheus user and points Prometheus to the configuration and storage paths we created above:
Systemd unit filenames and unit names are case-sensitive. Use the lowercase unit name when running systemctl (for example: prometheus.service or prometheus).
Step 6 — Reload systemd, start, enable, and verify Reload systemd to pick up the new unit, then start and enable the service so it runs on boot. Check the service status and logs if needed:
A healthy service will show Active: active (running) in the status output. If you see errors, inspect recent logs:
Quick reference table Verification Open your browser and go to: http://localhost:9090 — this is the default Prometheus web UI. If you are running Prometheus on a remote host, replace localhost with the host IP or domain and ensure any firewall rules allow access to port 9090. Troubleshooting tips
  • Verify paths in the systemd unit match where you copied the binaries and config (/usr/local/bin/prometheus, /etc/prometheus/prometheus.yml, /var/lib/prometheus).
  • Ensure directory ownership: /etc/prometheus and /var/lib/prometheus must be owned by the prometheus user.
  • Use sudo journalctl -u prometheus to inspect logs for startup errors: https://www.freedesktop.org/software/systemd/man/journalctl.html
  • If Prometheus fails to bind to port 9090, ensure no other process is using that port and that firewall rules permit access.
Always download Prometheus binaries from the official releases page: https://prometheus.io/download/. Verify checksums for the tarball if available to avoid installing tampered binaries.
Links and references

Watch Video