Import the Elasticsearch GPG key:
# wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg –dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
Add the Elasticsearch repository:
# echo “deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main” | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
Update the apt package manager and install Elasticsearch:
# apt update && apt install elasticsearch
Start and enable the Elasticsearch service:
# systemctl start elasticsearch
# systemctl enable elasticsearch
Open the elasticsearch.yml file for editing:
sudo nano /etc/elasticsearch/elasticsearch.yml
Replace the following setting with ‘false’ to disable Magento security features:
# Enable security features
xpack.security.enabled: false
Save the changes to the elasticsearch.yml file.
Restart the Elasticsearch service to apply the configuration:
# systemctl restart elasticsearch.service
Verify that Elasticsearch runs correctly using the curl command:
# curl -X GET “localhost:9200/”
If Elasticsearch is working correctly, you’ll receive an output like this:
{
“name” : “ubuntu”,
“cluster_name” : “elasticsearch”,
“cluster_uuid” : “KPbFKCVLT9uu-RFxzxH_Bw”,
“version” : {
“number” : “8.6.2”,
“build_flavor” : “default”,
“build_type” : “deb”,
“build_hash” : “2d58d0f136141f03239816a4e360a8d17b6d8f29”,
“build_date” : “2023-02-13T09:35:20.314882762Z”,
“build_snapshot” : false,
“lucene_version” : “9.4.2”,
“minimum_wire_compatibility_version” : “7.17.0”,
“minimum_index_compatibility_version” : “7.0.0”
},
“tagline” : “You Know, for Search”
}