Elasticsearch Installation and Setup

This topic walks you through installing Elasticsearch on your machine and verifying it works. You will also meet Kibana, the browser-based tool that lets you interact with Elasticsearch visually.

What You Need Before Starting

Elasticsearch runs on Java. Modern versions ship with their own bundled Java runtime, so you do not need to install Java separately. You need at least 4 GB of RAM and a 64-bit operating system — Linux, macOS, or Windows all work.

Option 1: Install Directly (Linux / macOS)

Download the archive from elastic.co, extract it, and run the start script.

# Download (replace X.X.X with the latest version number)
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-X.X.X-linux-x86_64.tar.gz

# Extract
tar -xzf elasticsearch-X.X.X-linux-x86_64.tar.gz

# Move into the folder
cd elasticsearch-X.X.X

# Start Elasticsearch
bin/elasticsearch

The first start takes about 30 seconds. Elasticsearch prints a generated password for the built-in elastic user — save this password immediately.

Option 2: Install with Docker (Quickest for Beginners)

Docker lets you run Elasticsearch inside a container without touching your system files. This method takes under two minutes.

# Pull the image
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.13.0

# Run a single-node cluster
docker run -d \
  --name elasticsearch \
  -p 9200:9200 \
  -e "discovery.type=single-node" \
  -e "ELASTIC_PASSWORD=yourpassword" \
  docker.elastic.co/elasticsearch/elasticsearch:8.13.0

Port 9200 is the HTTP port where Elasticsearch listens for requests. Port 9300 is for internal cluster communication between nodes.

Verify the Installation

Once Elasticsearch starts, send a request to port 9200 to confirm it responds.

curl -u elastic:yourpassword https://localhost:9200 --insecure

A successful response looks like this:

{
  "name" : "my-node",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "8.13.0",
    ...
  },
  "tagline" : "You Know, for Search"
}

Install Kibana (Browser UI)

Kibana is Elasticsearch's companion web app. You type queries in Kibana's Dev Tools console instead of writing long curl commands in a terminal.

# With Docker (run after Elasticsearch is already running)
docker run -d \
  --name kibana \
  --link elasticsearch:elasticsearch \
  -p 5601:5601 \
  -e "ELASTICSEARCH_HOSTS=http://elasticsearch:9200" \
  docker.elastic.co/kibana/kibana:8.13.0

Open your browser and go to http://localhost:5601. Log in with username elastic and the password you saved.

Your Setup at a Glance

Your Browser
    |
    | port 5601
    v
+----------+          port 9200         +-------------------+
|  Kibana  |  <---------------------->  |  Elasticsearch    |
| (Web UI) |       queries / results    |  (Search Engine)  |
+----------+                            +-------------------+

Key Configuration File

Elasticsearch reads settings from config/elasticsearch.yml. Three settings matter most at this stage:

SettingWhat It DoesDefault
cluster.nameNames your clusterelasticsearch
node.nameNames this noderandom string
network.hostWhich IP to listen onlocalhost only

Leave all three at their defaults while learning. Change network.host only when you deploy to a server that other machines need to reach.

Sending Your First Query from Kibana Dev Tools

In Kibana, click the hamburger menu, go to Dev Tools, and type this in the console:

GET /

Press the green play button. Kibana sends that request to Elasticsearch and shows the response on the right side. This confirms your entire setup works end to end.

Leave a Comment