# Change grpc port to 6788 on fleet controled agent

**URL:** <https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416>\
**Category:** Elastic Agent\
**Created:** [July 18, 2026, 9:37am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416 "2026-07-18T09:37:30Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)\
**Post date:** [July 18, 2026, 9:37am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/1 "2026-07-18T09:37:30Z")

</div>

Hello,

i want to install UniFi OS Server on my windows server.

Unfortunately the elastic agent is using port 6789.

I wonder if i can change this with a dedicated policy for this server?

seems like agent.grpc.port: 6788 is the right setting.

How could i implement this change?

If i disable the elastic agent the UniFi OS Server can boot.

---

<div class="post-metadata">

**Author:** ![cartergray234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cartergray234/32/147857_2.png) [@cartergray234](https://discuss.elastic.co/u/cartergray234)\
**Post date:** [July 18, 2026, 9:38am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/2 "2026-07-18T09:38:50Z")

</div>

Yes, it's possible if your Elastic Agent supports changing `agent.grpc.port`. If you're using Fleet, update the setting in the agent policy and restart the agent. Are you using a Fleet-managed or standalone agent?

---

<div class="post-metadata">

**Author:** ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)\
**Post date:** [July 18, 2026, 10:11am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/3 "2026-07-18T10:11:08Z")

</div>

Thanks @cartergray234 .

I wonder where i can find this setting? I checked the configuration (settings) of the policy more than one time but somehow i can not find the right place to change it?

Can you assist me please?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 18, 2026, 3:12pm UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/4 "2026-07-18T15:12:10Z")

</div>

Hmmm @GKre

For fleet managed The only place I think you can see then is in the Policy although not all setting will work so you will need to try and see.

Its at he very bottom

> #### **Advanced internal YAML settings**
> 
> Control advanced agent internal settings and feature flags. No stability guarantee is provided for these settings.

 ![Screenshot 2026-07-18 at 8.09.45 AM](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1a9d18017ebca10a7582366c52282a6deaba475b.png)  
 ![Screenshot 2026-07-18 at 8.09.50 AM](https://us1.discourse-cdn.com/elastic/original/3X/2/c/2ccd915c124e0e594be7ca6d6e322c9c1baac05a.png)

---

<div class="post-metadata">

**Author:** ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)\
**Post date:** [July 19, 2026, 5:33am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/5 "2026-07-19T05:33:59Z")

</div>

sorry for missing the information - i am using fleet.

The advanced internal YAML setting seems to be the point to change this config.  
I found a note on github - maybe the solution is documented there:

> <https://github.com/elastic/elastic-agent/issues/3998>
>
> Today the control protocol uses local TCP on port 6789 to communicate with compo…nents.
> 
> https://github.com/elastic/elastic-agent/blob/3a3d31c1b3e3af253bd37af4beb3dd979f3020cf/elastic-agent.yml#L165-L169
> 
> We regularly see issues where a firewall or iptables rules are configured to drop all traffic except for ports that have explicitly been whitelisted. The symptoms of this problem are not obvious in the agent logs and require uses to take extra steps to have Elastic Agent run at all.
> 
> We can solve this problem and a few others by moving away from local TCP to using Unix sockets or Windows named pipes to communicate with subprocesses.
> 
> This change should be made for:
> 1. The control protocol connection to supervised components. This change should be transparent to components as they can simply be passed the new address in the connection information message used to bootstrap communication with agent. The file ownership of the sockets must be set to match the privilege level of the agent.
> 
> https://github.com/elastic/elastic-agent-client/blob/f57f63489dbbce98522c174dae00158f895ddc84/elastic-agent-client.proto#L458-L463
> 
> 2. The connection info server used to bootstrap endpoint security. In this case the connection info socket must be owed by root. This change must be coordinated with the endpoint security team.
> 
> https://github.com/elastic/elastic-agent/blob/3a3d31c1b3e3af253bd37af4beb3dd979f3020cf/pkg/component/runtime/conn\_info\_server.go#L31-L43

thx for helping.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 19, 2026, 2:21pm UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/6 "2026-07-19T14:21:16Z")

</div>

Hi @GKre

Good Find... so did you try the way I showed does that work?

It would be to confirm whether that works or not.

It looks like if you add it where I said and add it like this

```auto
agent.grpc:
  address: localhost
  port: 16788

```

That is should work ... I just tested and when I ran

`elastic-agent inspect`

I see...

```auto
    internal:
      agent.grpc:
        address: localhost
        port: 16788

```

Perhaps that is easier and repeatable way

---

<div class="post-metadata">

**Author:** ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)\
**Post date:** [July 20, 2026, 5:03am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/7 "2026-07-20T05:03:53Z")

</div>

thank you stephenb.  
this was the missing point as i did not know the right syntax for the change. I will give it a try and report the result.

---

<div class="post-metadata">

**Author:** ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)\
**Post date:** [July 20, 2026, 7:11am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/8 "2026-07-20T07:11:18Z")

</div>

seems like it does not work - the agent is using 6789:  
netstat -ano | findstr :6788  
netstat -ano | findstr :6789  
TCP 127.0.0.1:6789 0.0.0.0:0 ABHÖREN 2896  
TCP 127.0.0.1:6789 127.0.0.1:49807 HERGESTELLT 2896  
TCP 127.0.0.1:6789 127.0.0.1:49809 HERGESTELLT 2896  
TCP 127.0.0.1:6789 127.0.0.1:49925 HERGESTELLT 2896  
TCP 127.0.0.1:6789 127.0.0.1:50027 HERGESTELLT 2896  
TCP 127.0.0.1:49807 127.0.0.1:6789 HERGESTELLT 7120  
TCP 127.0.0.1:49809 127.0.0.1:6789 HERGESTELLT 6376  
TCP 127.0.0.1:49925 127.0.0.1:6789 HERGESTELLT 5856  
TCP 127.0.0.1:50027 127.0.0.1:6789 HERGESTELLT 996

And yes - i checked that the setting is active and rebootet the server.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 20, 2026, 2:28pm UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/9 "2026-07-20T14:28:41Z")

</div>

Yup you are correct my approach does not work ...

When I run elastic agent inspect after changing the `elastic-agent.yml` I see this

```auto
agent:
  download:
    sourceURI: https://artifacts.elastic.co/downloads/
  features: null
  grpc:
    address: localhost
    port: 16788. <<<< Correct 
  headers: null
  id: c209975b-a937-4bd0-8645-56b9bb9f1dfc
  internal:
    agent:
      grpc:
        address: localhost
        port: 16788 <<< Not Correct where my fix put it 

```

---

<div class="post-metadata">

**Author:** ![Mario\_22](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@Mario\_22](https://discuss.elastic.co/u/Mario_22)\
**Post date:** [July 24, 2026, 9:50am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/10 "2026-07-24T09:50:04Z")

</div>

I have the same problem, but with Microsoft Exhange services. In this case with MSExchangeFrontendTransport and port 6789.  
I didn't test a hint from this post. Yet.

---

<div class="post-metadata">

**Author:** ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)\
**Post date:** [July 24, 2026, 10:28am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/11 "2026-07-24T10:28:11Z")

</div>

Hello Mario and "welcome to the club" 😉  
As far as i understand this is a long running issue.

There's a github threat telling something that the internal communication should switch to "named pipes" - guess not yet realized.

The individual configuration via fleet did not solve the problem. I was not able to switch the port.

So at the end we either find a way to change the port in the application or we need to disable the elastic agent.

Hopefully the dev team will see this discussion and find a better way.

Best wishes

G.

---

<div class="post-metadata">

**Author:** ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)\
**Post date:** [August 8, 2026, 4:07am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/12 "2026-08-08T04:07:03Z")

</div>

Hello @stephenb ,  
any update to this issue from Elastic Team?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 8, 2026, 4:44am UTC](https://discuss.elastic.co/t/change-grpc-port-to-6788-on-fleet-controled-agent/388416/13 "2026-08-08T04:44:56Z")

</div>

@GKre Best thing is to follow the issue..

I have no influence over that work.
