Or copy link
Copy link
Elasticsearch is a powerful open-source search and analytics engine designed to help users store, search, and analyze large volumes of data quickly and in near real-time. Built on Apache Lucene, Elasticsearch is popular for its speed, scalability, and flexibility, making it ideal for log and event data analysis, full-text searches, and even complex data retrieval tasks. As an essential tool in the ELK stack (Elasticsearch, Logstash, and Kibana), Elasticsearch plays a central role in data management and insight generation for many industries.
Ubuntu users benefit from Elasticsearch’s seamless integration and ease of deployment on Linux-based systems. Installing Elasticsearch on Ubuntu allows users to enhance their applications with advanced search capabilities and powerful analytics without needing extensive resources. From monitoring infrastructure to powering search bars and recommendation systems, Elasticsearch provides Ubuntu users with robust data solutions that are both reliable and highly adaptable to varied needs.
In this article, we’ll guide you through the steps to install Elasticsearch Ubuntu.
To begin the installation process, the first step is to import the Elasticsearch PGP (Pretty Good Privacy) key. This key ensures that the Elasticsearch packages we download are secure and authentic. PGP keys act as digital signatures for software packages, allowing Ubuntu to verify that the files come from trusted sources and have not been tampered with. Using a PGP key helps protect your system from potentially harmful or unauthorized code.
The following command will import the Elasticsearch PGP key to your system:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
In this command:
Importing this PGP key is essential, as it guarantees the integrity and trustworthiness of Elasticsearch packages on your Ubuntu system.
Once we’ve imported the Elasticsearch PGP key, the next step is to install Elasticsearch from the official APT (Advanced Package Tool) repository. Installing from the APT repository ensures you get the latest version of Elasticsearch directly from Elastic, along with automatic updates and patches.
Install the `apt-transport-https` Package
On some Debian-based systems, you may need the apt-transport-https package to enable downloading packages over HTTPS. This package ensures that APT, Ubuntu’s package management tool, can securely retrieve packages from remote repositories.
To install apt-transport-https, use the following command:
sudo apt-get install apt-transport-https
In this command, sudo apt-get install apt-transport-https tells APT to install the package that enables HTTPS transport. Installing this package helps ensure secure communication with the Elasticsearch repository.
Add the Elasticsearch Repository to APT Sources
After setting up HTTPS support, you need to add the Elasticsearch repository to your APT sources list. This enables APT to locate and retrieve Elasticsearch from Elastic’s official package repository.
To add the repository, run:
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
Adding this repository allows Ubuntu to detect the latest Elasticsearch versions directly from Elastic, simplifying updates and maintenance.
Update APT and Install Elasticsearch
Now that we’ve added the repository, we need to update the APT package list to recognize Elasticsearch. Then, we can install Elasticsearch itself.
Run the following command:
sudo apt-get update && sudo apt-get install elasticsearch
Here’s what each part of this command does:
This method ensures you’re using a trusted package, with easy access to future updates through Ubuntu’s package management.
Install Elasticsearch on Our Ubuntu VPS!
Experience the reliability of the world’s leading Linux distribution combined with the flexibility of a virtual server. Enjoy lightning-fast performance and low latency.
After installing Elasticsearch, you can verify its status by executing:
sudo systemctl status elasticsearch.service
If you prefer not to use the APT repository, you can manually download and install the Debian package for Elasticsearch. This method gives you more control over the version you install and can be helpful for specific installation needs.
First, download the latest Elasticsearch Debian package directly from Elastic’s website. Use the following command:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.16.0-amd64.deb
This command will download the .deb file to your current directory, ready for installation.
After downloading the package, it’s crucial to verify its integrity. This ensures the file was downloaded correctly and hasn’t been altered. To do this, download the SHA512 checksum file with the following command:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.16.0-amd64.deb.sha512
This command downloads the checksum file, which contains the SHA512 hash for the Debian package you just downloaded.
With the checksum file downloaded, you can now verify the integrity of the Elasticsearch Debian package. Use this command:
shasum -a 512 -c elasticsearch-8.16.0-amd64.deb.sha512
In this command, shasum -a 512 calculates the SHA512 checksum of the downloaded file. Whereas, -c elasticsearch-8.16.0-amd64.deb.sha512 compares the calculated checksum with the one in the .sha512 file. If they match, you’ll see a confirmation that the file is intact and safe to install.
Checksum verification helps ensure you’re installing a legitimate, untampered package, protecting your system from compromised or incomplete downloads.
After verifying the package integrity, proceed with the installation using the `dpkg` command:
sudo dpkg -i elasticsearch-8.16.0-amd64.deb
Here’s what this command does:
This step completes the manual installation of Elasticsearch on your Ubuntu system, bypassing the need for APT repository configurations and enabling you to install the exact version you downloaded.
Learn also How to Install ELK Stack on Ubuntu.
Elasticsearch offers powerful indexing capabilities, enabling rapid searches across large volumes of data. This high-speed search functionality allows users to retrieve relevant information quickly, making it suitable for applications where real-time data access is essential.
Elasticsearch is designed to handle data growth effortlessly. It supports horizontal scaling, meaning you can add more nodes to the cluster as your data volume increases. This scalability makes it ideal for enterprises managing massive datasets across distributed systems.
Elasticsearch provides advanced full-text search capabilities, including support for complex queries, filters, and multi-language analysis. This feature enables precise searching in textual data, making it popular in applications requiring nuanced text analysis.
With Elasticsearch, users can perform real-time analytics on structured and unstructured data. This real-time analysis feature makes it easy to monitor and gain insights from data as it’s generated, making it valuable for applications like log monitoring.
Elasticsearch integrates well with data visualization tools like Kibana and Logstash. This seamless integration allows users to create dashboards, analyze data patterns, and simplify data processing workflows, enhancing overall data management.
In this article, we covered two methods for installing Elasticsearch on Ubuntu. The first method involves setting up Elasticsearch through the APT repository, which streamlines installation and updates by linking directly to the official Elasticsearch package source. This approach is user-friendly, ideal for those who want to keep Elasticsearch updated automatically with minimal manual intervention.
The second method is installing Elasticsearch manually using a downloaded Debian package. This approach offers more control, as users can choose specific versions and avoid potential compatibility issues from automatic updates. It’s especially useful for environments requiring version consistency. Both methods provide effective ways for elasticsearch ubuntu install, each with its own advantages, making it adaptable for different needs and preferences in system management.
Installing the Elasticsearch on Ubuntu provides a user-friendly way to manage data analytic tool. You can upgrade to an Ultahost Linux VPS hosting plan for complex server environments, giving you enhanced control and advanced real time server.
Elasticsearch is an open-source, distributed search and analytics engine designed for handling large amounts of structured and unstructured data. It’s commonly used for log analysis, full-text search, and data visualization.
It’s generally recommended to install the latest stable release for new features and performance improvements, but ensure compatibility with your existing environment.
You can enable Elasticsearch to start automatically on boot by using systemctl:
sudo systemctl enable elasticsearch
To stop Elasticsearch:
sudo systemctl stop elasticsearch
To restart Elasticsearch:
sudo systemctl restart elasticsearch
To check if Elasticsearch is running, use:
sudo systemctl status elasticsearch
Alternatively, you can check the Elasticsearch service via curl:
curl -X GET “localhost:9200/”
Yes, you can run Elasticsearch in a Docker container. Here’s a simple command to run Elasticsearch with Docker:
docker run –name elasticsearch -d -p 9200:9200 -p 9300:9300 docker.elastic.co/elasticsearch/elasticsearch:7.10.0
PostgreSQL, also known as Postgres is a powerful open-s...
PrestaShop is a popular, free, and open-source e-commer...
Composer has become an essential tool in PHP developmen...
Laravel is a popular open-source PHP framework used for...
Plesk is a comprehensive web hosting control panel desi...
TensorFlow is a powerful open-source machine-learning l...
Save my name, email, and website in this browser for the next time I comment.
Δ