# Fleet Server not respecting custom port config

**URL:** <https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [September 3, 2022, 8:30am UTC](https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590 "2022-09-03T08:30:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfarren240](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@bfarren240](https://discuss.elastic.co/u/bfarren240)\
**Post date:** [September 3, 2022, 8:30am UTC](https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590/1 "2022-09-03T08:30:54Z")

</div>

Upgraded ES and Kibana from 8.1.2 -\> 8.4.1.  
Un-enrolled my fleet server, and deployed a new fleet server agent with the following (newly created in 8.4.1) config:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5b547f83ea8e0cb3205f1ab5f671f91bdc0669c9.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/d/ed3e4594e827386bb7b865924eac34860c0d100b.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/9/49f0354fc5b540c500f50d2bd4a2018fdebaf32b.png)

However, the elastic agent does not respect the custom port config:

```auto
{"log.level":"error","@timestamp":"2022-09-03T08:27:29.676Z","log.origin":{"file.name":"lazy/lazy_acker.go","file.line":90},"message":"lazy acker: failed ack batch, enqueue for retry: []fleetapi.Action{(*fleetapi.ActionPolicyChange)(0xc000465ce0)}","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2022-09-03T08:27:34.975Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":293},"message":"Could not communicate with fleet-server Checking API will retry, error: fail to checkin to fleet-server: Post \"https://MyHostName:8220/api/fleet/agents/e7a7d528-f5c6-460e-a952-c8c12f0c9c56/checkin?\": dial tcp 192.168.1.167:8220: connectex: No connection could be made because the target machine actively refused it.","ecs.version":"1.6.0"}

```

Even though 'inspect' shows the proper port  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e2a1912e56da0ced58af02ba3c58087909558ba4.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/8/08875bbaca1eaaa401ba5be1de54f4199e9a0671.png)

I have no listing on 27001 within netstat

Any suggestions?

---

<div class="post-metadata">

**Author:** ![hendry.lim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendry.lim/32/71328_2.png) [@hendry.lim](https://discuss.elastic.co/u/hendry.lim)\
**Post date:** [September 3, 2022, 10:21am UTC](https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590/2 "2022-09-03T10:21:19Z")

</div>

Please share the command you used to run/initialise the Fleet Server.

---

<div class="post-metadata">

**Author:** ![bfarren240](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@bfarren240](https://discuss.elastic.co/u/bfarren240)\
**Post date:** [September 3, 2022, 3:49pm UTC](https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590/3 "2022-09-03T15:49:28Z")

</div>

Copied from the Kibana gui, minus the download & extraction since files were local

```auto
PS C:\ELK\elastic-agent-8.4.1-windows-x86_64> .\elastic-agent.exe install `
>> --fleet-server-es=https://192.168.1.167:27007 `
>> --fleet-server-service-token=redacted `
>> --fleet-server-policy=c016f190-2b5f-11ed-84ca-5b21ae8fefdb `
>> --fleet-server-es-ca-trusted-fingerprint=redacted

```

---

<div class="post-metadata">

**Author:** ![hendry.lim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendry.lim/32/71328_2.png) [@hendry.lim](https://discuss.elastic.co/u/hendry.lim)\
**Post date:** [September 4, 2022, 5:13am UTC](https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590/4 "2022-09-04T05:13:44Z")

</div>

You may try to specify `--fleet-server-port=27001` on the command line.

I believe the `fleet.hosts` configuration through inspect is used by the Elastic Agent not Fleet Server.

---

<div class="post-metadata">

**Author:** ![bfarren240](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@bfarren240](https://discuss.elastic.co/u/bfarren240)\
**Post date:** [September 9, 2022, 1:00am UTC](https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590/5 "2022-09-09T01:00:00Z")

</div>

Thanks for the recommendation! Adding that line, along with changing the fleet server host to 0.0.0.0 (in fleet server integration settings) got it working.

Thank you!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d5b93313c48303f8412c65e8057ef7e0a0bc6a7f.png)

---

<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:** [October 7, 2022, 1:00am UTC](https://discuss.elastic.co/t/fleet-server-not-respecting-custom-port-config/313590/6 "2022-10-07T01:00:14Z")

</div>

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