Skip to main content
Categories

How to Install ElasticSearch 7 on cPanel

You are here:

ElasticSearch is one of the most useful tools for getting fast search working on your site. It is essential on E-commerce platforms like Magento and fortunately it only takes a few minutes to get installed.

This guide is written for AlmaLinux 8 so other distros may need a couple of tweaks

Installing Java and ElasticSearch

The first step to installing ElasticSearch will be to get Java running on your server. 

This will get you the latest version of OpenJDK from the default repositories, and will work fine with ElasticSearch 7. 

Next we will need to setup the repository for ElasticSearch. 

Download the public signing key:

Then create /etc/yum.repos.d/elasticsearch.repo and add the following:

This will then allow you to install and update ElasticSearch using yum

Before you start...

There are a couple of settings that will need to be changed in order to get Elasticsearch working properly on a cPanel install. 

The first is to configure your Java temp directory. This can be done by editing the file /etc/elasticsearch/jvm.options

It is also highly recommended to reduce swap usage to encourage Elasticsearch to use RAM rather than excessively using swap space.

That should be it! You are now ready to begin using Elasticsearch, simply enable the service so it begins on reboots and start it.

Verify it is working

You can check your Elasticsearch install has started correctly by viewing the logs at /var/log/elasticsearch/elasticsearch.log or by querying it

This should give the following output

Table of Contents