Elastic Search and Kibana Setup Using Docker

If you are doing the setup of Elastic Search and Kibana without Docker then its is very tedious task . Steps are as follows

  1. Firstly, You have to download the package of Elastic Seach and then Install it. reference : https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html
  2. Then you have install this package.
  3. Now as the elastic is running we have to download the kibana.

reference : https://www.elastic.co/guide/en/kibana/current/install.html

4. Now comes the tedious task which is configuring the elastic search and kibana because the elastic search is running on the default port 9200 and when you start kibana then it will give you error that elastic server is not found so you have to configure elastic with kibana as given in the article

https://www.elastic.co/guide/en/kibana/current/settings.html

and it is really a very difficult task specially if you are beginner with ELK stack.

Docker Setup of Elastic and Kibana

https://docs.docker.com/engine/install/ubuntu/

Once the docker is installed create a file name docker-compose.yml in your system at any location and paste the below configuration. Here, the version of elastic search and kibana i am using is 7.5.2, you can use any compatible version as per you needs.

version: ‘2’
services:
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
container_name: elastic
environment:
— node.name=elastic
— cluster.name=docker-cluster
— cluster.initial_master_nodes=elastic
— bootstrap.memory_lock=true
— “ES_JAVA_OPTS=-Xms512m -Xmx512m”
ulimits:
memlock:
soft: -1
hard: -1
volumes:
— data01:/usr/share/elasticsearch/data
ports:
— 9200:9200
networks:
— elastic

kibana:
image: docker.elastic.co/kibana/kibana:7.5.2
container_name: kibana1
ports:
— 5601:5601
environment:
ELASTICSEARCH_URL: http://elastic:9200
ELASTICSEARCH_HOSTS: http://elastic:9200
networks:
— elastic

volumes:
data01:
driver: local
data02:
driver: local
data03:
driver: local

networks:
elastic:
driver: bridge

and just executer the file using : docker-compose up

once both kiban and elastic search is up, you will see message : “Server running at http://0:5601

open the url : http://localhost:5601/ and you kibana and elastic is running fine.

Senior Software Engineer