title: Elastic APM Stack on Docker
body: <p>im trying to install the Elastic APM with Elasticsearch, Kibana and the APM server as 3 services with docker-compose. Now im getting confused on how to set the IPs in the app-server.yml file with the documentation <a href="https://www.elastic.co/guide/en/apm/server/current/apm-server-configuration.html" rel="nofollow noreferrer">APM Server Configuration</a>. The file should look like this:</p>
  <pre><code>apm-server:
    host: localhost:8200
  
  output:
    elasticsearch:
      hosts: ElasticsearchAddress:9200
  </code></pre>
  <p>I tried to set ElasticsearchAddress to localhost or 127.0.0.1 but I always get errors like
  <code>Failed to connect: Get http://127.0.0.1:9200: dial tcp 127.0.0.1:9200: getsockopt: connection refused</code> or <code>Failed to connect: Get http://localhost:9200: dial tcp [::1]:9200: connect: cannot assign requested address</code>. I also tried it with several other ips.</p>
  <p>Does anyone know how to configure the app server correctly or are there any docker-compose files to do the installation correctly?</p>
  <p>Thanks for ur help</p>