Skip to main content

Installation

Docker Installation

bash
# Pull the official Elasticsearch image
docker pull docker.elastic.co/elasticsearch/elasticsearch:9.0.0
# Run single-node cluster
docker run -d \
--name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
docker.elastic.co/elasticsearch/elasticsearch:9.0.0

Package Installation (Ubuntu/Debian)

bash
# Import GPG key
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
# Add repository
echo "deb https://artifacts.elastic.co/packages/9.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-9.x.list
# Install Elasticsearch
sudo apt-get update && sudo apt-get install elasticsearch
# Enable and start service
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch

RPM Installation (CentOS/RHEL)

bash

# Add repository
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
# Create repo file
cat > /etc/yum.repos.d/elasticsearch.repo << EOF
[elasticsearch]
name=Elasticsearch repository for 9.x packages
baseurl=https://artifacts.elastic.co/packages/9.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
EOF
# Install
sudo yum install --enablerepo=elasticsearch elasticsearch
# Enable and start service
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch