Steg 1:Importera signeringsnyckel för Elasticsearch-paket
``` bash
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
```
Steg 2:Lägg till Elasticsearch-arkiv
``` bash
sudo apt installera apt-transport-https
echo "deb https://artifacts.elastic.co/packages/8.x/apt stabil main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
```
Steg 3:Installera Elasticsearch
``` bash
sudo apt uppdatera &&sudo apt installera elasticsearch
```
Steg 4:Aktivera Elasticsearch
``` bash
sudo systemctl daemon-reload
sudo systemctl aktivera elasticsearch.service
```
Steg 5:Starta Elasticsearch
``` bash
sudo systemctl starta elasticsearch.service
```
Steg 6:Verifiera Elasticsearch-installationen
``` bash
curl -X GET http://localhost:9200
```
Du borde få ett svar så här:
```
{
"name" :"Elasticsearch",
"cluster_name" :"elasticsearch_ubuntu",
"cluster_uuid" :"sN-jN-75SbWj1fI_rZc81g",
"version" :{
"nummer" :"8.2.4",
"build_flavor" :"standard",
"build_type" :"docka",
"build_hash" :"3f4c3a9c5f5c1f4c4b3c4a9a4f400f45aecb0b3e",
"build_date" :"2021-06-29T09:02:10.123125Z",
"build_snapshot" :false,
"lucene_version" :"8.10.1",
"minimum_wire_compatibility_version" :"7.12.0",
"minimum_index_compatibility_version" :"6.0.0-beta1"
},
"tagline" :"Du vet, för sökning"
}
```