Would you like to learn how to do a ElasticSearch installation on Ubuntu Linux? In this tutorial, we are going to show you how to install ElasticSearch on a computer running Ubuntu Linux.

• Ubuntu version: 18
• Ubuntu version: 19
• ElasticSearch version: 7.4.0

Hardware List:

The following section presents the list of equipment used to create this ElasticSearch tutorial.

Every piece of hardware listed above can be found at Amazon website.

ElasticSearch Related Tutorial:

On this page, we offer quick access to a list of tutorials related to ElasticSearch installation.

Tutorial ElasticSearch – Installation on Ubuntu Linux

Use apt-get to install the required packages.

Copy to Clipboard

Set the correct timezone and enable the NTP service.

Copy to Clipboard

In our example, we configured the America/Sao_Paulo timezone.

Set a hostname with a domain name using the hostnamectl command.

Copy to Clipboard

Try to ping the hostname of your Elastic server.

This command must ping the IP addres of the server.

Copy to Clipboard

Download and install the ElasticSearch repository key.

Copy to Clipboard

Add the official ElasticSearch repository to your APT database

Copy to Clipboard

Update the APT-GET database and install the ElasticSearch package.

Copy to Clipboard

Edit the ElasticSearch configuration file named: elasticsearch.yml

Copy to Clipboard

Add the following lines at the end of the file.

Copy to Clipboard

In our example, we allow the ElasticSearch service only on the server IP address: 192.168.15.15

Start the ElasticSearch service.

Copy to Clipboard

Use the following command to look at the ElasticSearch log file.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Use the NETSTAT command to verify if the service is running on ports 9200 and 9300.

Copy to Clipboard

In our example, the ElasticSearch service is running on ports 9200 and 9300.

Copy to Clipboard

Verify the Elasticsearch server status.

Copy to Clipboard

Here is the expected command output.

Copy to Clipboard

Use the following comand to test your ElasticSearch installation.

Copy to Clipboard

The ElasticSearch service should reply your request.

Copy to Clipboard

Another way to test your Elasticsearch installation is to use your browser.

Open your browser and enter the IP address of your ElasticSearch server plus :9200.

In our example, the following URL was entered in the Browser:

• http://192.168.15.15:9200

The ElasticSearch rest interface should answer your request:

elasticsearch install ubuntu

Configure the ElasticSearch service to start during boot time.

Copy to Clipboard

Congratulations! You have finished the ElasticSearch installation on Ubuntu Linux.

Tutorial ElasticSearch – Add Information

Use the following command to add information to your ElasticSearch installation.

Copy to Clipboard

In our example, we created an index named tutorial and the type techarticle suing the identification number 1.

The ElasticSearch system should acknowledge your entry.

Copy to Clipboard

Use the following command to get your information from the ElasticSearch installation.

Copy to Clipboard

The ElasticSearch service should reply your request.

Copy to Clipboard

If you add ?pretty to the end of your request, the ElasticSearch sever will present the information like this:

Copy to Clipboard

Use the following command to modify information in the ElasticSearch server.

Copy to Clipboard

Test again your ElasticSearch communication.

Copy to Clipboard

Congratulations! You have tested your ElasticSearch communication.