9951 explained code solutions for 126 technologies


elasticsearchHow do I install and configure Elasticsearch on Ubuntu?


  1. Install Java 8:
sudo apt-get install openjdk-8-jre
  1. Download and install the Public Signing Key:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  1. Add the Elastic repository to your system:
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
  1. Update the apt package manager:
sudo apt-get update
  1. Install Elasticsearch:
sudo apt-get install elasticsearch
  1. Configure Elasticsearch:

Edit the /etc/elasticsearch/elasticsearch.yml file and set the cluster and node names:

cluster.name: my-cluster
node.name: node-1
  1. Start Elasticsearch:
sudo systemctl start elasticsearch

## Helpful links

Edit this code on GitHub