> For the complete documentation index, see [llms.txt](https://docs.ovaledge.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ovaledge.com/release7.2/deployment-and-maintenance/installation/elasticsearch-7.17.x-on-ubuntu-22.04+.md).

# Elasticsearch 7.17.x on Ubuntu 22.04+

This article provides a comprehensive guide for installing **Elasticsearch version 7.17.x** on an Ubuntu 22.04 system. It includes prerequisites, installation steps, configuration, and performance optimization guidelines recommended by OvalEdge.

## Prerequisites

Before proceeding, ensure the following requirements are met:

* **Operating System**: Ubuntu 22.04 LTS or later
* **User Access**: Root or a user with `sudo` privileges
* **Network**: Stable internet connection
* **Java**: Java 17 installed (`openjdk-17-jdk`)
* **Firewall**: Ensure required ports are open (`9200`, `9300`)

## Installation Steps

1. **Java Installation**
   * Log in to the Elasticsearch VM and install Java 17:

     ```bash
     sudo apt update -y
     sudo apt install -y openjdk-17-jdk
     java --version
     ```

     \
     *Sample Reference Screenshot*

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeP-FiOpl1LvbvoVqgHzO8qVE8PNDTYKH7muZSJEMnAGHtSLUFUoaDwApajVJJzs3ITol7Sx3ZTWihi6Ry4eKUljZT1V-M-vKXCyNwtw0h-KzPBSNcLYenHwR2vCXlIXUBPhb69Xw?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure></div>

2. **Elasticsearch Installation**
   * **Update Package Index and Enable HTTPS Support**
     * Before installing Elasticsearch, update the package index and ensure secure APT transport is enabled:

       ```bash
       sudo apt update -y
       sudo apt install apt-transport-https -y
       ```

       <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfGKVKwCCVYjPMTaoArAncaI3qAxRVVp7ar01sgC6wLyIUQpk-Dy8y2wWcefqeh2m6xbk0g28qPf_yxAwSi6lSnTfg0_RSdt9CKwgW2iP2_w_4uZWMke5keQJbVMpgCuQ4rJ93L7g?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure>
   * **Create Elasticsearch Repository File**

     Download and add the GPG key, then configure the repository:

     ```bash
     wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
     sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
     ```

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd8T75SKSq9WOAyk7RE5tKZBe6G7DCVbuwCMDIR9KPkdDYVEqFU9B05rG1QEC4zLo79kyLwjRwK938iJTRPZWnGtU_nhv0zn5FMYvhO8RHOJCYqDMYsZbVIdtJSP-Kzs-N_ToIioQ?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure>
   * **Install Elasticsearch**

     Run the following commands to install Elasticsearch:

     ```bash
     sudo apt update
     sudo apt install elasticsearch -y
     ```

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc4IsXmjGmowG9mY6xVquF3B8HgoKr_ClDne3sVx8X16CB3ZfZmghgKKkYC9tMOLf7tnPgzrZk5fwr_Sp4qj_z2j6nZYFEJVuL2NG7aOPwwJFaNdnrpyYKZiRSXS3u1Ch4K62NK?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure>
   * **Enable and Start the Service**

     Enable Elasticsearch to start at boot and then start the service:

     ```bash
     sudo systemctl daemon-reexec
     sudo systemctl enable elasticsearch
     sudo systemctl start elasticsearch
     ```

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXemPtxe1aBWncDUwJB2_J9tBn7u9drzBZdMx4aCwOBU-WUbbsNc0IDVH6Rgk5yw4KVEzzhjytjouzvDAu4fYkWtwrNNgtGmtFa8Rg_7BOCXle6C-OW7K-FdgM0QH1bKI0_fDD3d?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure>

3. **Elasticsearch Configuration**
   * **Configure Elasticsearch Settings**

     Open the Elasticsearch configuration file:

     ```bash
     sudo vi /etc/elasticsearch/elasticsearch.yml
     ```

     Add or update the following parameters:

     ```yaml
     cluster.name: ovaledge
     network.host: 0.0.0.0
     http.port: 9200
     transport.host: localhost
     transport.tcp.port: 9300
     xpack.security.enabled: true
     ```

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcCfe6YdSKgKX7-kD5zJarDhGpQa2D9_FUIhv8pC4yhLKrwEHkEH6SVqJ00Eg7vxp-0_kEb4NXYOj9JgYxwzlmTLxRoaaZiFfYRJWQNXA0WCDF3-g1U3G9wEurzv1v0y8Ik7Po-?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure>

   * **Configure JVM Heap Size**

     Edit the JVM options file:

     ```bash
     sudo vi /etc/elasticsearch/jvm.options
     ```

     Locate the following lines (usually near the top of the file):

     ```ini
     ## -Xms4g
     ## -Xmx4g
     ```

     Uncomment and configure them:

     ```ini
     -Xms4g
     -Xmx4g
     ```

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Both values must be set to the same. Recommended value = <strong>50% of available memory</strong>.</p></div>

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcRWvtWoNJyjRveIAVWNcGzrNicjYxjZ5YCwidBV072AWF7IihK83uYXVJ8-kQivS6nH9SBFmxBUediUnRG6h_iXLP6c7VUak47RNsTbKBdHe_8oa8aOlwvxvjIO0s574LBNPcr0w?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure></div>

   * **Restart Elasticsearch**

     Restart the service to apply changes:

     ```bash
     sudo systemctl restart elasticsearch
     ```

4. **Elasticsearch Passwords**
   * **Set Password for Elastic User**

     Run the password reset tool:

     ```bash
     sudo /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic -i
     ```

     When prompted:

     * Type **y** and enter a new password for the `elastic` user
     * Confirm the password if requested

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcPdJrLm_KzvTK9Cp0NSw4n5H0h9T8vMq9k4DFnEYqe4ROE7JRzRf6bOCHw0D7dOTKCbs2s1Z-YFOiZEiPXj9Qw6tZj4SXOV7WtTwP6cZCc_1fTD-5IgZfpwkAAVX7obHTh8-bE?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure>

5. **Verify Installation**
   * **Verify Service Availability**
     * Use `curl` or a browser to verify Elasticsearch is running:

       ```bash
       curl http://localhost:9200 -u elastic:<password>
       ```
     * Replace `<password>` with the password set previously
     * A successful response should display cluster information in JSON format

       <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F4KwSt8mpqkcBSxw2Julm%2Fimage.png?alt=media&amp;token=35431f21-9848-4ae1-b01f-357d1240c9a1" alt=""><figcaption></figcaption></figure>

6. **Integrate Elasticsearch with OvalEdge**
   * **Locate and Edit `oasis.properties`**

     On the OvalEdge application VM, navigate to the `extprop` directory and open the file:

     ```bash
     vi /path/to/ovaledge/extprop/oasis.properties
     ```

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcGpYla3GKxqDXhYL3ooX33gFJqnSMKpXJxT7vhiAXekU955XrjOW9N7sQLLGypNUP73MxCNvyVYYl8QSkmgDZuPrKBl--nO_h1EWNhLJ-sqpVesNSjqZsuFjU2qbcJJi4I6Nh4_w?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure></div>

   * **Update Elasticsearch Section**

     Configure the following parameters:

     ```properties
     es.host=<elasticsearch_host>
     es.port=9200
     es.protocol=http
     es.username=elastic
     es.password=<password>
     ```

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdu7fzUs57AUIpt-5jRGQhiwd7VqV3FGVIrWrpChufipOqOiawziAVex4dN4uKY6abHISbnq70gm1knM7uEB0zYciHIWMTSV8UYsbpEpe6uTWtRDpJPuNmSfdTZZ3S0PpgN41-2?key=2SbTepGGfk0cZXjz0gmLSw" alt=""><figcaption></figcaption></figure>

   * **Restart Tomcat Service**
     * Restart Tomcat to apply the updated configuration:

       ```bash
       sudo systemctl restart tomcat
       ```

***

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ovaledge.com/release7.2/deployment-and-maintenance/installation/elasticsearch-7.17.x-on-ubuntu-22.04+.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
