# Prometheus on portainer failing to deply

**URL:** <https://discuss.prometheus.io/t/prometheus-on-portainer-failing-to-deply/2235>\
**Category:** General Help/Support\
**Created:** [April 16, 2024, 6:31am UTC](https://discuss.prometheus.io/t/prometheus-on-portainer-failing-to-deply/2235 "2024-04-16T06:31:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamthisguy](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@iamthisguy](https://discuss.prometheus.io/u/iamthisguy)\
**Post date:** [April 16, 2024, 6:31am UTC](https://discuss.prometheus.io/t/prometheus-on-portainer-failing-to-deply/2235/1 "2024-04-16T06:31:09Z")

</div>

Hi team,

Trying to deploy prometheus on portainer.

However when deploying the stack, I see the following error:

`caller=main.go:521 level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yaml)" file=/etc/prometheus/prometheus.yaml err="read /etc/prometheus/prometheus.yaml: is a directory"`

**/tmp/prometheus.yaml**

```auto
global:
  scrape_interval: 15s # By default, scrape targets every 15 seconds.

scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'
    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']

```

**docker compose**

```auto
---
volumes:
  prometheus-data:
    driver: local
services:
  prometheus:
    image: docker.io/prom/prometheus:v2.51.2
    container_name: prometheus
    ports:
      - 9090:9090
    command: "--config.file=/etc/prometheus/prometheus.yaml"
    volumes:
      - /tmp/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
      - prometheus-data:/prometheus
    restart: unless-stopped

```

any ideas why this happens? and how to fix it?
