Installing ELK Stack in Docker
Having Troubling Implementing Docker? Here is the most straightforward guide!
Authors: Rishabh Gupta, Shelvi Garg
This is the most to-the-point tutorial on how to install the ELK — Elasticsearch stack through Docker. If you follow the step-by-step guide you will face no trouble in following the suit.
Before moving ahead, I assume you have downloaded the Docker Desktop. If you haven't here the link: https://www.docker.com/products/docker-desktop
Step 1: Create a Directory /Folder with the name of ELK.
Step 2: Open the ELK Directory in your IDE (VS Code in my case).
Step 3: Create a File named docker-compose.yml in this directory.
Step 4: Copy-Paste the following commands : (it mentions some stuff about the dependencies we want to install, including Elastic Search and Kibana)
Step 5: Save the File and run the following command under the same directory terminal.
docker-compose -f docker-compose.yml up -d
You will see the system downloading your ELK Stack.
Step 6: Once the download is completed, you can go either to the Docker Desktop and look up 2 new Docker containers created there(as seen in image) or you can type on your terminal :
docker container ls
Step 7: You can run both the Elasticseacrh and Kibana Container, if it's not already been running from the Docker Desktop, run the button provided in front of the containers’ name.
You can run and stop it for further use too
Step 8: Last step is to finally see the end results.
Go to http://localhost:5601/ (localhost server we provided for Kibana) and http://localhost:9200/( Elasticsearch host server) to check if its working fine.
You will get something like this on 9200:
And something like this with 5601:
If you are getting Both the screens, congratulations, you have successfully crossed your biggest hurdle in learning elk stack!
…. and if you like this blog, please feel free to leave a few hearty claps! :)