curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list
apt update -y
apt install elasticsearch
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service