# Prometheus configuration error

**URL:** <https://community.grafana.com/t/prometheus-configuration-error/72296>\
**Category:** Prometheus\
**Tags:** prometheus, docker, configuration\
**Created:** [September 13, 2022, 3:48pm UTC](https://community.grafana.com/t/prometheus-configuration-error/72296 "2022-09-13T15:48:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shruti](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@shruti](https://community.grafana.com/u/shruti)\
**Post date:** [September 13, 2022, 3:48pm UTC](https://community.grafana.com/t/prometheus-configuration-error/72296/1 "2022-09-13T15:48:24Z")

</div>

While creating data source in graphana for prometheus url [http://localhost:9090](http://localhost:9090). It throws error .

Error reading Prometheus: Post “[http://localhost:9090/api/v1/query](http://localhost:9090/api/v1/query)”: dial tcp 127.0.0.1:9090: connect: connection refused

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [September 13, 2022, 3:54pm UTC](https://community.grafana.com/t/prometheus-configuration-error/72296/2 "2022-09-13T15:54:13Z")

</div>

Welcome

Where is your prometheus installed at in relation to grafana?

---

<div class="post-metadata">

**Author:** ![shruti](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@shruti](https://community.grafana.com/u/shruti)\
**Post date:** [September 13, 2022, 4:01pm UTC](https://community.grafana.com/t/prometheus-configuration-error/72296/3 "2022-09-13T16:01:38Z")

</div>

prometheus is installed using docker . This is the command : docker run -d --name prometheus1 -p 9091:9090 -v /tmp/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus

---

<div class="post-metadata">

**Author:** ![usman.ahmad](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/usman.ahmad/32/29706_2.png) [@usman.ahmad](https://community.grafana.com/u/usman.ahmad)\
**Post date:** [September 19, 2022, 2:49pm UTC](https://community.grafana.com/t/prometheus-configuration-error/72296/4 "2022-09-19T14:49:12Z")

</div>

Hi @shruti,

I think the error could be of the possible reasons;

1. The firewall might be blocking the ports

2. I think here most likely reason is that your prometheus.yml may have the wrong parameter for the server.

Can you please share your prometheus.yml file here so that the community see it.

Thanks
