In Magento 2.4.x, You have to install and configure Elasticsearch before setting up a new project.
If you want to know how to install Elasticsearch then follow below steps.
Step 1 – Install Java jdk – Its necessary for magento 2.4.x
– sudo apt-get update
– sudo apt install openjdk-8-jdk
– java -version (For check java version. It’s show something like below)
openjdk version "1.8.0_272" OpenJDK Runtime Environment (build 1.8.0_272-8u272-b10-0ubuntu1~16.04-b10) OpenJDK 64-Bit Server VM (build 25.272-b10, mixed mode)
Step 2 – Install from the APT repository
– sudo apt install apt-transport-https
Step 3 – After Install Elasticsearch using below commands
– sudo apt-get update
– sudo apt-get install elasticsearch
Step 4 – After Install Elasticsearch, Start it’s service using below commands
– systemctl daemon-reload
– systemctl enable elasticsearch.service (For enable service)
– systemctl start elasticsearch.service (For start service)
– service elasticsearch status (For check it’s status)
That’s it.
Now, Elasticsearch has been installed for your Magento 2.4.x projects.

