Starting the Elasticsearch Docker container with default configurations

Learn how to start the Elasticsearch Docker containers.

To start the Elasticsearch container with default configurations, run the following command.
docker run -it -e LICENSE=accept elasticsearch

Default host name

When you start the  Elasticsearch Docker container  using the default configurations, the container host name is  elasticsearch.

Mandatory parameters for Elasticsearch

Parameter name Description
cluster.name Sample value is "docker-cluster"
network.host Sample value is 0.0.0.0
discovery.type Sample value is single-node
xpack.monitoring.collection.enabled Sample value is 'true'
indices.query.bool.max_clause_count Sample value is 100000
ES_JAVA_OPTS Sample value is "-Xmx4096m -Xms1024m"

Code example

docker run -it -e LICENSE=accept  \ 
    -e cluster.name =<cluster name for Elasticsearch> \ 
    -e network.host =<network host for Elasticsearch> 
    -e discovery.type =<discovery type> \ 
    -e xpack.monitoring.collection.enabled =<enable xpack monitoring collection> \ 
    -e indices.query.bool.max_clause_count =<max clause count> \ 
    -e ES_JAVA_OPTS =<java options>  
    <Elasticsearch Docker image>