English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Elasticsearch Installation

In this chapter, we will learn in detail about the installation process of Elasticsearch.

To install Elasticsearch locally on your computer, you will need to perform the following steps-

Step 1− Check the Java version installed on the computer. It should be Java 7or higher version. You can check by performing the following operations-

In the Windows operating system (OS) (using Command Prompt)-

> Java -version

In UNIX OS (using terminal)-

$ echo $JAVA_HOME

Step 2 −According to your operating system, download Elasticsearch from www.elastic.co as described below −

  • For Windows operating system, please download the ZIP file.

  • For UNIX OS, please download the TAR file.

  • For Debian OS, please download the DEB file.

  • For Red Hat and other Linux distributions, please download the RPN file.

  • APT and YUM utilities can also be used to install Elasticsearch on many Linux distributions.

Step 3 −The installation process for Elasticsearch is simple, the following describes the process for different operating systems−

  • Windows OS−Unzip the zip package and then install Elasticsearch.

  • UNIX OS−Extract the tar file to any location and then install Elasticsearch.

$wget
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch7.0.0-linux-x86_64.tar.gz
$tar -xzf elasticsearch-7.0.0-linux-x86_64.tar.gz
  • Use the APT utility on Linux operating system−Download and install the public signature key

$ wget -qo - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo
apt-key add -

Save the repository definition as shown below:

$ echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" |
sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

Run the following command to perform the update-

$ sudo apt-get update

Now you can use the following command to install-

$ sudo apt-get install elasticsearch
  • Manually download and install Debian package using the following command

$wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch7.0.0-amd64.deb
$sudo dpkg -i elasticsearch-7.0.0-amd64.deb0
  • Use the YUM utility on Debian Linux operating system

  • Download and install the public signature key-

$ rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  • Add the following text to your " /etc/yum.repos.d/The files with the .repo suffix in the "directory". For example, elasticsearch.repo

elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
  • You can now install Elasticsearch using the following command

sudo yum install elasticsearch

Step 4− Go to the main directory of Elasticsearch and locate it in the bin folder. If you are using Windows, run the elasticsearch.bat file; if you are using UNIX run the elasticsearch file, you can use the command prompt and execute the same operation through the terminal.

In Windows

> cd elasticsearch-2.1.0/bin
> elasticsearch

In Linux

$ cd elasticsearch-2.1.0/bin
$ ./elasticsearch

Note −If you are on Windows, you may receive an error message indicating that JAVA_HOME is not set, please set it in the environment variables to "C:\ Program Files \ Java \ jre"1.8.0_31" or the location where Java is installed.

Step 5− The default port for the Elasticsearch web interface is9200, or you can change it by modifying the elasticsearch.yml file inside the bin directory. You can check if the server is started and running by browsinghttp://localhost:9200. It will return a JSON object in the following way, containing information about the installed Elasticsearch-

{
   "name": "Brain-Child
   "cluster_name": "elasticsearch", "version": {
      "number": ""2.1.0",
      "build_hash": ""72cd1f1a3eee09505e036106146dc1949dc5dc87",
      "build_timestamp": ""2015-11-18T22:40:03Z",
      "build_snapshot": false,
      "lucene_version": ""5.3.1"
   ,
   "tagline": "You Know, for Search"
}

Step 6−In this step, let's install Kibana. Please follow the corresponding code below to install on Linux and Windows-

Applicable for installation on Linux

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.0.0-linuxx86_64.tar.gz
tar -xzf kibana-7.0.0-linux-x86_64.tar.gz
cd kibana-7.0.0-linux-x86_64/
./bin/kibana

for installing on Windows-

Fromhttps://www.elastic.co/products/kibanaDownload Windows version of Kibana .After clicking the link, you will find the homepage as shown below-

Unzip and navigate to the Kibana main directory, then run it.

CD c:\kibana-7.0.0-windows-x86_64
.\bin\kibana.bat