> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/single-server-deployment/install-the-server-with-elasticsearch.md).

# Install the Server with Elasticsearch

Verify the following information and requirements before you install Cortex XSOAR with Elasticsearch.

* Your deployment meets the [minimum system requirements](/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/single-server-deployment/system-requirements.md).
* Your Elasticsearch deployment meets the [Elasticsearch System Requirements](/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/elasticsearch/elasticsearch-setup/elasticsearch-system-requirements.md).
* You have root access.
* Elasticsearch 7.x is installed. Elasticsearch should not be installed on the same server as Cortex XSOAR.
* The production server has Python 2.7 or 3.x.

Elasticsearch is a distributed, open source search and analytics engine for all types of data. It enables processing and storing large amounts of data. If you are using Elasticsearch as your database, all objects are stored in Elasticsearch.

{% hint style="info" %}

### Note

Working with Elasticsearch for only indicators or audit logs is no longer supported.
{% endhint %}

The following diagram depicts a Cortex XSOAR environment with Elasticsearch.

![xsoar-elasticsearch-install.png](/files/FKw2iUD71NFeAyckl3aQ)

{% hint style="info" %}

### Note

It is recommended to install the **Elasticsearch Monitoring** content pack from the Marketplace to monitor Elasticsearch. After installation, add the **Elasticsearch Monitoring** dashboard, which includes various widgets to monitor Elasticsearch cluster status and track statistics.
{% endhint %}

### How to install Cortex XSOAR with Elasticsearch

1. Log in to [Cortex Gateway](https://cortex-gateway.paloaltonetworks.com/accounts).
2. In the **Available for Activation** section, use the serial number to locate the tenant to download.

   By default, the **Production-Standalone** license is selected. You can also select **Dev**.

   If you want to use a production and a development tenant with a private remote repository, select **Dev**. If you don't select it now, you can install a development tenant later.
3. Select **Download On Prem**.
4. Under **Choose Download Option**, select **Installer**.
5. Select the checkbox to agree to the terms and conditions of the license and click **Download**.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Tip</h3><p>In Google Chrome, to download the image and license files together, you may need to set the browser <strong>Settings</strong> → <strong>Privacy and security</strong> → <strong>Site settings</strong> → <strong>Additional permissions</strong> → <strong>Automatic downloads</strong> to the default behavior <strong>Sites can ask to automatically download multiple files</strong>.</p></div>

   Two files download: the `demistoserver-xxxxx.sh` installer file and a zipped JSON license file.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>You can copy the download link button from the Downloads section in your browser to get the token needed for offline installation.</p></div>
6. Click **Next**.
7. (Optional) If you are deploying Cortex XSOAR using a signed installer (GPG), you need to import the GPG public key that was provided with the signed installer.

   For example, you can use the **`rpm --import public.key`** command to import the public key into the local GPG keyring. Note that each operating system has specific requirements.
8. (Optional) If you are deploying Cortex XSOAR using a signed installer (GPG) you might need to manually install the `makeself` package by running the **`yum install makeself`** command.
9. Run the **`chmod +x demistoserver-xxxx.sh`** command to convert the `.sh` file to an executable file.
10. Install the app server with Elasticsearch by running one of the following commands:

    * If using username and password authentication: **`sudo ./demisto.sh -- -elasticsearch-url=<elastic search url address> -elasticsearch-username=<the elasticsearch user name> -elasticsearch-password=<the elasticsearch password>`**
    * If using API key authentication: **`sudo ./demisto.sh -- -elasticsearch-url=<elastic search url address> -elasticsearch-api-key=<the elasticsearch API key>`**

    | Flag                       | Type    | Description                                                                                                                                                                                                                                     |
    | -------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `-elasticsearch-url`       | String  | Elasticsearch URL addresses (comma-separated). For example, `http://test1:9200,http://test2:9200`                                                                                                                                               |
    | `-elasticsearch-api-key`   | String  | <p>The Elasticsearch API key, which should be used in licensed versions.</p><p><strong>Note:</strong> If you use this flag, you do not need to use the <code>-elasticsearch-username</code> and <code>-elasticsearch-password</code> flags.</p> |
    | `-elasticsearch-username`  | String  | <p>The Elasticsearch username. This flag is used with the <code>-elasticsearch-password</code> flag.</p><p><strong>Note:</strong> If you use this flag, you do not need to use the <code>-elasticsearch-api-key</code> flag.</p>                |
    | `-elasticsearch-password`  | String  | <p>The Elasticsearch password. This flag is used with the <code>-elasticsearch-username</code> flag.</p><p><strong>Note:</strong> If you use this flag, you do not need to use the <code>-elasticsearch-api-key</code> flag.</p>                |
    | `-elasticsearch-proxy=`    | Boolean | Whether to use a proxy when communicating with Elasticsearch. Can be **`true`** or **`false`**. Default is **`false`**.                                                                                                                         |
    | `-elasticsearch-insecure=` | Boolean | Whether to trust any certificate when communicating with Elasticsearch. Can be **`true`** or **`false`**. Default is **`false`**.                                                                                                               |
    | `-elasticsearch-timeout`   | Integer | The amount of time (in seconds) before Elasticsearch times out. Default is 20 seconds.                                                                                                                                                          |
    | `-elasticsearch-prefix`    | String  | Defines the unique prefix a Cortex XSOAR server uses when naming the Elasticsearch indices it creates                                                                                                                                           |
11. Accept the EULA and add the information when prompted.
12. (Optional) After the installation has completed, do the following:
    1. Confirm that the Cortex XSOAR server status is active by running the **`systemctl status demisto`** command.

       If the server is not active, run the **`systemctl start demisto`** command to start the server.
    2. Confirm that the Docker service status is active by running the **`systemctl status docker`** command.
    3. In a web browser, go to the **`https://`*****`serverURL`*****`:`*****`port`*** to verify that Cortex XSOAR was successfully installed.

       When you open Cortex XSOAR for the first time, you need to add the license.


---

# 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://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/single-server-deployment/install-the-server-with-elasticsearch.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.
