# Docker-compose issue with elasticsearch and kibana docker image

**URL:** <https://discuss.elastic.co/t/docker-compose-issue-with-elasticsearch-and-kibana-docker-image/330067>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [April 15, 2023, 1:11pm UTC](https://discuss.elastic.co/t/docker-compose-issue-with-elasticsearch-and-kibana-docker-image/330067 "2023-04-15T13:11:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![toki0709](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toki0709/32/119862_2.png) [@toki0709](https://discuss.elastic.co/u/toki0709)\
**Post date:** [April 15, 2023, 1:11pm UTC](https://discuss.elastic.co/t/docker-compose-issue-with-elasticsearch-and-kibana-docker-image/330067/1 "2023-04-15T13:11:06Z")

</div>

I am trying to create a docker-compose file with the latest image version of Elasticsearch and Kibana. Even after mentioning the version name in docker-compose.yml, I am noticing that the image version is 7.11.1 for both Kibana and Elasticsearch.

Any idea why?

Thanks in advance 🙂

```auto
{
  "name" : "es01",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "1sG7KH5KSyy5WM3qGw7F0g",
  "version" : {
    "number" : "7.11.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "ff17057114c2199c9c1bbecc727003a907c0db7a",
    "build_date" : "2021-02-15T13:44:09.394032Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 15, 2023, 10:55pm UTC](https://discuss.elastic.co/t/docker-compose-issue-with-elasticsearch-and-kibana-docker-image/330067/2 "2023-04-15T22:55:56Z")

</div>

Hi @toki0709 Welcome to the community!

You're going to need to show us your actual compose file or we're not going to be able to help. 🙂

Also, please show the exact command you're running.

Also, are you sure that there isn't another elasticsearch already running? And your compose is never actually coming up?

---

<div class="post-metadata">

**Author:** ![toki0709](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toki0709/32/119862_2.png) [@toki0709](https://discuss.elastic.co/u/toki0709)\
**Post date:** [April 16, 2023, 9:45am UTC](https://discuss.elastic.co/t/docker-compose-issue-with-elasticsearch-and-kibana-docker-image/330067/3 "2023-04-16T09:45:24Z")

</div>

Hi @stephenb, thanks for your comment. Here is my docker-compose file

```auto
version: '3.9'

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
    container_name: elasticsearch
    ports:
      - '9200:9200'
    environment:
      discovery.type: single-node
      ES_JAVA_OPTS: -Xmx512m -Xms512m
      node.name: es01
      cluster.name: elasticsearch
    volumes:
      - ./elastic/data:/usr/share/elasticsearch/data
    networks:
      - elasticnet

  kibana:
    image: docker.elastic.co/kibana/kibana:8.7.0
    container_name: kibana
    ports:
      - '5601:5601'
    environment:
      SERVERNAME: kibana
      ELASTICSEARCH_HOSTS: http://elasticsearch:9200
      ES_JAVA_OPTS: -Xmx512m -Xms512m
    networks:
      - elasticnet
    depends_on:
      - elasticsearch
volumes:
  logvolume01: {}

networks:
  elasticnet: {}

```

I am using docker-compose up -d command. And there are no elasticsearch instance running.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 16, 2023, 3:49pm UTC](https://discuss.elastic.co/t/docker-compose-issue-with-elasticsearch-and-kibana-docker-image/330067/4 "2023-04-16T15:49:51Z")

</div>

Hi @toki0709

First that compose will not work for 8.X because of the auto security setup you will either need to following the example [here](https://elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-compose-file) or use the docker-compose file I shared at the bottom of this post.

You can use the sample and pare it down to a single node if you like.

Why yours is starting with the wrong version is often because the wrong compose file is being used.

SO typically you can use these types of commands to figure out what is going on.

What is the exact name of your compose file?

What's is the output of  
`docker images`  
`docker ps`

You can also be very explicit and name the compose file with

`docker-compose -f ./compose.yml up`

Here is an example of a docker compose without security enabled.  
**Warning this will have no security enabled do not put any sensitive data in it or make it available on the network.**

There are some extra stuff in where resource limits etc which you can take out.

`compose-8-x-no-security.yml`

You can start it with  
`docker-compose -f compose-8-x-no-security.yml up`

```auto
---
version: '3'
services:
  elasticsearch:
    container_name: es01
    image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
    # 8.x
    environment: ['CLI_JAVA_OPTS=-Xms2g -Xmx2g','bootstrap.memory_lock=true','discovery.type=single-node','xpack.security.enabled=false', 'xpack.security.enrollment.enabled=false']
    ports:
      - 9200:9200
    networks:
      - elastic
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    deploy:    
      resources:
          limits:
            cpus: '2.0'
          reservations:
            cpus: '1.0'
            
  kibana:
    image: docker.elastic.co/kibana/kibana:8.7.0
    container_name: kib01
    environment:
      XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: d1a66dfd-c4d3-4a0a-8290-2abcb83ab3aa
    ports:
      - 5601:5601
    networks:
      - elastic
    deploy:    
      resources:
          limits:
            cpus: '2.0'
          reservations:
            cpus: '1.0'

networks:
  elastic:

```

---

<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:** [May 14, 2023, 3:50pm UTC](https://discuss.elastic.co/t/docker-compose-issue-with-elasticsearch-and-kibana-docker-image/330067/5 "2023-05-14T15:50:13Z")

</div>

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