Installation

Using pre-compiled binaries

We provide precompiled binaries for most official Prometheus components. Check out the download section for a list of all available versions.

From source

For building Prometheus components from source, see the Makefile targets in the respective repository.

Using Docker

All Prometheus services are available as Docker images on Quay.io or Docker Hub.

Running Prometheus on Docker is as simple as docker run -p 9090:9090 prom/prometheus. This starts Prometheus with a sample configuration and exposes it on port 9090.

The Prometheus image uses a volume to store the actual metrics. For production deployments it is highly recommended to use a named volume to ease managing the data on Prometheus upgrades.

To provide your own configuration, there are several options. Here are two examples.

Volumes & bind-mount

Bind-mount your prometheus.yml from the host by running:

  1. docker run \
  2. -p 9090:9090 \
  3. -v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml \
  4. prom/prometheus

Or bind-mount the directory containing prometheus.yml onto /etc/prometheus by running:

  1. docker run \
  2. -p 9090:9090 \
  3. -v /path/to/config:/etc/prometheus \
  4. prom/prometheus

Custom image

To avoid managing a file on the host and bind-mount it, the configuration can be baked into the image. This works well if the configuration itself is rather static and the same across all environments.

For this, create a new directory with a Prometheus configuration and a Dockerfile like this:

  1. FROM prom/prometheus
  2. ADD prometheus.yml /etc/prometheus/

Now build and run it:

  1. docker build -t my-prometheus .
  2. docker run -p 9090:9090 my-prometheus

A more advanced option is to render the configuration dynamically on start with 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 in the following third-party contributions:

Ansible

Chef

Puppet

SaltStack

This documentation is open-source. Please help improve it by filing issues or pull requests.