# Elastic-agent not connecting to fleet server

**URL:** <https://discuss.elastic.co/t/elastic-agent-not-connecting-to-fleet-server/337744>\
**Category:** Elastic Agent\
**Created:** [July 6, 2023, 4:30am UTC](https://discuss.elastic.co/t/elastic-agent-not-connecting-to-fleet-server/337744 "2023-07-06T04:30:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pennywise01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pennywise01/32/123268_2.png) [@pennywise01](https://discuss.elastic.co/u/pennywise01)\
**Post date:** [July 6, 2023, 4:30am UTC](https://discuss.elastic.co/t/elastic-agent-not-connecting-to-fleet-server/337744/1 "2023-07-06T04:30:40Z")

</div>

Hi, I am still new to this elastic-agent stuff. I am trying to connect my elastic agent that i want to install on my vm on GCP to connect to my fleet server on AWS EC2. I have already configured firewall rules to allow connection on port 8220 (default port using by elastic-agent) but i keep getting connection refused error. Can please help me on this? Below is the error mentioned

> Error: fail to enroll: fail to execute request to fleet-server: dial tcp fleet-ip:8220: connect: connection refused

---

<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:** [August 3, 2023, 4:30am UTC](https://discuss.elastic.co/t/elastic-agent-not-connecting-to-fleet-server/337744/2 "2023-08-03T04:30:41Z")

</div>

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