Elasticsearch is a product by Elasticsearch BV. It is available on Github and the company also hosts Elasticsearch's apt repository for Ubuntu.
It is developed using Java thus you'll also need to install Java Runtime Environment alongside the Elasticsearch binary.
$ wget --quiet --output-document=- https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - [sudo] password for user: OK
$ echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list deb https://artifacts.elastic.co/packages/6.x/apt stable main
$ sudo apt update
$ sudo apt install --assume-yes default-jre
$ sudo apt install --assume-yes elasticsearch
$ sudo ufw allow 9200 Rules updated Rules updated (v6) $ sudo ufw allow 9300 Rules updated Rules updated (v6)
network.host: 0.0.0.0
$ sudo systemctl enable elasticsearch Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable elasticsearch Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /usr/lib/systemd/system/elasticsearch.service.
$ sudo systemctl start elasticsearch
$ curl 127.0.0.1:9200 { "name" : "90mQ0vJ", "cluster_name" : "elasticsearch", "cluster_uuid" : "4oFjuDQLRtiCrkjrIKyZuQ", "version" : { "number" : "6.4.0", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "595516e", "build_date" : "2018-08-17T23:18:47.308994Z", "build_snapshot" : false, "lucene_version" : "7.4.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" }
You will get the following error if you immediately test the service after starting it up because Elasticsearch takes a while to start.
curl 127.0.0.1:9200 curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused
Comment anonymously. Login not required.