Elasticsearch is a flexible, powerful, open-source and real-time search and analytics engine. Using a simple set of APIs, it provides the ability for full-text search. Elastic search is freely available under the Apache 2 license, which provides the most flexibility.
This tutorial will help you to install Elasticsearch on Ubuntu 20.04 LTS system.
Login to your Ubuntu system using sudo privileges. For the remote Ubuntu server using ssh to access it. Windows users can use putty or alternatives to log in to Ubuntu system.
Elasticsearch required Java run time installed on system. Ubuntu 20.04 system users, can run the following commands to install Java (OpenJDK 11):
sudo apt updatesudo apt install openjdk-11-jdk
After installation, check the Java version on your system:
java -versionopenjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1) OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)
Also, make sure the JAVA_HOME environment variable is configured:
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
The Elasticsearch official team provides an apt repository to install Elasticsearch on Ubuntu Linux system. After install below package and import GPG key for Elasticsearch packages.
sudo apt install apt-transport-httpswget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Then configure the apt repository on your Debian system. The below command will add a repository to install latest Elasticsearch 6.X on your Ubuntu system.
add-apt-repository "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
After adding the repository to your system. Run the following commands to update cache and then install Elasticsearch packages on your system.
sudo apt updatesudo apt install elasticsearch
The above commands will install Elasticsearch including all the required dependencies on your system.
The Elasticsearch has been installed on your system. You can customize this by editing the Elasticsearch configuration file. Edit configuration file in your favorite text editor:
sudo nano /etc/elasticsearch/elasticsearch.yml
Then update the below basic configurations:
network.host: 0.0.0.0
cluster.name: myCluster1
node.name: "myNode1"
Save your file and close it.
Next, you need to enable Elasticsearch to start automatically on system boot. Also start service for the first time by running the following commands:
sudo /bin/systemctl enable elasticsearchsudo /bin/systemctl start elasticsearch
You can use below commands to stop or restart Elasticsearch service from command line:
sudo systemctl stop elasticsearchsudo systemctl restart elasticsearch
The Elasticsearch service is ready to use. You can test it using curl command-line utility. Run the simple GET command using curl to verify the setup. You will see the Elasticsearch cluster details with the version on your screen.
curl -X GET "http://localhost:9200/?pretty"
{
"name" : "myNode1",
"cluster_name" : "myCluster1",
"cluster_uuid" : "YLBEZHdqQ2W_gMiDUJXJyw",
"version" : {
"number" : "7.8.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "757314695644ea9a1dc2fecd26d1a43856725e65",
"build_date" : "2020-06-14T19:35:50.234439Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
The above output shows the specifications of your elasticsearch server.
You can create a new bucket to your elasticsearch server by running the following command. Change mybucket with your bucket name:
curl -XPUT http://localhost:9200/mybucket
Output:
{"acknowledged":true}
In this tutorial, you have learned how to install Elasticsearch on Ubuntu 20.04 LTS system. Also, helps you to do basic configuration of Elasticsearch server.
The post How To Install Elasticsearch on Ubuntu 20.04 appeared first on TecAdmin.
This article provides a guide to deploy ScyllaDB on Ubuntu VPS. What is ScyllaDB? ScyllaDB…
This article demonstrates how to harden security of VPS server and is intended for server…
In this blog post, we will guide you on how to install wget on Ubuntu…
Jan 27,2026 Xfwl4 - The roadmap for a Xfce Wayland Compositor We, the Xfce team…
This article provides a step-by-step how-to guide to deploy n8n on Ubuntu VPS. What is…
In July 2025, git received CVE-2025-48384, a high vulnerability allowing arbitrary code execution when cloning…