Setting Up OpenSearch for Magento 2.4 (Firstserv Guide)
Magento 2.4 requires a search engine to power its product catalogue. While Elasticsearch was previously used, OpenSearch is now the preferred and actively supported solution.
OpenSearch is not typically suited to shared hosting environments, but Firstserv provides a secure, managed OpenSearch cluster on eligible hosting plans—allowing Magento 2.4 to run efficiently and reliably.
Requesting Your OpenSearch Instance
Step 1: Access OpenSearch in cPanel
- Log in to cPanel
- Scroll to the Advanced section
- Click OpenSearch
Step 2: Request an Instance
- Select the option to request a new OpenSearch instance
- A “please wait” message will appear while your account is checked
⏱️ This process typically takes around 1 minute
Step 3: Receive Your Credentials
Once complete, you’ll be provided with unique OpenSearch connection details, including:
- Host
- Port
- Username
- Password
✅ Keep these details safe—you’ll need them for Magento configuration.
Configuring OpenSearch in Magento
Step 4: Open Magento Settings
- Log in to your Magento Admin dashboard
- Navigate to:
Stores → Configuration
Step 5: Access Catalog Search Settings
- Go to:
Catalog → Catalog - Expand the Catalog Search section
Step 6: Enter OpenSearch Details
Update the following fields:
- Search Engine: OpenSearch
- Server Hostname: (from cPanel)
- Server Port: (from cPanel)
- Enable HTTP Authentication: Yes
- Username: (from cPanel)
- Password: (from cPanel)
Step 7: Test and Save
- Click Test Connection to verify access
- If successful, click Save Configuration
✅ Your Magento store is now using OpenSearch.
Converting from Elasticsearch to OpenSearch
If your store was previously using Elasticsearch, follow these additional steps.
Step 1: Request OpenSearch Credentials
- Follow the steps above to generate your OpenSearch details
Step 2: Update Magento Configuration
- Go to:
Stores → Configuration → Catalog → Catalog Search - Change:
- Search Engine: from Elasticsearch to OpenSearch
- Enter your new OpenSearch credentials
Step 3: Clear Cache and Reindex
After switching search engines, you must update your Magento data.
Option A: Using Terminal (Recommended)
Option B: Using Magento Admin
Clear Cache:
- Go to:
System → Cache Management - Click Flush Magento Cache
Reindex Data:
- Go to:
System → Index Management - Select all indexes
- Choose Invalidate Index → Click Submit
⏱️ Note: Reindexing via the admin panel may take longer, depending on cron schedules.
Common Issues
Connection Test Fails
- Double-check your OpenSearch credentials
- Ensure HTTP authentication is enabled
- Confirm host and port values are correct
Search Not Updating
- Re-run:
- Cache flush
- Reindex process
Benefits of OpenSearch
✅ Faster product search
✅ Improved filtering and navigation
✅ Better performance with large catalogues
✅ Fully supported for Magento 2.4
Summary
To set up or migrate to OpenSearch:
- Request your OpenSearch instance via cPanel
- Add credentials to Magento settings
- Test the connection
- Flush cache and reindex
If you need help configuring or migrating your Magento search engine, the Firstserv support team is always available to assist.
