- Create a system user for Prometheus (non-login).
- Create directories for configuration and data.
- Install Prometheus binaries and console files.
- Set ownership and permissions.
- Install the Prometheus systemd service and start it.
- A Linux system with
sudoprivileges. - A Prometheus tarball downloaded from the official site (see links below), or the binaries available locally.
- Basic familiarity with systemd, users, and file permissions.
- Prometheus downloads: https://prometheus.io/download/
- systemd documentation: https://www.freedesktop.org/wiki/Software/systemd/
- Create the
prometheususer and directories
- Set ownership for the directories
prometheus user and group so Prometheus can read/write appropriately:
- Install the Prometheus binaries
wget and tar:
prometheus and promtool binaries to /usr/local/bin and set ownership and executable permissions:
- Install console files and the Prometheus configuration
consoles and console_libraries directories into /etc/prometheus so the web UI templates are available:
prometheus user can read these files:
prometheus.yml) into place and set ownership:
Make sure the configuration filename you copy matches the path referenced by the systemd service (below we reference
/etc/prometheus/prometheus.yml). Also ensure the prometheus binary is executable and owned by the prometheus user.- Create the systemd service file
/etc/systemd/system/prometheus.service with the following contents. This unit uses the common startup options and paths used above:
ExecStart accordingly.
Important: Ensure the
--config.file and --storage.tsdb.path values in the systemd unit point to the exact files/directories you created. Mismatched paths are a common cause of startup failures.- Reload systemd, start and enable the service
- Verify Prometheus is running
active (running) status. If there are problems, follow the logs to debug:
Example: verify config syntax with
promtool:
- Access the Prometheus web UI
localhost with your server IP or DNS name and ensure port 9090 is allowed through any firewall.
If you need to adjust the listening address or port, see the Prometheus flags in the official docs.
References and further reading
- Prometheus download and releases: https://prometheus.io/download/
- Prometheus configuration reference: https://prometheus.io/docs/prometheus/latest/configuration/configuration/
- systemd unit documentation: https://www.freedesktop.org/wiki/Software/systemd/