https://www.gitauharrison.com/articles/elasticsearch/install-elasticsearch-in-your-localhost#memory-usage
Since Elasticsearch runs on top of Java, you need to install the Java Development Kit (JDK). You can check if Java is installed by running this command in your terminal:
java -version
If you do not have java, you can install the default JDK by:
sudo apt install openjdk-8-jre-headless
Run java -version
to check that Java
is installed.
The next step would be to allow access to our repositories via HTTPS. Therefore, let us install an APT transport package:
sudo apt install apt-transport-https
First, update the GPG Key for the Elasticsearch repository using the wget command to pull the public key:
wget -qO - <https://artifacts.elastic.co/GPG-KEY-elasticsearch> | sudo apt-key add -
Add the repository to your system:
echo "deb <https://artifacts.elastic.co/packages/7.x/apt> stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
Now, install elasticsearch
by first updating the package index then run the installation: