# Elasticsearch, Kibana, Metricbeat based on docker compose

**URL:** <https://discuss.elastic.co/t/elasticsearch-kibana-metricbeat-based-on-docker-compose/378898>\
**Category:** Metrics\
**Tags:** elastic-stack-monitoring\
**Created:** [June 5, 2025, 8:44am UTC](https://discuss.elastic.co/t/elasticsearch-kibana-metricbeat-based-on-docker-compose/378898 "2025-06-05T08:44:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jinhee\_Jeong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinhee_jeong/32/141986_2.png) [@Jinhee\_Jeong](https://discuss.elastic.co/u/Jinhee_Jeong)\
**Post date:** [June 5, 2025, 8:44am UTC](https://discuss.elastic.co/t/elasticsearch-kibana-metricbeat-based-on-docker-compose/378898/1 "2025-06-05T08:44:41Z")

</div>

Hello,

I deployed Elasticsearch, Kibana, and Metricbeat containers one by one on AWS EC2.  
I deployed it by referring to this guide.

> **[Elastic Stack 및 Docker-Compose 시작하기](https://www.elastic.co/kr/blog/getting-started-with-the-elastic-stack-and-docker-compose)**
>
> 2부로 구성된 이 시리즈 중 1부에서는 즉시 개발을 시작할 수 있는 Elasticsearch, Logstash, Kibana 및 Beats(ELK-B)로 구성된 표준 Elastic Stack의 구성 요소를 구성하는 방법을 살펴보겠습니다....

It is not exactly the same, but it is mostly similar.

 ![metricbeat.PNG](https://us1.discourse-cdn.com/elastic/original/3X/8/4/849f0711e7d590c1066d14f5e434b69c92787a31.jpeg)

When you go into Kibana, this is what you see.  
It recognizes the Metircbeat container as a host.

I'm curious, is it true that Elasticsearch and Kibana containers are not recognized as Hosts?  
I'm new to Metricbeat, so I'm not sure if this is true.  
I thought it would recognize Elasticsearch and Kibana containers as Hosts, but it wasn't.

I'm sharing the docker compose yml and metricbeat.yml that deployed Metricbeat.

Docker Compose

```auto
services:
  metricbeat01:
    image: ${METRICBEAT_IMAGE}
    user: root
    volumes:
      - /data001/metricbeat/config/certs:/usr/share/metricbeat/certs
      - /data001/metricbeat/data:/usr/share/metricbeat/data
      - "/data001/metricbeat/config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro"
      - "/proc:/hostfs/proc:ro"
      - "/:/hostfs:ro"
    environment:
      - ELASTIC_USER=elastic
      - ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
      - ELASTIC_HOSTS=https://${ES01_HOSTNAME}:9200
      - KIBANA_HOSTS=http://${ES01_HOSTNAME}:5601
    extra_hosts:
      - "${ES01_HOSTNAME}=${ES01_IP}"

```

metircbeat.yml

```auto
metricbeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false

metricbeat.modules:
- module: elasticsearch
  xpack.enabled: true
  period: 10s
  hosts: ${ELASTIC_HOSTS}
  ssl.certificate_authorities: "certs/ca/ca.crt"
  ssl.certificate: "certs/es01/es01.crt"
  ssl.key: "certs/es01/es01.key"
  username: ${ELASTIC_USER}
  password: ${ELASTIC_PASSWORD}
  ssl.enabled: true

- module: kibana
  metricsets:
    - stats
  period: 10s
  hosts: ${KIBANA_HOSTS}
  username: ${ELASTIC_USER}
  password: ${ELASTIC_PASSWORD}
  xpack.enabled: true

- module: docker
  metricsets:
    - "container"
    - "cpu"
    - "diskio"
    - "healthcheck"
    - "info"
    #- "image"
    - "memory"
    - "network"
  hosts: ["unix:///var/run/docker.sock"]
  period: 10s
  enabled: true

processors:
  - add_host_metadata: ~
  - add_docker_metadata: ~

output.elasticsearch:
  hosts: ${ELASTIC_HOSTS}
  username: ${ELASTIC_USER}
  password: ${ELASTIC_PASSWORD}
  ssl:
    certificate: "certs/es01/es01.crt"
    certificate_authorities: "certs/ca/ca.crt"
    key: "certs/es01/es01.key"

```

Thank you.
