How to Install Elasticsearch on Ubuntu 18.04 Bionic Beaver

Install Elasticsearch on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Elasticsearch on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Elasticsearch is a flexible and powerful open source, distributed real-time search and analytics engine. With Elasticsearch, you can store, search, and analyze big volumes of data faster and in near real time. Elasticsearch is generally used as the underlying engine/technology that powers applications that have complex search features and requirements.

Install Elasticsearch on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

Step 2. Install Java.

Java is the primary requirement for running Elasticsearch on any system. Make sure your system has Java installed by running following command:

You can verify that we have Java 8 installed by running this command:

Step 3. Install Elasticsearch on Ubuntu 18.04.

Use Elasticsearch official apt repository to install Elasticsearch on Ubuntu Linux system:

Once the repository is enabled, update the apt package list and install the Elasticsearch engine by typing:

Elasticsearch service will not start automatically after the installation process is complete. To start the service and enable the service run:

Step 4. Configure Elasticsearch.

You can customize this by editing the Elasticsearch configuration file. Edit configuration file in your favorite text editor and update the following values:

Change the following values:

Restart the Elasticsearch service for the changes to take effect:

Step 5. Test Elasticsearch Setup.

You can verify that Elasticsearch is running by sending an HTTP request to port 9200 on localhost with the following curl command:

You should see something similar to this:

That’s all you need to do to install Elasticsearch on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.