Run Elasticsearch and Kibana on Docker

Ahmad Al-Sajid
1 min readDec 22, 2020

As an Elastic newbie, it is very much confusing to find where to practice them. We can find many alternate ways, but, they are always not free, i.e. you can use AWS, GCP, or Elastic cloud to get a free trial for a certain period of time. That is not enough, right? Another way is to set things locally and start practicing. In that case, you are on your own. You have to manage everything to keep things up and running. If you have to spend time on setting and keeping things up, when are you going to practice Elastic itself?

Docker can be a perfect solution to it. It’s free, and you can set things in a minute on your PC. Elastic provides docker images here. As we are talking about Elasticsearch and Kibana only, we will not focus on other things provided by Elastic.

Download the script and make it executable, i.e.

$ sudo chmod +x setup_docker_es_kibana.sh

Now, execute the script, i.e.

$ ./setup_docker_es_kibana.sh

This will install docker on your Ubuntu machine first, then, pull images of Elasticsearch and Kibana version 7.10.1. Finally, it will create containers for Elasticsearch and Kibana named local_es and local_kibana respectively and start them for you. You can find Elasticsearch at http://localhost:9200/ and Kibana at http://localhost:5601/.

To stop the containers, put the command,

$ sudo docker stop local_es local_kibana

To start the containers again,

$ sudo docker start local_es local_kibana

--

--