Install Elasticsearch, Kibana & Enterprise via Docker Compose

The tool  Docker Compose makes the creation of a local dev cluster consisting of Elasticsearch, Kibana & Enterprise even easier with our docker-compose.yml file and the following instructions.

The instructions work on any macOS or Linux computer and this 3-container setup is created:

  1. Elasticsearch running on localhost:9200 with Basic Auth credentials elastic and secret
  2. Kibana running on localhost:5601 which is connected to Elasticsearch
  3. SwiftyBeaver Enterprise running on localhost:8080 with the app credentials app1 and secret1 and encryption key NdpZuVMN6cVC3e7MGaVxRKzCJttoY3tL

The setup is not meant for production! Please consult the official Elasticsearch documentation for how to run Elasticsearch and Kibana on production.

1. Download Dockerfile & docker-compose.yml

# check if docker-compose is installed, it should be a recent version
docker-compose version

# download the two required files
curl -L -o Dockerfile 
curl -L -o docker-compose.yml

2. Start Cluster

The following call creates 3 containers. After starting the cluster please wait until you see the line "sbenterprise_1 ... INFO The server is running on port 8080" before you proceed:

docker-compose up

Kibana is now running on  http://localhost:5601/ and you can log in with user "elastic" and password "secret".

3. Test Connection

Open a new Terminal window and try to connect to the running containers to see if they work:

# check connection to Elasticsearch (JSON is returned)
curl "http://localhost:9200/_count" -u 'elastic:secret'

# check connection to Kibana (HTML is returned)
curl http://localhost:5601 --location

# Unprotected ping connection to see if SwiftyBeaver Enterprise is running 
curl "http://localhost:8080/ping"

# Basic Auth protected call to SwiftyBeaver Enterprise using app credentials 
curl "http://localhost:8080/api/status" -u 'app1:secret1'

4. Stop Cluster

To stop and / or delete the containers you can use:

# just stop the containers
docker-compose down

# stop and delete the containers
docker-compose kill

# delete the images
docker-compose rm

Still need help? Contact Us Contact Us