Logo

How To Install Elasticsearch on Ubuntu 24.04

Mar 19, 2024

To install Elasticsearch on your Ubuntu 24.04 system, follow these steps:

Step 1 : First, ensure your package list and installed packages are up to date:

sudo apt update

Step 2 : Install apt-transport-https

sudo apt install apt-transport-https

Step 3 : Install Elasticsearch GPG Key

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg

Step 4 : Add the Elasticsearch repository

echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list

Step 5 : Update package index again

sudo apt update

Step 6 : Install Elasticsearch

sudo apt install elasticsearch

Step 7 : Open /etc/elasticsearch/elasticsearch.yml

sudo nano /etc/elasticsearch/elasticsearch.yml

And edit the line xpack.security.enabled

xpack.security.enabled: true

Step 8 : Start Elasticsearch

sudo systemctl start elasticsearch

Step 9 : Enable Elasticsearch to start on boot

sudo systemctl enable elasticsearch

Step 10 : Reset the password for the elastic user

sudo /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive

Step 11 : Verify installation by accessing Elasticsearch via curl

curl -k -u elastic:password https://localhost:9200

Congratulations! You have successfully installed and configured Elasticsearch on your Ubuntu 24.04 system.

Recommended