Analytics Vidhya
Published in

Analytics Vidhya

Install Elasticsearch and Kibana using Docker

First things first, you must have Docker and Docker compose setup and installed on your machine. If you don’t have it installed already, follow this link to set it up on your machine.

For this tutorial, we will be making use of the docker-compose command to spin up our own containers running Elasticsearch and Kibana.

Go ahead and create a docker-compose.yml file and paste the code below,

This Docker compose recipe spins up 2 Docker containers on your machine. One container running Elasticsearch 7.8.1 and the other running Kibana 7.8.1. It maps Elasticsearch API to port 9200 and Kibana to port 5601 on your machine. You can check the official Docker images for all available configuration options for Elasticsearch and Kibana. For this tutorial, we will be enabling security on Elasticsearch (duh!) and configuring a password (default username is “elastic”).

The recipe also mounts the kibana.yml to the Kibana config directory, you will need to make a few changes to the file to make sure Kibana connects correctly to your container running Elasticsearch.

UPDATE 19/3/22: As of version 8.1, using ‘elastic’ username to connect Kibana to ElasticSearch does not work. Use auth tokens instead or an older version.

After both yml files are ready, open up a terminal and navigate to your directory and execute the below command,

Docker will download the images for Elasticsearch and Kibana and setup your containers. After successful completion you will be able to see your containers running,

Head on over to http://localhost:9200/ to verify that Elasticsearch is now running (key in your username and password, default username is “elastic”), you should see a response like below,

Follow this link to check out the documentation for the Elasticsearch Search API.

To verify that Kibana is successfully up and running on your machine, head on over to http://localhost:5601/ and key in your username and password,

After logging in you can use the full potential of Kibana,

Thanks for reading, that’s all folks!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store