> 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/upgrade/elasticsearch-upgarde-ubuntu.md).

# Elasticsearch Upgarde (Ubuntu)

This article provides detailed instructions for upgrading Elasticsearch to the latest stable version on an Ubuntu system using the APT package manager. It ensures a smooth upgrade while preserving the existing configuration and data.

### **Prerequisites**

* User performing the upgrade has **sudo (administrative) privileges**.
* Elasticsearch is already installed on the system.
* Credentials for the **elastic** user are available (if security is enabled).
* System has **internet connectivity** to fetch updated packages from the repository.

## **Upgrade Steps**

* **Check the Current Version**
  * Run the following command to verify the installed Elasticsearch version:

    ```bash
    curl -XGET -u elastic:<password> http://localhost:9200
    ```
  * Replace `<password>` with the actual password of the **elastic** user.

    <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F1gknpynK73OcSZDMDx61%2Fimage.png?alt=media&amp;token=a16612ec-963b-4267-9324-129387193ef1" alt=""><figcaption></figcaption></figure>
* **Stop the Elasticsearch Service**
  * Prevent data corruption by stopping the service before upgrading:<br>

    ```bash
    sudo systemctl stop elasticsearch
    ```

    <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FI1c20D8dwZ5RBguZUeZD%2Fimage.png?alt=media&amp;token=a1b3a788-5f2e-49d3-9785-43e4481e4b8f" alt=""><figcaption></figcaption></figure>
* **Upgrade Elasticsearch via APT**
  * Update repositories and install the latest version:

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

    <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FxyAuqDOY1sdMQcxPUTZk%2Fimage.png?alt=media&amp;token=ce924c41-7612-414d-b2f5-52a4afe0948c" alt=""><figcaption></figcaption></figure>
  * This fetches the latest version from the configured Elastic APT repository.
* **Start the Elasticsearch Service**
  * Restart the service after installation:

    ```bash
    sudo systemctl start elasticsearch
    ```
* **Verify the Upgrade**
  * Confirm the installed version:

    ```bash
    curl -XGET -u elastic:<password> http://localhost:9200
    ```
  * The response should show the **upgraded version number**.

## **Post-Upgrade Verification (Optional)**

* Check Elasticsearch logs for warnings or errors:

  ```bash
  sudo journalctl -u elasticsearch
  ```
* Confirm the updated version with the API:

  ```bash
  curl -XGET -u elastic:<password> http://localhost:9200
  ```

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FutAuGVZsRqsd3QthsDbt%2Fimage.png?alt=media&amp;token=27c169b5-9808-49cc-a0f8-b1772ce97d72" alt=""><figcaption></figcaption></figure>

***

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ovaledge.com/release7.2/deployment-and-maintenance/upgrade/elasticsearch-upgarde-ubuntu.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
