OpenSearch is an analytics engine built using Apache Lucene with a distributed search. Its’ easy to do a full-text search on the data stored in OpenSearch and enjoy all the features available in alternative solutions such as Elasticsearch. This project was originally created by Amazon as a fork of Elasticsearch. The main difference between the two is OpenSearch being focused on open, community-driven, and transparent development. OpenSearch is known to offer outstanding performance with the ability to scale up and down on need basis and your application workload requirements.
Another example of OpenSearch use case is for log analytics. Your application can feed logs to OpenSearch, and you use its rich search and visualization functions to dig for issues in the app such as error rates. OpenSearch Dashboards are used to build all sorts of data visualizations in OpenSearch that suits your application and monitoring requirements.
Installation of OpenSearch on Ubuntu 22.04|20.04|18.04 is not a hard process because the Developers maintain an active APT repository with the latest packages. Building OpenSearch from source code is another method of installation but what’s the real need for this?. Installation using apt
from Deb repository is the recommended method.
Adding OpenSearch APT repository
OpenSearch and OpenSearch Dashboards are compatible with all recent LTS releases of Ubuntu Linux. It is highly recommended you avoid the use of a network file system to store data consumed by OpenSearch, especially for production workflows.
Login to your Ubuntu system and ensure the system is up-to-date:
sudo apt update && sudo apt upgrade -y
If you have a file /var/run/reboot-required
it means a reboot it required.
[ -e /var/run/reboot-required ] && sudo reboot
Install some dependency packages before repository addition.
sudo apt -y install curl lsb-release gnupg2 ca-certificates
Import the public GPG key for the APT repository to be added.
curl -fsSL https://artifacts.opensearch.org/publickeys/opensearch.pgp|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/opensearch.gpg
Next we add the APT repository for OpenSearch:
echo "deb https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt stable main" | sudo tee /etc/apt/sources.list.d/opensearch-2.x.list
Verify if our repository is functional.
sudo apt update
Install and Configure OpenSearch
To list all available versions of OpenSearch in the repository we added run the commands below.
$ sudo apt list -a opensearch
Listing... Done
opensearch/stable 2.11.0 amd64
opensearch/stable 2.10.0 amd64
opensearch/stable 2.9.0 amd64
opensearch/stable 2.8.0 amd64
opensearch/stable 2.7.0 amd64
opensearch/stable 2.6.0 amd64
opensearch/stable 2.5.0 amd64
Unless you have an actual need for specific version of OpenSearch, the latest available version of OpenSearch should be installed on your Ubuntu system.
sudo apt install opensearch
Installing a specific version of OpenSearch is also possible.
sudo apt install opensearch=<version>
An example is opensearch=2.10.0
Default configuration file for OpenSearch is available in /etc/opensearch/opensearch.yml
. You can edit this file in accordance with your desired parameters dictated by the applications in your environment.
sudo vim /etc/opensearch/opensearch.yml
We can set few examples such as cluster name, bind address, HTTP port, among many other customizable values.
cluster.name: ocluster1
network.host: 0.0.0.0
http.port: 9200
Optionally disable security features to use http.
plugins.security.disabled: true
Set Node name to use configured hostname in the system.
node.name: ${HOSTNAME}
For single instance set discovery type to single-node.
discovery.type: single-node
After installation and configuration of OpenSearch, start and enable the service to start at system boot.
sudo systemctl restart opensearch
sudo systemctl enable --now opensearch
Check if OpenSearch service was launched successfully.
$ systemctl status opensearch
● opensearch.service - OpenSearch
Loaded: loaded (/lib/systemd/system/opensearch.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2023-12-28 22:57:45 UTC; 9s ago
Docs: https://opensearch.org/
Main PID: 13398 (java)
Tasks: 80 (limit: 4524)
Memory: 1.2G
CPU: 40.866s
CGroup: /system.slice/opensearch.service
└─13398 /usr/share/opensearch/jdk/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt>
Nov 28 22:57:25 jammy systemd[1]: Starting OpenSearch...
Nov 28 22:57:45 jammy systemd[1]: Started OpenSearch.
You can also modify the initial and maximum JVM heap sizes. See an example where we set the initial and maximum heap sizes to 1 GB and 2GB accordingly:
$ sudo vim /etc/opensearch/jvm.options
-Xms1g
-Xmx2g
Restart the service after making the changes.
sudo systemctl restart opensearch
Installing OpenSearch Dashboards
You can install OpenSearch Dashboards which provided an integrated solution for data visualization and data observability.
Add OpenSearch Dashboards APT repository.
echo "deb https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/opensearch-2.x.list
Update package index and install OpenSearch Dashboard.
sudo apt update && sudo apt install opensearch-dashboards
To enable access from external IP address, set it to listed on 0.0.0.0 (Listen on all network interfaces)
$ sudo vim /etc/opensearch-dashboards/opensearch_dashboards.yml
server.host: 0.0.0.0
opensearch.hosts: [http://localhost:9200]
Other options can be modified in the file. When done restart and enable service.
sudo systemctl restart opensearch-dashboards
sudo systemctl enable opensearch-dashboards
From a web browser, navigate to OpenSearch Dashboards. The default port is 5601.

The default logins are:
- Username admin
- Password admin
Testing and Using OpenSearch
We’ve confirmed our OpenSearch is now running on the host. We can verify connectivity by sending an API request using curl
.
- Without security features –
plugins.security.disabled: true
$ curl -X GET http://localhost:9200
{
"name" : "jammy",
"cluster_name" : "ocluster1",
"cluster_uuid" : "tl6Om148S_qOwcMoDKmSrA",
"version" : {
"distribution" : "opensearch",
"number" : "2.11.0",
"build_type" : "deb",
"build_hash" : "4dcad6dd1fd45b6bd91f041a041829c8687278fa",
"build_date" : "2023-10-13T02:57:02.526977318Z",
"build_snapshot" : false,
"lucene_version" : "9.7.0",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
- With security features –
plugins.security.disabled: false
. Authentication credentials is both admin for username and password.
$ curl -X GET https://localhost:9200 -u 'admin:admin' --insecure
{
"name" : "jammy",
"cluster_name" : "ocluster1",
"cluster_uuid" : "bJvBgpvsRtivZHgIH0yCXg",
"version" : {
"distribution" : "opensearch",
"number" : "2.11.0",
"build_type" : "deb",
"build_hash" : "4dcad6dd1fd45b6bd91f041a041829c8687278fa",
"build_date" : "2023-10-13T02:57:02.526977318Z",
"build_snapshot" : false,
"lucene_version" : "9.7.0",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
To list installed plugins run:
$ curl -X GET https://localhost:9200/_cat/plugins?v -u 'admin:admin' --insecure
name component version
jammy opensearch-alerting 2.11.0.0
jammy opensearch-anomaly-detection 2.11.0.0
jammy opensearch-asynchronous-search 2.11.0.0
jammy opensearch-cross-cluster-replication 2.11.0.0
jammy opensearch-custom-codecs 2.11.0.0
jammy opensearch-geospatial 2.11.0.0
jammy opensearch-index-management 2.11.0.0
jammy opensearch-job-scheduler 2.11.0.0
jammy opensearch-knn 2.11.0.0
jammy opensearch-ml 2.11.0.0
jammy opensearch-neural-search 2.11.0.0
jammy opensearch-notifications 2.11.0.0
jammy opensearch-notifications-core 2.11.0.0
jammy opensearch-observability 2.11.0.0
jammy opensearch-performance-analyzer 2.11.0.0
jammy opensearch-reports-scheduler 2.11.0.0
jammy opensearch-security 2.11.0.0
jammy opensearch-security-analytics 2.11.0.0
jammy opensearch-sql 2.11.0.0
For http without security use:
curl -X GET http://localhost:9200/_cat/plugins?v
Learn more from the following pages.
what i found after installation of OpenSearch on EC2.. system SSH stops working any idea. why this is happening
I doubt if the issue relates to opensearch. Could it be your ram maxing?
I followed all steps, got error OpenSearch Dashboards server is not ready yet
Were you able to access the dashboard later?
I followed the steps , when I try to access (http://localhost:5601/) I get nothing , cannot access this page