Skip to content

Elasticsearch Logstash Kibana (ELK) với Docker Compose

Compose sample application

Elasticsearch, Logstash, and Kibana (ELK) in single-node

Project structure:

└── docker-compose.yml


    image: elasticsearch:7.8.0
    image: logstash:7.8.0
    image: kibana:7.8.0

Deploy with docker-compose

$ docker-compose up -d
Creating network "elasticsearch-logstash-kibana_elastic" with driver "bridge"
Creating es ... done
Creating log ... done
Creating kib ... done

Expected result

Listing containers must show three containers running and the port mapping as below:

$ docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                    PORTS                                                                                            NAMES
173f0634ed33        logstash:7.8.0        "/usr/local/bin/dock…"   43 seconds ago      Up 41 seconds   >5000/tcp,>5044/tcp,>9600/tcp,>5000/udp   log
b448fd3e9b30        kibana:7.8.0          "/usr/local/bin/dumb…"   43 seconds ago      Up 42 seconds   >5601/tcp                                                                           kib
366d358fb03d        elasticsearch:7.8.0   "/tini -- /usr/local…"   43 seconds ago      Up 42 seconds (healthy)>9200/tcp,>9300/tcp                                                   es

After the application starts, navigate to below links in your web browser:

Stop and remove the containers

$ docker-compose down


The example Nginx logs are copied from here.