Running Prometheus

All Topics

Installing Prometheus

Prometheus Docker Config

Download pre-built binaries from the official releases page. Prometheus provides compiled binaries for Linux, macOS, and Windows. You can download the appropriate version for your system directly from the official GitHub releases.

Also available as a Docker image (prom/prometheus). If you are using containers, the official Docker image allows you to run Prometheus without manual installation. This is especially common in Kubernetes and cloud-native environments.

On Linux, extract and run the binary. After downloading the .tar.gz file, extract it and run:

tar xvfz prometheus-*.tar.gz
cd prometheus-*

Prometheus includes a default configuration file (prometheus.yml) in the package:

global:
  scrape_interval:     15s
  evaluation_interval: 15s

rule_files:
  # - "first.rules"
  # - "second.rules"

scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets: ['localhost:9090']

To start Prometheus with this configuration:

./prometheus --config.file=prometheus.yml

Built-in web UI available at http://localhost:9090. Once running, Prometheus provides a web interface where you can:

  • Execute PromQL queries
  • Explore collected metrics
  • Check target status
  • View alert rules

No external database or additional services are required to start — Prometheus runs as a single self-contained binary.

Running with Docker Compose. You can also run Prometheus easily using Docker Compose. Create a compose.yml file:

services:
  prometheus:
    image: prom/prometheus:v3.2.1
    container_name: prometheus
    hostname: prometheus
    ports:
      - "9090:9090"
    volumes:
      - ./:/etc/prometheus

Place your prometheus.yml in the same directory and run docker compose up.

For a step-by-step walkthrough, see the official First Steps with Prometheus guide.