S K Y L O O P E R

How to Set Up OpenSearch with Magento 2.4.8

The Magento 2.4.8 OpenSearch setup enables your store to have fast, reliable, and scalable product search functionality. This guide walks you through the essential steps to install and configure OpenSearch with Magento 2.4.8, ensuring smooth integration and optimal search performance.

Step 1: Install OpenSearch on Your Server

1. Install necessary dependencies:

apt -y install curl lsb-release gnupg2 ca-certificates

2. Add the OpenSearch repository and import its GPG key:

curl -fsSL https://artifacts.opensearch.org/publickeys/opensearch.pgp | gpg --dearmor -o /etc/apt/trusted.gpg.d/opensearch.gpg

echo "deb https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt stable main" | tee /etc/apt/sources.list.d/opensearch-2.x.list

apt update -y

3. Install OpenSearch with an initial admin password:

env OPENSEARCH_INITIAL_ADMIN_PASSWORD=YourSecurePassword apt install opensearch

4. Configure OpenSearch by editing

/etc/opensearch/opensearch.yml and setting:

cluster.name: magento2
network.host: localhost
http.port: 9200
plugins.security.disabled: false
plugins.security.ssl.http.enabled: false

5. Apply configuration changes and start OpenSearch:

systemctl daemon-reload
systemctl restart opensearch
systemctl status opensearch

6. Verify OpenSearch is running with:


curl -XGET http://localhost:9200/_cluster/health?pretty

Step 2: Configure Magento to Use OpenSearch

Log into Magento Admin.
Navigate to: Stores > Settings > Configuration > Catalog > Catalog > Catalog Search.
Set the following:

Search Engine: OpenSearch
Server Hostname: localhost (or your OpenSearch server IP)
Server Port: 9200
Index Prefix: magento2
Enable HTTP Auth: No (unless you have configured authentication)
Test the connection and save the configuration.

Step 3: Reindex Data and Clear Cache

Run these commands in the Magento root directory:

php bin/magento indexer:reindex catalogsearch_fulltext php bin/magento cache:flush

This ensures Magento switches to OpenSearch and indexes your store catalog properly.

Need Help with Your Magento Store?

For expert assistance with your Magento store, OpenSearch setup, or custom e-commerce development, visit our professional service page: Web & E-commerce Development Services

Conclusion

This straightforward setup guarantees a scalable and efficient search experience for Magento 2.4.8 stores using OpenSearch.

Connect with us for expert web, design and marketing solutions that drive growth and boost your brand.

Contact Us

Shakarpur, New Delhi
India – 201001

© 2025 | All rights reserved.

Have a project in your mind?