Elasticsearch is an open-source distributed search and analytics engine built on Apache Lucene. It supports RESTful operations and lets you store, search, and analyze large volumes of data in real time.
It is used across large e-commerce platforms, log analysis pipelines as part of the ELK stack (alongside Logstash and Kibana), machine learning anomaly detection, and any application that needs fast, scalable full-text search across millions of records.
This guide covers installing Elasticsearch on Ubuntu 18.04 from the official Elastic repository, verifying the service, and configuring remote access with UFW.
Prerequisite: You need sudo access.
Elasticsearch requires Java 8. Start by updating the package list and installing the HTTPS transport package:
bashsudo apt updatesudo apt install apt-transport-https
Install OpenJDK 8:
bashsudo apt install openjdk-8-jdk
Import the Elasticsearch repository GPG signing key:
bashwget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
A response of OK confirms the key was imported and packages from this repository will be trusted. Add the Elastic repository:
bashsudo sh -c 'echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
Update the package list and install Elasticsearch:
bashsudo apt updatesudo apt install elasticsearch
The service does not start automatically after installation. Enable and start it manually:
bashsudo systemctl enable elasticsearch.servicesudo systemctl start elasticsearch.service
It takes around 10 seconds to fully start. Verify it is running by sending an HTTP request to port 9200:
bashcurl -X GET "localhost:9200/"
A successful response returns a JSON object containing the cluster name, version number, and Elastic’s tagline “You Know, for Search”. If you see a connection refused error, wait a few more seconds and try again. To view service logs for debugging, run sudo journalctl -u elasticsearch.
Elasticsearch stores data in /var/lib/elasticsearch. Configuration files are in /etc/elasticsearch/elasticsearch.yml and Java startup options are in /etc/default/elasticsearch.
By default, Elasticsearch only listens on localhost. For single-node setups where your application and Elasticsearch share the same host, the default configuration is sufficient and no changes are needed.
<strong>Security warning:</strong> Elasticsearch has no built-in authentication by default. Anyone who can reach port 9200 can read and modify your data. Restrict access with firewall rules before exposing Elasticsearch to any network.
Allow SSH first so you do not lock yourself out:
bashsudo ufw allow 22
Allow access to port 9200 only from your trusted client IP:
bashsudo ufw allow from 192.168.100.20 to any port 9200
Enable UFW and verify the rules are active:
bashsudo ufw enablesudo ufw status
Update the Elasticsearch configuration to accept external connections:
bashsudo nano /etc/elasticsearch/elasticsearch.yml
Uncomment the network.host line and set the value:
network.host: 0.0.0.0
To bind to a specific network interface instead of all interfaces, replace 0.0.0.0 with the server’s private IP address.
Restart Elasticsearch to apply the changes:
bashsudo systemctl restart elasticsearch
Elasticsearch is now installed and running on your Ubuntu 18.04 server. Visit the official Elasticsearch documentation to get started with indexing documents, writing search queries, and managing clusters. Leave a comment below if you run into any issues.
PHP 8.5 is included in Ubuntu 26.04's default repositories and is the recommended version for…
Ubuntu 26.04 LTS "Resolute Raccoon" arrived on April 23, 2026 with Linux kernel 7.0, GNOME 50,…
Kubernetes is the standard platform for running containerized workloads across multiple servers with self-healing, rolling…
Ubuntu 26.04 LTS "Resolute Raccoon" was released on April 23, 2026 with Linux kernel 7.0, GNOME desktop, and standard security support until April 2031. A clean install gives you a known-good starting point on new hardware, when replacing another operating system, or when an upgrade path is not practical. This guide walks through how to install Ubuntu 26.04: downloading and verifying the ISO, writing a bootable USB drive, completing the installer, and doing the initial setup after the first boot. Before you start: You need a USB drive with at least 12 GB of free space. Back up any existing data on the target machine — the installer can erase the entire disk. Install Ubuntu 26.04: Download the ISO…
The correct timezone affects more than the clock on your screen. It drives cron job scheduling, systemd timer execution, log file timestamps, database record timing, and SSL certificate validity checks. A mismatched timezone can cause scheduled jobs to fire at the wrong hour and make log timestamps impossible to match with real-world events. This guide shows how to change timezone on Ubuntu using the timedatectl command (the recommended approach for servers and remote machines) and through the graphical Date & Time settings on desktop systems. The steps apply to all current Ubuntu releases including 24.04 and 26.04. <strong>Prerequisite:</strong> Only the root user or a user with sudo access can change the system timezone. Check the Current Timezone Before You Change It Run timedatectl with no arguments to see the active timezone and clock status: bashtimedatectl Sample output: Local…
Atom is a free, open-source, cross-platform code editor developed by GitHub. Built on Electron, it uses…