> 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/cortex-xsoar-6-installation-guides/6.15/cortex-xsoar-installation-guide/single-server-installation/install-cortex-xsoar-with-elasticsearch/elasticsearch-installation.md).

# Elasticsearch Installation

Install Cortex XSOAR 6.15 on a single server with Elasticsearch.

The following provides instructions for installing a new Cortex XSOAR environment with Elasticsearch.

### Prerequisites for installing Cortex XSOAR with Elasticsearch

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

* A Customer Support Portal account.

  Set up your Customer Support Portal account. For more information, see [How to Create Your CSP User Account](https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000ClNVCA0).

  When you create a Customer Support Portal account, you can set up two-factor authentication (2FA) to log in using email, Okta Verify, or Google Authenticator for non-FedRAMP accounts. For more information, see [How to Enable a Third Party IdP](https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000sZ8mCAE).
* The following roles:

  | Role        | Details                                                                                                                                                       |
  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | CSP role    | The Super User role is assigned to your Customer Support Portal account. The user who creates the account receives this role.                                 |
  | Cortex role | You must have the Account Admin role. The first Customer Support Portal Super User to access Cortex Gateway receives Account Admin permissions automatically. |

  Log in to Cortex Gateway after creating the account. Download the image file and license. Repeat these tasks for each tenant.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You need a license, or a sales-provided evaluation license, assigned to your Customer Support Portal account to download Cortex XSOAR images from Cortex Gateway.</p></div>
* Your deployment meets the [Elasticsearch System Requirements](/cortex-xsoar-6-installation-guides/6.15/cortex-xsoar-installation-guide/system-requirements/elasticsearch-system-requirements.md).
* You have root access.
* Elasticsearch is installed. Elasticsearch should not be installed on the same server as Cortex XSOAR.
* The production server has Python 2.7 or 3.x.
* If you are installing on an Oracle Linux operating system, you need to manually [Install Docker](/cortex-xsoar-8-on-prem/8.7/configure-cortex-xsoar/engines/install-an-engine/docker.md).

If you are deploying a signed installer, you need to import the public key to the operating system. The public key is valid for six months.

{% hint style="info" %}
Install the **Elasticsearch Monitoring** content pack from Marketplace to monitor Elasticsearch. After installation, add the **Elasticsearch Monitoring** dashboard, which includes widgets that monitor Elasticsearch cluster status and track statistics.
{% endhint %}

### Installation file structure

By default, the `.sh` file is in `/home/<user-name>`. The `.sh` file installs the `demistoserver_xxxxx.amd64.deb` file in the `/usr/local/demisto` folder. You can change the default folder, if necessary.

For information about the default installation file structure, see [Install Cortex XSOAR with Bolt Database](/cortex-xsoar-6-installation-guides/6.15/cortex-xsoar-installation-guide/single-server-installation/install-cortex-xsoar-with-bolt-database.md).

### Install Cortex XSOAR with Elasticsearch

{% stepper %}
{% step %}

### Download the installation package and license

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. Select **Next**.
5. Under **Choose Download Option**, select **Installer**.
6. Select the checkbox to agree to the terms and conditions of the license and select **Download**.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>In Google Chrome, to download the image and license files together, you may need to set <strong>Settings</strong> → <strong>Privacy and security</strong> → <strong>Site settings</strong> → <strong>Additional permissions</strong> → <strong>Automatic downloads</strong> to <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"><p>Copy the download link button from your browser's Downloads section to get the offline-installation token.</p></div>
7. (Optional) If you are deploying Cortex XSOAR using a signed installer (GPG), import the GPG public key provided with the signed installer. Open a ticket with Palo Alto Networks support [here](https://support.paloaltonetworks.com/Support/Index) to get the public key.

   For example, use the `rpm --import public.key` command to import the public key into the local GPG keyring. 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. Run `yum install makeself`.
   {% endstep %}

{% step %}

### Make the server package executable

Run the following command to make the package executable. Replace `demisto.sh` with your installer filename if needed.

`chmod +x demisto.sh`
{% endstep %}

{% step %}

### Run the installer

1. Install the app server with Elasticsearch using one of the following commands:

   * Use username and password authentication: `sudo ./demisto.sh -- -elasticsearch-url=<elasticsearch-url> -elasticsearch-username=<elasticsearch-username> -elasticsearch-password=<elasticsearch-password>`
   * Use API key authentication: `sudo ./demisto.sh -- -elasticsearch-url=<elasticsearch-url> -elasticsearch-api-key=<elasticsearch-api-key>`

   Use the following flags:

| 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.                                                                                                                                                          |

2. Accept the EULA and add the information when prompted.
3. Enter the Server HTTPS port. The default is `443`.
4. Enter [Install Cortex XSOAR with Elasticsearch](/cortex-xsoar-6-installation-guides/6.15/cortex-xsoar-installation-guide/single-server-installation/install-cortex-xsoar-with-elasticsearch.md) details, such as the URL and timeout.
5. Type the Admin username. The default is `admin`.
6. Type the password. The default is `admin`.
   {% endstep %}

{% step %}

### Verify the installation

After the installation has completed, do the following:

1. Confirm that the Cortex XSOAR server status is active. Run `systemctl status demisto`.

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

   When you open Cortex XSOAR for the first time, add the license.
   {% endstep %}

{% step %}

### Add the license

After the installation is complete, activate the license:

1. Log in to the Cortex XSOAR server.
2. Upload the **license** file that you downloaded from Cortex Gateway.
   {% endstep %}
   {% endstepper %}


---

# 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://cortex-docs.paloaltonetworks.com/cortex-xsoar-6-installation-guides/6.15/cortex-xsoar-installation-guide/single-server-installation/install-cortex-xsoar-with-elasticsearch/elasticsearch-installation.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.
