Skip to main content

Setting up Elasticsearch (Plesk)

Create Docker Container

⚠️ Important Note: A Nexus account is strictly required to perform this step. If you do not have access, please ask an authorized person to handle this task.

Initialize Docker Container

Follow these steps to deploy the OpenSearch container in Plesk:

  1. Log in to the Plesk server via Nexus.
  2. Click on the Docker menu item in the left sidebar.
  3. Start creating a new container by clicking the + symbol.
  4. Select opensearch/opensearch as the container image. Note: If the image is not immediately available for selection, use the search bar at the top to find it.
  5. Ensure that the tag latest is selected as the Image Version.

Configuration

General

Configure the container using the following settings:

ConfigurationValue
Containernameopensearch_(project_name)
Memory LimitYes - 2048 MB
Automatic Port MappingNo
Manual Mapping 9200Something High - Has to be unused (check other containers)
Manual Mapping 9300Something High - Has to be unused (check other containers)
Manual Mapping 9600Something High - Has to be unused (check other containers)
Manual Mapping 9650Something High - Has to be unused (check other containers)

A good strategy to find free ports is to change the 9 to a higher number, for example, 18, and then add a small number at the end. For example, 9200 becomes 18206.

Volume Mapping

Left: [Root of shop-domain]/docker/open-search or something similar. Folder needs to be created. Set Permissions to 777.

Right: /usr/share/opensearch/data

Environment Variables

ConfigurationValue
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/share/opensearch/jdk/bin:/usr/share/opensearch/bin
JAVA_HOME/usr/share/opensearch/jdk
LD_LIBRARY_PATH/usr/share/opensearch/plugins/opensearch-knn/lib
discovery.typesingle-node
plugins.security.ssl.http.enabledfalse
OPENSEARCH_INITIAL_ADMIN_PASSWORDadmin
DISABLE_SECURITY_PLUGINtrue
DISABLE_INSTALL_DEMO_CONFIGtrue
OPENSEARCH_JAVA_OPTS-Xms2g -Xmx2g

Configure Elasticsearch in Shopware

In the shops .env:

YOUR_PORT relates to the port you mapped Port 9200 to in the General Configuration above.

OPENSEARCH_URL=http://localhost:YOUR_PORT
ADMIN_OPENSEARCH_URL=http://localhost:YOUR_PORT
ES_MULTILINGUAL_INDEX=1
SHOPWARE_ES_ENABLED=1
SHOPWARE_ES_INDEXING_ENABLED=1
SHOPWARE_ES_INDEX_PREFIX=YOUR_PROJECT_NAME