How to install Elasticsearch on Ubuntu
You will need:
- VPS running Ubuntu
Step 1 – Install OpenJDK
Elasticsearch is written in Java programming language so it’s needed to install. To install run this command:
sudo apt-get install openjdk-8-jre
Step 2 – Download Elasticsearch RPM
Now download the Elasticsearch GPG KEY file by running this command:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
After, download the Elasticsearch deb file:
add-apt-repository "deb https://artifacts.elastic.co/packages/6.x/apt stable main"
Step 3 – Install Elasticsearch
Now its time to install Elasticsearch. Install it by running rpm file:
sudo apt-get install elasticsearch
After you need to add your server IP to elasticsearch.yml :
Change this line :
# network.host: 192.168.0.1
Note: Change 192.168.100.100 with your server IP address.
Now you need to enable Elasticsearch:
systemctl enable elasticsearch.service
And to start it:
systemctl start elasticsearch.service
Step 4 – Test Elasticsearch
Now you can test Elasticsearch by running this command:
curl -X GET 'http://localhost:9200">http://youripaddress:9200'
You have successfully installed Elasticsearch on Ubuntu.