Skip to content

Enable and configure ELK Stack

Enable and configure ELK Stack

The ELK Stack adds Elasticsearch, Logstash, and Kibana for local log ingestion, search, and dashboards. Use it when you need compatibility with the maintained classic Devilbox ELK snippet.

How it works

Devilbox keeps optional integrations as override snippets in the compose/ directory. To enable ELK Stack, copy its snippet into the project root as docker-compose.override.yml, then start the stack.

Enable

Terminal window
cp compose/docker-compose.override.yml-elk docker-compose.override.yml
./dvl.sh up

Configuration

The snippet currently uses Elastic OSS images with ${ELK_SERVER:-6.6.1}:

ServiceImageHost portContainer portVolume
elasticdocker.elastic.co/elasticsearch/elasticsearch-oss:${ELK_SERVER:-6.6.1}${HOST_PORT_ELK_ELASTIC:-9200}9200devilbox-elastic
logstashdocker.elastic.co/logstash/logstash-oss:${ELK_SERVER:-6.6.1}${HOST_PORT_ELK_LOGSTASH:-9600}9600devilbox-logstash
kibanadocker.elastic.co/kibana/kibana-oss:${ELK_SERVER:-6.6.1}${HOST_PORT_ELK_KIBANA:-5601}5601none

Environment variables from the snippet:

VariableDefaultPurpose
ELK_SERVER6.6.1Shared Elasticsearch, Logstash, and Kibana image tag.
HOST_PORT_ELK_ELASTIC9200Host port for Elasticsearch.
HOST_PORT_ELK_LOGSTASH9600Host port for Logstash monitoring API.
HOST_PORT_ELK_KIBANA5601Host port for Kibana.
TIMEZONEUTCContainer timezone.

The compose snippet intentionally reflects the classic ELK integration. For a lighter modern search service, consider the agentic opensearch optional container via CONTAINERS_CONFIG_OPTIONAL instead.

Usage

Check Elasticsearch health:

Terminal window
curl http://localhost:9200/_cluster/health?pretty

Open Kibana:

Terminal window
open http://localhost:5601

Tail Logstash logs while testing an ingestion pipeline:

Terminal window
docker compose logs -f logstash

Disable

Terminal window
./dvl.sh down
rm docker-compose.override.yml
./dvl.sh up

Remove the Docker volumes if you also want to delete indexed data:

Terminal window
docker volume rm devilbox-elastic devilbox-logstash

Troubleshooting

  • If Elasticsearch is slow to become healthy, increase Docker memory and wait for the single-node bootstrap to finish.
  • If Kibana cannot connect, verify elastic is healthy and both services use the same ELK_SERVER tag.
  • If ports are already in use, set the HOST_PORT_ELK_* variables in .env.

See also