- Feb 26, 2015
- 889
- 64
- 59
Installing from the APT repository
Download and install the public signing key:
Bash:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Bash:
apt install apt-transport-https
Save the repository definition to /etc/apt/sources.list.d/elastic-7.x.list:
Bash:
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-7.x.list
These instructions do not use add-apt-repository for several reasons:
- add-apt-repository adds entries to the system /etc/apt/sources.list file rather than a clean per-repository file in /etc/apt/sources.list.d
- add-apt-repository is not part of the default install on many distributions and requires a number of non-default dependencies.
- Older versions of add-apt-repository always add a deb-src entry which will cause errors because we do not provide a source package. If you have added the deb-src entry, you will see an error like the following until you delete the deb-src line:
Unable to find expected entry 'main/source/Sources' in Release file
(Wrong sources.list entry or malformed file)
You can install the Elasticsearch Debian package with:
Bash:
apt update && apt install elasticsearch
Running Elasticsearch with systemd
To configure Elasticsearch to start automatically when the system boots up, run the following commands:
Bash:
/bin/systemctl daemon-reload
Bash:
/bin/systemctl enable elasticsearch.service
- Start your elasticsearch
Bash:systemctl start elasticsearch.service
- Stop your elasticsearch
Bash:systemctl stop elasticsearch.service
- Check Status
Bash:systemctl status elasticsearch.service