Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Deploy Elastic Search With Docker

Steps

Run the following command to deploy a basic elastic search server.

docker run \
  -p 9200:9200 \
  -p 9300:9300 \
  -e "discovery.type=single-node" \
  docker.elastic.co/elasticsearch/elasticsearch:7.8.1

Then to test that your elastic search server is up, send a curl request to its hostname or IP

curl $HOSTNAME_OR_IP:9200

You should get a message similar to:

{
  "name" : "5ff0fbc01709",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "T3ojXOZLSFuG15Y_QDQuGw",
  "version" : {
    "number" : "7.8.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "b5ca9c58fb664ca8bf9e4057fc229b3396bf3a89",
    "build_date" : "2020-07-21T16:40:44.668009Z",
    "build_snapshot" : false,
    "lucene_version" : "8.5.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

References

Last updated: 8th August 2020
First published: 31st July 2020