- Create a system user for Prometheus.
- Create directories for configuration and storage.
- Download and install Prometheus binaries.
- Install console files and the configuration file.
- Create the systemd service unit.
- Start, enable, and verify the Prometheus service.
- A Linux host with systemd (most modern distributions).
sudoor root privileges.- A Prometheus release tarball from the official downloads page: https://prometheus.io/download/
prometheus user:
prometheus-<version>.linux-<arch> directory, copy the prometheus and promtool binaries into a directory on the system PATH and make them executable:
consoles and console_libraries directories and the prometheus.yml configuration file into /etc/prometheus. Ensure the prometheus user owns everything under /etc/prometheus:
/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).Active: active (running) in the status output. If you see errors, inspect recent logs:
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/prometheusand/var/lib/prometheusmust be owned by theprometheususer. - Use
sudo journalctl -u prometheusto 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.
- Prometheus downloads: https://prometheus.io/download/
- systemd overview: https://www.freedesktop.org/wiki/Software/systemd/
- systemctl manual: https://www.freedesktop.org/software/systemd/man/systemctl.html
- journalctl manual: https://www.freedesktop.org/software/systemd/man/journalctl.html