
Magento 2 requires a compatible search engine such as OpenSearch for efficient catalog searches. By default, OpenSearch includes security features like HTTPS/SSL and authentication, which can create integration issues in development or internal environments. This guide provides detailed instructions on safely disabling OpenSearch security while maintaining private, internal access.
Step 1: Install OpenSearch on Ubuntu
First, install OpenSearch by following the official documentation or running:
Step 2: Disable Security Plugin
Navigate and edit the OpenSearch configuration file:
Add or modify this line to disable the security plugin:
Step 3: Disable HTTPS (Use HTTP only)
To fully disable HTTPS and use plain HTTP:
- Edit
/etc/opensearch/opensearch.yml
again:
Set these configurations:
Step 4: Restrict Access with Firewall
To secure the internal OpenSearch instance, restrict access using the firewall (UFW):
Step 5: Configure Magento 2 Connection
Configure Magento 2 to communicate over HTTP on port 9200:
- Log into Magento Admin.
- Navigate to Stores → Configuration → Catalog → Catalog → Catalog Search.
- Select "OpenSearch" and configure these settings:
- Hostname:
localhost
- Port:
9200
- Protocol:
HTTP
Save configuration.
Reindex Magento catalog data to verify successful integration:
Ensure indexing completes successfully, confirming Magento and OpenSearch connectivity.
Conclusion and Recommendations
Disabling OpenSearch security simplifies initial setup in controlled, private environments. Always ensure that these setups remain internal and inaccessible externally. For public or production environments, implement comprehensive security measures, including HTTPS and robust authentication methods.
If you require professional assistance managing your Magento or OpenSearch environment, our team at PrivateDevops.com is here to help.
Need Expert Help?
We’re here to support you and manage your tasks.