install elasticsearch ubuntu 18.04 code example

Example 1: ubuntu install elasticsearch terminal

sudo -i service elasticsearch start
sudo -i service elasticsearch stop

Example 2: install elasticsearch ubuntu 18.04

sudo apt install elasticsearch

Example 3: install elasticsearch ubuntu 18.04

curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

Example 4: install elasticsearch ubuntu 18.04

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

Example 5: install elasticsearch ubuntu 18.04

sudo apt update