```golpecito
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key agregar -
```
Paso 2:Agregar el repositorio de Elasticsearch
```golpecito
sudo apt install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/8.x/apt estable principal" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
```
Paso 3:instalar Elasticsearch
```golpecito
sudo apt actualizar &&sudo apt instalar elasticsearch
```
Paso 4:Habilite Elasticsearch
```golpecito
sudo systemctl daemon-reload
sudo systemctl habilitar elasticsearch.service
```
Paso 5:Inicie Elasticsearch
```golpecito
sudo systemctl iniciar elasticsearch.service
```
Paso 6:verificar la instalación de Elasticsearch
```golpecito
curl -X OBTENER http://localhost:9200
```
Deberías obtener una respuesta como esta:
```
{
"nombre":"Elasticsearch",
"cluster_name":"elasticsearch_ubuntu",
"cluster_uuid":"sN-jN-75SbWj1fI_rZc81g",
"versión" :{
"número":"8.2.4",
"build_flavor":"predeterminado",
"build_type":"acoplador",
"build_hash":"3f4c3a9c5f5c1f4c4b3c4a9a4f400f45aecb0b3e",
"build_date":"2021-06-29T09:02:10.123125Z",
"build_snapshot":falso,
"lucene_version":"8.10.1",
"minimum_wire_compatibility_version":"7.12.0",
"minimum_index_compatibility_version":"6.0.0-beta1"
},
"lema":"Ya sabes, para la búsqueda"
}
```