How to Install Elasticsearch in Docker
To Install Elasticsearch with Docker, first, you need to install docker on your server with command
wget -qO- https://get.docker.com/ | sh
Docker images for Elasticsearch are available from
https://hub.docker.com/_/elasticsearch
You can see all available versions at
https://hub.docker.com/_/elasticsearch?tab=tags&page=1&ordering=last_updated
To create an elasticsearch container, run
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.5.2
To run it in the background
docker run --name sok-elasticsearch --restart=unless-stopped \ -d -p 9200:9200 -p 9300:9300 \ -e "xpack.security.enabled=false" \ -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.5.2
To verify if ElasticSearch works, run
boby@sok-01:~$ curl localhost:9200 { "name" : "730d385743b3", "cluster_name" : "docker-cluster", "cluster_uuid" : "V9XDIPXZQt-Tfgcy8hoIDg", "version" : { "number" : "7.5.2", "build_flavor" : "default", "build_type" : "docker", "build_hash" : "8bec50e1e0ad29dad5653712cf3bb580cd1afcdf", "build_date" : "2020-01-15T12:11:52.313576Z", "build_snapshot" : false, "lucene_version" : "8.3.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" } boby@sok-01:~$
Back to Elasticsearch