Skip to content
Follow
Ubuntu Linux

How to Install Elasticsearch 8 on Ubuntu 24.04

Richard
Written by
Richard
Mar 15, 2025 Updated Sep 15, 2026 4 min read
How to Install Elasticsearch 8 on Ubuntu 24.04
How to Install Elasticsearch 8 on Ubuntu 24.04

Installing Elasticsearch 8 on Ubuntu 24.04 sets up a fast search engine that lets you store, search, and sort large piles of data in seconds. Version 8.11 turns on strict security features by default, so the installer handles safety setup automatically as soon as you add the official Elastic software repository to your system.

Advertisement
⚡ Quick Answer

Install Elasticsearch 8 on Ubuntu 24.04 by adding the Elastic APT repository and then running `sudo apt install elasticsearch`. This process automatically enables security features and outputs configuration details like the `elastic` user’s password.

Advertisement

Install prerequisites

Consider installing these packages before setting up Elasticsearch.

To install the required packages, please run the command below.

sudo apt update
sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl wget

Install Elasticsearch

You can install Elasticsearch 8 Ubuntu installation by downloading the official GPG key and adding the software repository to your system sources list. This process sets up the official Elastic package source so your system can securely download and install the search engine packages using the apt package manager.

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

Then add the repository file.

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

After that, update the Ubuntu packages index and install Elasticsearch.

Advertisement
sudo apt update
sudo apt install elasticsearch
⚠️WarningWhen you install Elasticsearch, security features are enabled and configured by default.

The passwords, certificates, and keys will be output to your terminal.

--------------------------- Security autoconfiguration information ------------------------------

Authentication and authorization are enabled.
TLS for the transport and HTTP layers is enabled and configured.

The generated password for the elastic built-in superuser is : e+x0VI*0wOpBVO9Z0ecz

You can complete the following actions at any time:

Reset the password of the elastic built-in superuser with
'/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic'.

Configure Elasticsearch

You configure Elasticsearch 8 Ubuntu installation by enabling the systemd service to start automatically and checking that the background process is running properly. Managing the service ensures the search engine starts up every time your computer boots and stays active for your applications.

First, start up its services.

sudo systemctl enable elasticsearch.service --now
📝Good to KnowBy default, Elasticsearch uses [/var/lib/elasticsearch] for storing data.

This directory holds indexed data and manages the cluster’s state.

Advertisement

The main configuration files are located in [/etc/elasticsearch].

Run the command below to open its configuration file.

sudo nano /etc/elasticsearch/elasticsearch.yml

Then, start configuring the settings that work for you.

In the Network section, remove the comment from the relevant line for network binding and set it to your preferred IP address.

Advertisement

You can configure a cluster name, node identification, memory allocation, and other settings.

# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
# Enable security features. Change to false if SSL isn't configured.
xpack.security.enabled: false

Save the file and exit.

After making changes to the configuration file, restart Elasticsearch to apply those changes.

sudo systemctl restart elasticsearch

To test if Elasticsearch is running, run the command below.

Advertisement
curl http://localhost:9200

It should output something similar to the one below.

{
"name" : "node-1",
"cluster_name" : "my-application",
"cluster_uuid" : "aQCFrr5XQpiQ0AQnpQxn_A",
"version" : {
"number" : "8.17.3",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "a091390de485bd4b127884f7e565c0cad59b10d2",
"build_date" : "2025-02-28T10:07:26.089129809Z",
"build_snapshot" : false,
"lucene_version" : "9.12.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}

Or use the web browser.

Elasticsearch web
Elasticsearch web

That should do it!

Conclusion:

Advertisement

Installing Elasticsearch 8 on Ubuntu 24.04 provides a powerful solution for managing and searching large datasets. Here’s a recap of the key points:

  • Robust Search Solutions: Elasticsearch is designed for high-performance data retrieval and analytics.
  • Seamless Integration: Works well with other Elastic Stack components like Logstash and Kibana for a complete data processing environment.
  • Easy Installation: The installation process is straightforward and can be completed with a few commands.
  • Security Features: Comes with built-in security features, ensuring that your data is protected from unauthorized access.
  • Customizable Configuration: Offers flexibility in setting up configurations to meet specific use cases.

Following the steps outlined in this guide will enable you to leverage Elasticsearch 8 in your projects, allowing you to search and analyze large amounts of data quickly.

How to check if Elasticsearch is installed in Ubuntu?

Check Elasticsearch Version Running Using Kibana Dev Console Perhaps the most convenient way to check which version of Elasticsearch is running is by using the Kibana dev console. This will output the version along with other information such as the name, build_date, and other details.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *