Installation
Using pre-compiled binaries
We provide precompiled binaries for most official Prometheus components. Checkout the download section for a list of allavailable versions.
From source
For building Prometheus components from source, see the Makefile
targets inthe respective repository.
Using Docker
All Prometheus services are available as Docker images onQuay.io orDocker Hub.
Running Prometheus on Docker is as simple as docker run -p 9090:9090prom/prometheus
. This starts Prometheus with a sampleconfiguration and exposes it on port 9090.
The Prometheus image uses a volume to store the actual metrics. Forproduction deployments it is highly recommended to use theData Volume Containerpattern to ease managing the data on Prometheus upgrades.
To provide your own configuration, there are several options. Here aretwo examples.
Volumes & bind-mount
Bind-mount your prometheus.yml
from the host by running:
docker run -p 9090:9090 -v /tmp/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
Or use an additional volume for the config:
docker run -p 9090:9090 -v /prometheus-data \
prom/prometheus --config.file=/prometheus-data/prometheus.yml
Custom image
To avoid managing a file on the host and bind-mount it, theconfiguration can be baked into the image. This works well if theconfiguration itself is rather static and the same across allenvironments.
For this, create a new directory with a Prometheus configuration and aDockerfile
like this:
FROM prom/prometheus
ADD prometheus.yml /etc/prometheus/
Now build and run it:
docker build -t my-prometheus .
docker run -p 9090:9090 my-prometheus
A more advanced option is to render the configuration dynamically on startwith some tooling or even have a daemon update it periodically.
Using configuration management systems
If you prefer using configuration management systems you might be interested inthe following third-party contributions: