To install Elasticsearch on Ubuntu 26.04, add Elastic’s 9.x apt repository.
Step 1 : Update.

Step 2 : Install HTTPS apt tools.


Step 3 : Add the GPG key.

Step 4 : Add the 9.x repository.

Step 5 : Update again.

Step 6 : Install Elasticsearch.


Step 7 : Enable and start.

Step 8 : Print the elastic password (security is on by default).

Step 9 : Paste the password from step 8 in place of ELASTIC_PASSWORD.

You have installed Elasticsearch on Ubuntu 26.04.