# Monitoring PHP app inside docker container

**URL:** <https://discuss.elastic.co/t/monitoring-php-app-inside-docker-container/319109>\
**Category:** APM\
**Tags:** docker, php\
**Created:** [November 16, 2022, 4:09pm UTC](https://discuss.elastic.co/t/monitoring-php-app-inside-docker-container/319109 "2022-11-16T16:09:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [November 16, 2022, 4:09pm UTC](https://discuss.elastic.co/t/monitoring-php-app-inside-docker-container/319109/1 "2022-11-16T16:09:48Z")

</div>

Hi, I have to monitor a PHP application that lives inside a docker container, and I have a couple of begginers doubts.

- Can I monitor the application with the agent installed outside the docker container?

- the host server of the application (where the PHP agent has to be installed) has the firewalld active, what port should I open for the agent can communicate with the APM server?

- this comunication, between the agent and APM server is bi-directional? or the agent just send data and doesn't receives data.

Thanks!

---

<div class="post-metadata">

**Author:** ![Peter\_Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_elastic/32/91235_2.png) [@Peter\_Elastic](https://discuss.elastic.co/u/Peter_Elastic)\
**Post date:** [December 4, 2022, 10:23am UTC](https://discuss.elastic.co/t/monitoring-php-app-inside-docker-container/319109/2 "2022-12-04T10:23:40Z")

</div>

Hi,

- The agent must run within the container. PHP will need to apply the C extention to be able to hook into functionalities/method being used.

- Do you block outgoing requests, or only incoming requests? If you are using Elastic Cloud you can click on the Copy Endpoint of the deployments page. The port is listed within the url. It is depending on the regio and provider. Most APM has leveraging port 443 the default SSL port.

- APM server has only incoming requests. Not Bi-directional.

Greetings,

---

<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:** [December 25, 2022, 6:23am UTC](https://discuss.elastic.co/t/monitoring-php-app-inside-docker-container/319109/3 "2022-12-25T06:23:46Z")

</div>

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