How to install Elasticsearch on Ubuntu

See how you can install Elasticsearch on your Ubuntu system in a few easy steps!

Prerequisites for installing Elasticsearch

How to install Elasticsearch on Ubuntu Picture 1

There is an important prerequisite for installing Elasticsearch on Ubuntu. Since Elasticsearch is a Java application, you will need to properly install and configure JDK version 11 or later on your system.

Here is how to check if JDK is installed on Linux:

java --version

This command will output the version of Java installed on your system. In case you get "command not found" message or any other kind of error, it probably means you don't have Java installed.

You can manually install the JDK by downloading the tarball or install it through the Linux distribution's package manager. Ideally install via the package manager, as it's faster and not as much hassle as the previous method.

This is how you can install JDK on Ubuntu using APT package manager:

sudo apt install openjdk-18-jdk 

You can replace 18 in the command with any JDK version higher than 11. Wait for the installation to finish and then run the command again to check the Java version. This time around you will see the version as output.

 

How to install Elasticsearch on Ubuntu

Step 1: Add the GPG key and update the repository

Elasticsearch is not part of the official Ubuntu repositories. To install Elasticsearch using APT, you need to add its source list and GPG key.

Run the following commands to add the Elasticsearch package source and GPG key, and update the source list for APT:

curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elastic.gpg echo "deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list sudo apt update

Note : You can change the "8" in the second command to "7" or some other version in case you want to download a specific version of Elasticsearch.

Step 2: Install Elasticsearch with APT

How to install Elasticsearch on Ubuntu Picture 2

Now you can install the Elasticsearch package with APT like you would install any regular package. Here is the command to install Elasticsearch on Ubuntu:

sudo apt install elasticsearch

Enter Y when prompted for permission and wait for the installation to finish. Once installed, follow the steps that appear on the screen to configure Elasticsearch to integrate with Kibana or other data visualization software.

Step 3: Install Elasticsearch using DEB . package

In case you don't want to use APT to install Elasticsearch, you have the option to download the DEB package provided on the official website and install it using the dpkg command.

 

First, download the DEB package using wget. Then use the dpkg command with admin rights to install Elasticsearch:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-amd64.deb sudo dpkg -i elasticsearch-8.8.2-amd64.deb

Keep in mind that you may need to modify the command to match the version of Elasticsearch you want to install.

4 ★ | 2 Vote

May be interested

  • How to install µTorrent (uTorrent) in Ubuntu 20.04How to install µTorrent (uTorrent) in Ubuntu 20.04
    µtorrent provides clients for windows and macos x, however it is installed as a server in ubuntu linux and provides a web ui for managing downloads.
  • How to Install Ubuntu Linux Without CD (Windows)How to Install Ubuntu Linux Without CD (Windows)
    want to install ubuntu on your windows computer, but don't have a dvd or cd drive? there are a couple of different ways that you can install ubuntu on computers that don't have disc drives. the most common way is to create a bootable usb...
  • How to Install ClickHouse on Ubuntu 22.04How to Install ClickHouse on Ubuntu 22.04
    clickhouse is a modern, fast and open source database management system used for online analytical processing (olap).
  • How to install MySQL on Ubuntu 20.04How to install MySQL on Ubuntu 20.04
    in this article, tipsmake will show how to install mysql version 8.0 on ubuntu 20.04 server. by completing it, you'll have an active relational database that can be used to build your next website or app.
  • How to install AVG Antivirus on UbuntuHow to install AVG Antivirus on Ubuntu
    in addition to windows, you can install avg antivirus on ubuntu easily and quickly to ensure that damage is minimized in the most optimal way. along with tipsmake, see how to install avg antivirus on ubuntu below.
  • How to install Ubuntu on a VMware virtual machineHow to install Ubuntu on a VMware virtual machine
    how to install ubuntu on a vmware virtual machine. ubuntu is a very popular operating system nowadays parallel to windows and macos. but ubuntu still makes many users wonder before upgrading should use on their own computers, so we still have a way to experience ubuntu.
  • Ways to install Ubuntu on Windows, run in parallel or run separatelyWays to install Ubuntu on Windows, run in parallel or run separately
    there are many ways to install ubuntu on your computer, such as installing ubuntu from usb, cd, installing ubuntu running in parallel with windows, installing it
  • What's New in Ubuntu 21.10?What's New in Ubuntu 21.10?
    version 21.10 is the latest release of ubuntu and although canonical is turning more attention to the cloud and developers, ubuntu 'impish indri' still comes with some notable changes for those users use the ubuntu desktop every day.
  • 10 software should install on Ubuntu10 software should install on Ubuntu
    you just moved from windows to ubuntu and wondered which ubuntu application is best and which software to install? below are the applications that should be installed on ubuntu after a fresh install.
  • How to install Blender 3D on Ubuntu 20.04How to install Blender 3D on Ubuntu 20.04
    blender 3d is a professional open source 3d graphics and animation software. it has a rich feature set like animations, visual effects, 3d modeling and motion graphics.