A Simple Guide to Installing Elasticsearch and Kibana with Docker Compose
If you’re looking to get started with Elasticsearch and Kibana, this guide will walk you through the setup using Docker Compose. Elasticsearch is a powerful search engine, and Kibana is its data visualization partner. Together, they make exploring and analyzing large datasets easier.
What Are Elasticsearch and Kibana?
- Elasticsearch: A search and analytics engine built on Lucene, designed for handling large datasets. It indexes, stores, and queries JSON documents quickly and scales well by distributing data across nodes.
- Kibana: A visualization tool for interacting with Elasticsearch data, allowing you to create dashboards, charts, and reports to understand your data better.
Why Use Docker Compose for Elasticsearch and Kibana?
Using Docker Compose, you can easily set up both Elasticsearch and Kibana with a single configuration file. This method is fast, scalable, and suitable for both development and production environments.
Step-by-Step: Setting Up Elasticsearch and Kibana
- Create a Project Folder
- Open a terminal and create a directory for your Docker setup:
mkdir elasticsearch_kibana && cd elasticsearch_kibana
Create a docker-compose.yml
File
In this directory, create a new file named docker-compose.yml
and add the following configuration:
version: '3.7'
services:
elasticsearch:
image: elasticsearch:7.9.2
container_name: elasticsearch
environment:
- discovery.type=single-node
ports:
- "9200:9200"
networks:
- elk-network
kibana:
image: kibana:7.9.2
container_name: kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
- elasticsearch
networks:
- elk-network
networks:
elk-network:
driver: bridge
Run Elasticsearch and Kibana
In your terminal, navigate to the directory where you saved docker-compose.yml
and start the containers:
docker-compose up -d
- Elasticsearch will be available at
http://localhost:9200
- Kibana can be accessed at
http://localhost:5601
Stopping the Containers
To stop Elasticsearch and Kibana, run:
docker-compose down
Summary
With this setup, you can start exploring Elasticsearch and creating visualizations in Kibana within minutes. This guide uses Docker Compose to simplify your development environment setup. To customize, adjust versions or add configuration options in docker-compose.yml
as needed.
Why Elasticsearch and Kibana?
Together, they provide a scalable solution for log management, performance monitoring, and big data analysis. Install them using Docker Compose and start making sense of your data today!