Here is a sequence of commands for installing and testing Elasticsearch 7 on Debian 11 Bullseye.
CURL, if not installed.
sudo apt install curl -y
JAVA, if not installed:
sudo apt install default-jdk
Elasticsearch installation chain:
// GPG key wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - // official Elastic repository sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list' // Update install sudo apt update && sudo apt install elasticsearch // Start and enable on system boot sudo systemctl enable elasticsearch.service --now // Test curl -X GET "localhost:9200/"