> 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

Install Cortex XSOAR 6.14 with Elasticsearch. Review prerequisites and deployment steps for a new Elasticsearch-backed environment.

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" %}
Working with Elasticsearch for only indicators or audit logs is not supported.
{% endhint %}

The following diagram depicts a Cortex XSOAR environment with Elasticsearch.

![xsoar-elasticsearch-install.png](https://3548014557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHlpKeFtqCLUYKuYyccd%2Fuploads%2Fgit-blob-c246cad3c84c27a6940ebb4c94d7dfc498f7fc46%2Ffde8f96c090a1cbdba6c9e36fae71be8215ecd2f91ea535eca523d6ecc6c7a1d.png?alt=media)

{% hint style="info" %}
We recommend installing 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 %}

In a standard Cortex XSOAR deployment, the app server and database server are installed on the same machine.

If you are deploying a signed installer:

* You need to import the public key into the operating system. Open a [ticket](https://support.paloaltonetworks.com/Support/Index) with Palo Alto Networks support to get the public key. It is valid for six months.
* If you are using engines or hosts in a multi-tenant environment, you need to install `makeself`.

### Cortex XSOAR 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](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/manage-data/move-data-folders-to-another-location-on-the-server), if necessary.

For more information, see [Cortex XSOAR installation file structure](/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/single-server-deployment/install-the-server-for-a-single-server-deployment.md#cortex-xsoar-installation-file-structure).

### Prerequisites for Installing Cortex XSOAR with Elasticsearch

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

* A Customer Support Portal (CSP) account.

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

  When you create a CSP account, you can set up two-factor authentication (2FA) to log into the CSP by using an Email, Okta Verify, or Google Authenticator (non-FedRAMP accounts). For more information, see [How to Enable a Third Party IdP](https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000sZ8mCAE).
* Have the following roles assigned:

  | Role        | Details                                                                                                                                                                                                            |
  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | CSP role    | The Super User role is assigned to your CSP account. The user who creates the CSP account is granted the Super User role.                                                                                          |
  | Cortex role | If you are the first user to access Cortex Gateway with the CSP Super User role, you are automatically granted Account Admin permissions for the Cortex Gateway. You can also add Account Admin users as required. |

  After creating the CSP account, you need to log in to the Cortex Gateway to download the relevant image file and license.

  Downloading an image file from Cortex Gateway ensures you have the latest pre-configured software package for easy deployment and updates.

  If you have multiple or development tenants, you must repeat these tasks for each tenant.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>To download the Cortex XSOAR images from Cortex Gateway, you need a license (or evaluation license through sales) assigned to your CSP account.</p></div>
* 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.
* Docker is installed automatically unless you are installing on Oracle Linux, which requires manual installation.  For more information, see [Install Docker](/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/docker/docker-installation.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. Under **Choose Download Option**, select **Installer**.
5. Select the checkbox to agree to the terms and conditions of the license and click **Download**.

{% hint style="info" %}
In Google Chrome, to download the image and license files together, you may need to set the browser **Settings** → **Privacy and security** → **Site settings** → **Additional permissions** → **Automatic downloads** to the default behavior **Sites can ask to automatically download multiple files**.
{% endhint %}

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

{% hint style="info" %}
You can copy the download link button from the Downloads section in your browser to get the token needed for offline installation.
{% endhint %}

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.
   {% endstep %}

{% step %}

### Make the server package executable

Run the `chmod +x demistoserver-xxxx.sh` command to convert the `.sh` file to an executable file.
{% endstep %}

{% step %}

### Run the installer

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

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.                                                                                                                                                          |
| `-elasticsearch-prefix`    | String  | Defines the unique prefix a Cortex XSOAR server uses when naming the Elasticsearch indices it creates                                                                                                                                           |

2. Accept the EULA and add the information when prompted.
   {% endstep %}

{% step %}

### Verify the installation

(Optional) After the installation completes, 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.
   {% 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 the Cortex Gateway in Step 1.

For more information, see [Add a license](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/single-server-deployment/add-a-license).
{% 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/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/single-server-deployment/install-the-server-with-elasticsearch.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.
