# How to configure Elastic stack with Fleet server and APM integration using docker compose?

**URL:** <https://discuss.elastic.co/t/how-to-configure-elastic-stack-with-fleet-server-and-apm-integration-using-docker-compose/326974>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [March 4, 2023, 1:51am UTC](https://discuss.elastic.co/t/how-to-configure-elastic-stack-with-fleet-server-and-apm-integration-using-docker-compose/326974 "2023-03-04T01:51:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hexsorcerer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hexsorcerer/32/118026_2.png) [@hexsorcerer](https://discuss.elastic.co/u/hexsorcerer)\
**Post date:** [March 4, 2023, 1:51am UTC](https://discuss.elastic.co/t/how-to-configure-elastic-stack-with-fleet-server-and-apm-integration-using-docker-compose/326974/1 "2023-03-04T01:51:56Z")

</div>

I'm trying to setup an example project with the following functionality:

- Elasticsearch
- Logstash
- Kibana
- Fleet Server
- Elastic Agent with APM Integration
- OpenTelemetry from a .NET Application

Getting the basic ELK setup wasn't too bad, but going beyond that has been really tough. I've managed to figure out how to get Kibana to auto-enroll itself, and I now have a Fleet server running. I'm now stuck with the following problems:

- I tried getting the elastic-agent running, but it requires an enrollment token and I can't find any way to obtain one outside of manually through the Kibana UI.

- The fleet server creates a new policy on every rebuild/restart, which seems unnecessary.

- The fleet server console shows errors about trying to connect to localhost:9200, even though I've set the FLEET\_SERVER\_ELASTICSEARCH\_HOST variables to [https://elasticstack:9200](https://elasticstack:9200)

The Elastic documentation has bits and pieces of this process, but there's a lot of details missing along the way. I've managed to find a few github repos to fill in the gaps, but I've been hacking away at this for several weeks now and it's still not working.

My current docker-compose configuration:  
[docker-compose.override.yml](https://github.com/hexsorcerer/example-elastic-stack-aspnetcore/blob/main/src/docker-compose.override.yml)

Any help would be much appreciated.

---

<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:** [April 1, 2023, 1:52am UTC](https://discuss.elastic.co/t/how-to-configure-elastic-stack-with-fleet-server-and-apm-integration-using-docker-compose/326974/2 "2023-04-01T01:52:18Z")

</div>

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