# Lab 2.1 - Elastic Agent - Adding Nginx Integration/Agent fail

**URL:** <https://discuss.elastic.co/t/lab-2-1-elastic-agent-adding-nginx-integration-agent-fail/380490>\
**Category:** Elastic Training\
**Created:** [July 28, 2025, 9:49am UTC](https://discuss.elastic.co/t/lab-2-1-elastic-agent-adding-nginx-integration-agent-fail/380490 "2025-07-28T09:49:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [July 28, 2025, 10:10am UTC](https://discuss.elastic.co/t/lab-2-1-elastic-agent-adding-nginx-integration-agent-fail/380490/2 "2025-07-28T10:10:13Z")

</div>

Hello @fabio.iovine

From the error "_{"file.name":"cmd/enroll\_cmd.go","file.line":806},"message":"Fleet Server - Error - listen tcp 0.0.0.0:8220: bind: address already in use","ecs.version":"1.6.0"}_  
_Error: fleet-server failed: context canceled_" it seems the port is in use, could you please check what is the process which is using the port :

`sudo lsof -i :8220`

If it is related to elastic-agent process of older installation maybe as you have already uninstalled the older agent, you can kill the process :

`sudo kill -9 <PID>`

Now try to install the agent again & see if you still receive the error.

Thanks!!

---

_[View the full topic](https://discuss.elastic.co/t/lab-2-1-elastic-agent-adding-nginx-integration-agent-fail/380490)._
