How to Install OpenSearch on Ubuntu 24.04

Introduction

OpenSearch is a community-driven, open-source search and analytics suite. In this guide, you will learn how to install OpenSearch on Ubuntu 24.04.

Prerequisites

  • Ubuntu 24.04 installed
  • Access to a terminal/command line
  • sudo privileges

Step 1: Install Java Runtime

OpenSearch requires Java. You can install OpenJDK using the following command:

sudo apt update
sudo apt install openjdk-11-jdk

Verify Java Installation

To ensure Java is installed correctly, run:

java -version

Step 2: Add OpenSearch GPG Key

Next, you need to add the OpenSearch GPG Key to your system:

wget -qO - https://artifacts.opensearch.org/GPG-KEY | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/opensearch.gpg

Step 3: Add OpenSearch Repository

Add the OpenSearch repository to your sources list:

echo "deb https://artifacts.opensearch.org/packages/opensearch-2.x/apt/ stable main" | sudo tee /etc/apt/sources.list.d/opensearch.list

Step 4: Install OpenSearch

After adding the repository, update the package list and install OpenSearch:

sudo apt update
sudo apt install opensearch

Step 5: Configure OpenSearch

You can configure OpenSearch by editing the configuration file located at /etc/opensearch/opensearch.yml. Use your preferred text editor (e.g., nano or vim):

sudo nano /etc/opensearch/opensearch.yml

Step 6: Start OpenSearch

Start the OpenSearch service with the following command:

sudo systemctl start opensearch

Enable OpenSearch on Boot

To ensure OpenSearch starts automatically on boot, run:

sudo systemctl enable opensearch

Step 7: Verify Installation

You can verify that OpenSearch is running by checking the service status:

sudo systemctl status opensearch

Conclusion

You have successfully installed OpenSearch on your Ubuntu 24.04 system. You can now access it through its REST API or integrate it into your applications.

Resources

 

 

OpenSearch is an open-source search and analytics engine that is widely used for log analytics, real-time application monitoring, and search-based data applications. Follow the steps below to install OpenSearch on Ubuntu 24.04.

Step 1: Update the System

Before starting, ensure your system is up-to-date by running the following commands:

        sudo apt update
        sudo apt upgrade
    

Step 2: Install Java

OpenSearch requires Java, so you need to install OpenJDK. Run the following command to install OpenJDK 11:

        sudo apt install openjdk-11-jdk
    

Step 3: Download and Install OpenSearch

Add the OpenSearch repository and install the OpenSearch package:

        wget https://artifacts.opensearch.org/downloads/opensearch/opensearch-2.10.0-linux-x64.tar.gz
        tar -zxvf opensearch-2.10.0-linux-x64.tar.gz
        sudo mv opensearch-2.10.0 /usr/local/opensearch
    

Step 4: Configure OpenSearch

OpenSearch requires some configuration before starting. Navigate to the OpenSearch directory and edit the configuration file:

        cd /usr/local/opensearch/config
        sudo nano opensearch.yml
    

Make necessary changes such as setting network.host and discovery.seed_hosts.

Step 5: Start OpenSearch

Once configured, you can start OpenSearch by running the following command:

        sudo /usr/local/opensearch/bin/opensearch
    

Step 6: Verify OpenSearch Installation

To check if OpenSearch is running, navigate to http://localhost:9200 in your web browser. You should see a response from OpenSearch.

VPS Recommendation

If you’re looking for a reliable VPS, visit the following link for VPS Windows services: NetCloud24 VPS Windows Services.