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
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
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.
You should read it
- Instructions to install Ubuntu directly from the hard drive
- How to install Pip in Ubuntu
- How to install Hyper Terminal in Ubuntu 20.04
- How to install Steam in Ubuntu
- 5 things to do when installing Ubuntu on PC
- How to Install Ubuntu Linux
- How to Install Ubuntu Linux Without CD (Windows)
- How to install µTorrent (uTorrent) in Ubuntu 20.04
May be interested
- How to disable auto-suspend in Linuxin many cases, auto-suspend is a convenient feature. it prevents image retention and conserves power when you are not actively using your computer.
- 6 Best New Features in Linux Mint 21.2 'Victoria'linux mint 21.2 is out, and fans of this distro can't help but rejoice. the ubuntu-based operating system, complete with 3 officially supported desktop environments, is here to stay, thanks to its long-standing support and great improvements.
- How to fix NetworkManage not running on Linuxin most cases, problems with networkmanager are simple to solve. you may find that the solution is as easy as reinstalling networkmanager or enabling service.
- How to effectively secure a Linux system with YubiKeyone of the most popular solutions to authentication problems is yubikey. but what is yubikey and how does hardware authentication work? can you secure your linux pc with yubikey?
- 7 reasons to upgrade to Ubuntu 23.04canonical released the final version of ubuntu 23.04, called lunar lobster, in april 2023. this version of ubuntu offers quite a few changes and updates that many will surely appreciate.
- 9 best Debian-based Linux distributionsfortunately, debian's flexibility has made it a good base for other distributions, providing a more pleasant experience for those new to linux.