Elasticsearch 9.x on Ubuntu 22.04+

This article provides the steps to install and configure Elasticsearch on an Ubuntu system. It includes repository setup, installation, service configuration, and security enablement. This setup supports search and indexing capabilities required for platform operations.

Prerequisites

Ensure the following conditions are met before proceeding:

  • Operating System: Ubuntu system (supported version)

  • Java Runtime: Java is installed and configured

  • Privileges: Sudo or root access to execute installation and service commands

  • Network Access: Internet connectivity to download packages and repository keys

Installation Steps

  1. Add Elasticsearch Signing Key

    • Download and install the public signing key for the Elasticsearch repository.

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

    • Add the Elasticsearch APT repository.

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

    • Update package lists and install Elasticsearch.

      sudo apt update
      sudo apt install -y elasticsearch

      Sample Reference Screenshot

  4. Configure Elasticsearch

    • Edit the Elasticsearch configuration file.

      sudo vi /etc/elasticsearch/elasticsearch.yml
    • Update the following properties:

      cluster.name: ovaledge
      network.host: 0.0.0.0
      transport.host: localhost
      transport.tcp.port: 9300
      http.port: 9200
  5. Enable and Start Elasticsearch Service

    • Enable the Elasticsearch service to start on system boot and start the service.

      sudo systemctl enable elasticsearch
      sudo systemctl start elasticsearch
      sudo systemctl status elasticsearch.service

      Sample Reference Screenshot

  6. Enable Security

    • Add the following property to the configuration file and restart the service:

      xpack.security.enabled: true
  7. Set Elasticsearch Password

    • Navigate to the Elasticsearch bin directory and reset the password.

      sudo /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
    • Provide and confirm the password when prompted.

  8. Validate Installation

    • Access Elasticsearch using the following URL:

      http://<IP_ADDRESS>:9200

Copyright © 2026, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?