Configuring Kibana on Docker

edit

The Docker image provides several methods for configuring Kibana. The conventional approach is to provide a kibana.yml file as described in Configuring Kibana, but it’s also possible to use environment variables to define settings.

Bind-mounted configuration

edit

One way to configure Kibana on Docker is to provide kibana.yml via bind-mounting. With docker-compose, the bind-mount can be specified like this:

services:
  kibana:
    image: docker.elastic.co/kibana/kibana:5.6.16
    volumes:
      - ./kibana.yml:/usr/share/kibana/config/kibana.yml

Environment variable configuration

edit

Under Docker, Kibana can be configured via environment variables. When the container starts, a helper process checks the environment for variables that can be mapped to Kibana command-line arguments.

For compatibility with container orchestration systems, these environment variables are written in all capitals, with underscores as word separators. The helper translates these names to valid Kibana setting names.

Some example translations are shown here:

Table 1. Example Docker Environment Variables

Environment Variable

Kibana Setting

SERVER_NAME

server.name

KIBANA_DEFAULTAPPID

kibana.defaultAppId

XPACK_MONITORING_ENABLED

xpack.monitoring.enabled

In general, any setting listed in Configuring Kibana or X-Pack Settings can be configured with this technique.

These variables can be set with docker-compose like this:

services:
  kibana:
    image: docker.elastic.co/kibana/kibana:5.6.16
    environment:
      SERVER_NAME: kibana.example.org
      ELASTICSEARCH_URL: http://elasticsearch.example.org

Since environment variables are translated to CLI arguments, they take precedence over settings configured in kibana.yml.

Docker defaults

edit

The following settings have different default values when using the Docker image:

server.host

"0"

elasticsearch.url

http://elasticsearch:9200

elasticsearch.username

elastic

elasticsearch.password

changeme

xpack.monitoring.ui.container.elasticsearch.enabled

true

These settings are defined in the default kibana.yml. They can be overridden with a custom kibana.yml or via environment variables.