top of page

Step-by-Step Guide to Installing Elasticsearch on Linux

Updated: Dec 4, 2024


Introduction

Elasticsearch is a powerful search and analytics engine, but before you can leverage its full capabilities, it needs to be properly installed and configured. This blog provides a detailed, step-by-step guide to installing Elasticsearch on Linux-based systems, along with tips to verify and configure the setup. By following this guide, you’ll be able to deploy Elasticsearch and prepare it for real-time search and analytics workloads.


System Requirements for Elasticsearch Installation

Before starting the installation process, ensure your system meets the following requirements:


1. Supported Operating Systems

Elasticsearch works on most major Linux distributions, such as:

  • Ubuntu

  • CentOS

  • Debian

  • Red Hat Enterprise Linux (RHEL)


2. Java Requirement

Elasticsearch is built on Java and requires Java 11 or later. The installation package includes a bundled Java Development Kit (JDK), so you don't need to install Java separately unless a specific version is required.


3. Hardware Recommendations

  • RAM: A minimum of 4 GB is recommended for small-to-medium clusters.

  • Disk Space: At least 2 GB is required for installation. Additional storage is needed for data storage based on your application needs.


4. Ports

Elasticsearch uses the following ports:

  • 9200: For HTTP communication (querying and managing Elasticsearch).

  • 9300: For inter-node communication within a cluster.


Installing Elasticsearch on Linux

Follow these steps to install Elasticsearch on a Linux-based system:


Step 1: Add Elasticsearch GPG Key

The first step ensures that the downloaded Elasticsearch packages are trusted by adding the Elastic GPG key to your system. Run the following command:


wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg

Step 2: Install APT Transport HTTPS

Ensure that your system can fetch packages over HTTPS by installing the APT transport package:


sudo apt-get install apt-transport-https

Step 3: Add Elasticsearch Repository

To install Elasticsearch using the APT package manager, add its repository to your system:

echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list

Step 4: Install Elasticsearch

Update your system's package list and install Elasticsearch with the following commands:


sudo apt-get update && sudo apt-get install elasticsearch




Step 5: Enable and Start Elasticsearch Service

Elasticsearch uses systemd to manage its service. Enable Elasticsearch to start automatically at boot and start the service:


sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service


Optional Configuration: Disabling Security for Local Testing

By default, Elasticsearch has several security features enabled. For local testing, you may want to disable these features. Here’s how:


  1. Navigate to the Elasticsearch Configuration Directory:

cd /etc/elasticsearch
  1. Grant Write Permissions:

 sudo chmod 777 elasticsearch.yml
  1. Edit the elasticsearch.yml File:

Open the file using a text editor like nano:

sudo nano elasticsearch.yml
  1. Change the xpack.security.enabled setting to false:

xpack.security.enabled: false
xpack.security.enrollment.enabled: false

  1. Restart Elasticsearch:

sudo systemctl restart elasticsearch.service

Verify Installation

If the installation was successful, you’ll receive a JSON response similar to this:



Struggling with Data Searches? Let Elasticsearch Help!

At Codersarts, we specialize in Elasticsearch Development Services to help you harness the full potential of this powerful search and analytics engine. Whether you’re building scalable search solutions, optimizing query performance, or managing real-time data indexing, our expert developers are here to assist.


Contact us today to hire skilled Elasticsearch developers and transform how you search, analyze, and manage your data!

 

Keywords: Elasticsearch Development Services, Elasticsearch Development Services, Elasticsearch Workflow Automation, Elasticsearch Query Optimization Services, Elasticsearch Integration Services, Data Pipeline Development with Elasticsearch, Elasticsearch Index Customization, Building ETL Pipelines with Elasticsearch, Real-time Data Processing with Elasticsearch, Data Engineering with Elasticsearch, Hire Elasticsearch Developer, Elasticsearch Project Help, Elasticsearch Freelance Developer

 

Comments


bottom of page