# Error: could not start the HTTP server for the API: listen tcp 127.0.0.1:6791: bind: address already in use

**URL:** <https://discuss.elastic.co/t/error-could-not-start-the-http-server-for-the-api-listen-tcp-127-0-0-1-bind-address-already-in-use/342447>\
**Category:** Elastic Observability\
**Tags:** fleet\
**Created:** [September 6, 2023, 1:18pm UTC](https://discuss.elastic.co/t/error-could-not-start-the-http-server-for-the-api-listen-tcp-127-0-0-1-bind-address-already-in-use/342447 "2023-09-06T13:18:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tirelibirefe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tirelibirefe/32/71511_2.png) [@tirelibirefe](https://discuss.elastic.co/u/tirelibirefe)\
**Post date:** [September 6, 2023, 1:18pm UTC](https://discuss.elastic.co/t/error-could-not-start-the-http-server-for-the-api-listen-tcp-127-0-0-1-bind-address-already-in-use/342447/1 "2023-09-06T13:18:19Z")

</div>

Hello,  
I have 6 node EKS cluster and installed Elasticsearch/Kibana 8.9.1 . I have been struggling with Fleet.

Although 5 elastic-agent pods works on 5 nodes, 1 elastic-agent on 1 node gives following error:

`Error: could not start the HTTP server for the API: listen tcp 127.0.0.1:6791: bind: address already in use`

What/where do I search for fix, could you please advise?

Thanks& Regards

---

<div class="post-metadata">

**Author:** ![hamidallaoui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hamidallaoui/32/122313_2.png) [@hamidallaoui](https://discuss.elastic.co/u/hamidallaoui)\
**Post date:** [September 19, 2023, 10:04am UTC](https://discuss.elastic.co/t/error-could-not-start-the-http-server-for-the-api-listen-tcp-127-0-0-1-bind-address-already-in-use/342447/2 "2023-09-19T10:04:21Z")

</div>

Hi @tirelibirefe,

I am facing a similar issue having that 6791 port used by another application and I would like to change the default port used in Elastic Agent to something like 6790.  
I tried to added below in /opt/Elastic/Agent/elastic-agent.yml and restarted the agent but it did not work.

```auto
agent.monitoring:
  http:
    port: 6790

```

If someone has a fix it will be high appreciated.

Thanks.
