OpenSearch is an open-source search and analytics engine developed as a fork of Elasticsearch and Kibana by AWS. It provides powerful search capabilities, log analytics, real-time monitoring, and observability, all built on Apache Lucene. OpenSearch 3.x is the latest major release, offering enhanced features, improved performance, and better scalability.
If you’re looking to set up OpenSearch 3.x on your Ubuntu 24.04 server, this step-by-step guide will walk you through the process.
Why Choose OpenSearch 3.x?
OpenSearch 3.x introduces several new features and improvements, including:
-
- Improved Performance: Enhanced query execution and indexing capabilities.
-
- Advanced Security Features: Built-in authentication, authorization, and encryption.
-
- Enhanced Observability: Improved monitoring and alerting features.
-
- Compatibility with OpenSearch Dashboards: Seamless integration for data visualization.
These features make OpenSearch 3.x a compelling choice for building scalable and secure search and analytics solutions.
Prerequisites
Before you begin, ensure your system meets the following requirements:
-
- Ubuntu 24.04 server with at least 8GB of RAM (16GB recommended for production environments).
-
- Root or sudo privileges.
-
- Java OpenJDK 17 installed (OpenSearch 3.x requires Java 17).
-
- Firewall configured to allow necessary ports.
Step 1: Update Your System
Start by updating your system’s package list and upgrading existing packages:
$ sudo apt update && sudo apt upgrade -y
This ensures all packages are up-to-date and reduces the risk of compatibility issues.
Step 2: Add the OpenSearch 3.x APT Repository
To install OpenSearch 3.x, you need to add its APT repository. First, install the necessary dependencies:
$ sudo apt install lsb-release ca-certificates curl gnupg2 -y
Download and add the OpenSearch GPG key:
$ sudo curl -o- https://artifacts.opensearch.org/publickeys/opensearch-release.pgp | sudo gpg --dearmor --batch --yes -o /usr/share/keyrings/opensearch-release-keyring
Add the OpenSearch 3.x repository:
$ echo "deb [signed-by=/usr/share/keyrings/opensearch-release-keyring] https://artifacts.opensearch.org/releases/bundle/opensearch/3.x/apt stable main" | sudo tee /etc/apt/sources.list.d/opensearch-3.x.list
Update your package list:
$ sudo apt update
With the repository information added, list all available versions of OpenSearch:
$ sudo apt list -a opensearch
Output:
Listing... Done
opensearch/stable 3.2.0 amd64
opensearch/stable 3.1.0 amd64
opensearch/stable 3.0.0 amd64
Step 3: Install OpenSearch 3.x
Before installation, yo need to set a new custom admin password using the following command:
$ export OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>
To install the latest version of OpenSearch run the following command:
$ sudo apt install opensearch -y
After installation, OpenSearch is set up as a systemd service and is ready to be started.
Step 4: Configure OpenSearch
Edit the main configuration file:
$ sudo nano /etc/opensearch/opensearch.yml
For a basic single-node setup, modify the following settings:
cluster.name: lonuxtuto-app
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
discovery.type: single-node
-
-
cluster.name
: Name of your OpenSearch cluster.
-
-
-
node.name
: Unique name for this node.
-
-
-
network.host
: Set to0.0.0.0
to allow external connections (use a private IP for production).
-
-
-
http.port
: Default HTTP port (9200).
-
-
-
discovery.type
: Set tosingle-node
for a single-node setup.
-
Save and exit the editor.
Step 5: Start and Enable OpenSearch
Start the OpenSearch service:
$ sudo systemctl start opensearch
Enable OpenSearch to start on boot:
$ sudo systemctl enable opensearch
Check the status of the service:
$ sudo systemctl status opensearch
You should see that the service is active and running.
● opensearch.service - OpenSearch
Loaded: loaded (/usr/lib/systemd/system/opensearch.service; enabled; preset: enabled)
Active: active (running)
Docs: https://opensearch.org/
Main PID: 3425 (java)
Tasks: 55 (limit: 4548)
Memory: 1.3G (peak: 1.3G)
CPU: 1min 5.442s
CGroup: /system.slice/opensearch.service
Step 6: Test OpenSearch
Verify that OpenSearch is working by sending a request to the HTTP API:
$ curl -X GET https://localhost:9200 -u 'admin:<custom-admin-password>' --insecure
Note that you need to use
--insecure
flag, which is required because the TLS certificates are self-signed.
You should receive a JSON response with information about your OpenSearch node, including its name, cluster name, and version.
{
"name" : "node-1",
"cluster_name" : "linuxtuto-app",
"cluster_uuid" : "pXKj1z87S3SnuJ7fjVs-TQ",
"version" : {
"distribution" : "opensearch",
"number" : "3.2.0",
"build_type" : "deb",
"build_hash" : "6adc0bf476e1624190564d7fbe4aba00ccf49ad8",
"build_date" : "2025-08-12T03:54:00.119899934Z",
"build_snapshot" : false,
"lucene_version" : "10.2.2",
"minimum_wire_compatibility_version" : "2.19.0",
"minimum_index_compatibility_version" : "2.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
Step 7: Install OpenSearch Dashboards (Optional)
For a web-based interface to visualize your data, you can install OpenSearch Dashboards:
First create an APT repository for OpenSearch with the following command:
$ echo "deb [signed-by=/usr/share/keyrings/opensearch-release-keyring] https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/3.x/apt stable main" | sudo tee /etc/apt/sources.list.d/opensearch-dashboards-3.x.list
Verify that the repository was created successfully.
$ sudo apt-get update
Now install OpenSearch Dashboards with the following command:
$ sudo apt install opensearch-dashboards -y
Configure the dashboards:
$ sudo nano /etc/opensearch-dashboards/opensearch_dashboards.yml
Set the following parameters:
server.host: "0.0.0.0"
opensearch.hosts: ["http://localhost:9200"]
Start and enable the dashboards service:
$ sudo systemctl start opensearch-dashboards
$ sudo systemctl enable opensearch-dashboards
Access OpenSearch Dashboards by navigating to
http://<your-server-ip>:5601
in your web browser.
Step 8: Configure Firewall
If you’re using UFW to manage your firewall, allow traffic on the necessary ports:
$ sudo ufw allow 9200/tcp
$ sudo ufw allow 5601/tcp
$ sudo ufw enable
Verify the firewall status:
sudo ufw status
Step 9: Secure OpenSearch (Optional)
For production environments, it’s crucial to secure your OpenSearch installation. Consider the following:
-
- Enable TLS: Configure SSL/TLS to encrypt communication.
-
- Set up Authentication: Use built-in security features to require authentication.
-
- Configure User Roles: Define roles and permissions to control access.
Refer to the OpenSearch Security Documentation for detailed instructions on securing your OpenSearch cluster.
Conclusion
You’ve successfully installed OpenSearch 3.x on your Ubuntu 24.04 server. This setup provides a powerful, scalable, and secure platform for search and analytics. For more advanced configurations, such as setting up a multi-node cluster or integrating with other services, refer to the OpenSearch Documentation.
If you need assistance with securing your OpenSearch installation, configuring advanced features, or integrating with other tools, feel free to ask!