# Fleet server agent unable to start- Connection refused

**URL:** <https://discuss.elastic.co/t/fleet-server-agent-unable-to-start-connection-refused/285818>\
**Category:** SIEM\
**Tags:** fleet\
**Created:** [October 4, 2021, 12:54pm UTC](https://discuss.elastic.co/t/fleet-server-agent-unable-to-start-connection-refused/285818 "2021-10-04T12:54:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Psyhil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/psyhil/32/116080_2.png) [@Psyhil](https://discuss.elastic.co/u/Psyhil)\
**Post date:** [October 4, 2021, 12:54pm UTC](https://discuss.elastic.co/t/fleet-server-agent-unable-to-start-connection-refused/285818/1 "2021-10-04T12:54:07Z")

</div>

Hi there,

I have ELK running and am trying to test out Fleet and endpoint agent.  
To perform the test, I used the quick start deployment mode using self-signed certificate.  
However when trying to install the agent on a windows system, getting the below error.  
I am not sure what I am doing wrong and any guidance to overcome the issue is much appreciated.

```auto
2021-10-04T13:17:59.188+0100 INFO cmd/enroll_cmd.go:354 Generating self-signed certificate for Fleet Server
2021-10-04T13:18:01.457+0100 INFO cmd/enroll_cmd.go:668 Waiting for Elastic Agent to start Fleet Server
2021-10-04T13:18:04.469+0100 INFO cmd/enroll_cmd.go:701 Fleet Server - Starting
2021-10-04T13:18:10.509+0100 INFO cmd/enroll_cmd.go:701 Fleet Server - Error - dial tcp redacted:9200: connectex: No connection could be made because the target machine ac
tively refused it.

```

---

<div class="post-metadata">

**Author:** ![blaker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blaker/32/65621_2.png) [@blaker](https://discuss.elastic.co/u/blaker)\
**Post date:** [October 4, 2021, 1:21pm UTC](https://discuss.elastic.co/t/fleet-server-agent-unable-to-start-connection-refused/285818/2 "2021-10-04T13:21:05Z")

</div>

@Psyhil Based on the error it seems the Fleet Server is having issues communicating with Elasticsearch. You should ensure that Elasticsearch is working correctly and the IP/port that your provided is correct.

---

<div class="post-metadata">

**Author:** ![Psyhil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/psyhil/32/116080_2.png) [@Psyhil](https://discuss.elastic.co/u/Psyhil)\
**Post date:** [October 7, 2021, 11:18am UTC](https://discuss.elastic.co/t/fleet-server-agent-unable-to-start-connection-refused/285818/3 "2021-10-07T11:18:00Z")

</div>

Thank you @blaker !  
such a noob mistake I did, you are right. The port 9200 is not accessible from the server I was trying to enroll.  
Thank you once again.

---

<div class="post-metadata">

**Author:** ![Psyhil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/psyhil/32/116080_2.png) [@Psyhil](https://discuss.elastic.co/u/Psyhil)\
**Post date:** [October 7, 2021, 3:27pm UTC](https://discuss.elastic.co/t/fleet-server-agent-unable-to-start-connection-refused/285818/4 "2021-10-07T15:27:09Z")

</div>

Hi @blaker  
Earlier it was definitely port access issue as you pointed and hence got the ports 9200 and 8220 accessible however when again tried to enroll the agent, ran into a new error.

```auto
> .\elastic-agent.
exe install -f `
>> --fleet-server-es=http://redacted:9200 `
>> --fleet-server-service-token=redacted
sQQ `
>> --fleet-server-policy=85f34360-fc44-11eb-99c0-67f1c8a92eb9
2021-10-07T16:04:36.843+0100 INFO cmd/enroll_cmd.go:354 Generating self-signed certificate for Fleet Server
2021-10-07T16:06:10.250+0100 INFO cmd/enroll_cmd.go:668 Waiting for Elastic Agent to start Fleet Server
2021-10-07T16:06:12.163+0100 INFO cmd/enroll_cmd.go:701 Fleet Server - Starting
2021-10-07T16:06:13.131+0100 INFO cmd/enroll_cmd.go:701 Fleet Server - Error - EOF
2021-10-07T16:06:18.911+0100 INFO cmd/enroll_cmd.go:701 Fleet Server - Starting
2021-10-07T16:06:19.875+0100 INFO cmd/enroll_cmd.go:701 Fleet Server - Error - EOF
2021-10-07T16:06:25.700+0100 INFO cmd/enroll_cmd.go:706 Fleet Server - Error - EOF
2021-10-07T16:06:28.606+0100 INFO cmd/enroll_cmd.go:701 Fleet Server - Restartinghere

```

any details on what the error is about?  
If it helps, I am using a self signed certificate which is being generated on host using quick start deployment as used earlier.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2021, 3:27pm UTC](https://discuss.elastic.co/t/fleet-server-agent-unable-to-start-connection-refused/285818/5 "2021-11-04T15:27:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
