Installation quickstart
OpenSearch supports multiple installation methods: Docker, Debian, Helm, RPM, tarball, and Windows.
This guide uses Docker for a quick local setup. For other installation options, see Installing OpenSearch and Installing OpenSearch Dashboards.
The configurations on this page are intended for local testing. They either disable security or use demo certificates, and they serve OpenSearch Dashboards over HTTP. To set up OpenSearch for production, see Installing OpenSearch and Security configuration.
There are two ways to get started:
- Try OpenSearch with a single command – Great for quick demos.
- Set up a custom Docker cluster – Ideal for more control.
Prerequisite
Before you begin, install Docker on your machine.
Option 1: Try OpenSearch in one command
Use this method to quickly spin up OpenSearch and OpenSearch Dashboards on your local machine with minimal setup. This configuration disables security.
Start OpenSearch:
docker pull opensearchproject/opensearch:latest && docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "DISABLE_SECURITY_PLUGIN=true" --name opensearch opensearchproject/opensearch:latest
Start OpenSearch Dashboards:
docker pull opensearchproject/opensearch-dashboards:latest && docker run -d -p 5601:5601 --add-host=host.docker.internal:host-gateway -e "OPENSEARCH_HOSTS=http://host.docker.internal:9200" -e "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" --name opensearch-dashboards opensearchproject/opensearch-dashboards:latest
This process may take some time. After it finishes, OpenSearch is running on port 9200 and OpenSearch Dashboards on port 5601. To verify that OpenSearch is running, send the following request:
curl http://localhost:9200
You should get a response that looks like this:
{
"name" : "a937e018cee5",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "GLAjAG6bTeWErFUy_d-CLw",
"version" : {
"distribution" : "opensearch",
"number" : <version>,
"build_type" : <build-type>,
"build_hash" : <build-hash>,
"build_date" : <build-date>,
"build_snapshot" : false,
"lucene_version" : <lucene-version>,
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
To verify that OpenSearch Dashboards has started, go to http://localhost:5601/ in your browser.
Option 2: Set up a custom Docker cluster
Use Docker Compose to run a local multi-node OpenSearch and OpenSearch Dashboards cluster:
- Set up a cluster without security – Best for local development.
- Set up a cluster with security – Try OpenSearch with security by installing it with default certificates.
Set up a cluster without security
This setup uses a development Docker Compose file with security disabled.
-
Create a directory for your OpenSearch cluster (for example,
opensearch-cluster). Create adocker-compose.ymlfile in this directory and copy the contents of the Docker Compose file for development into this file. -
Start the cluster by running the following command:
docker compose up -d -
Check that the containers are running:
docker compose psYou should see an output similar to the following:
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS opensearch-dashboards opensearchproject/opensearch-dashboards:latest "./opensearch-dashbo…" opensearch-dashboards 30 seconds ago Up 30 seconds 0.0.0.0:5601->5601/tcp, [::]:5601->5601/tcp opensearch-node1 opensearchproject/opensearch:latest "./opensearch-docker…" opensearch-node1 30 seconds ago Up 30 seconds 0.0.0.0:9200->9200/tcp, [::]:9200->9200/tcp, 9300/tcp, 0.0.0.0:9600->9600/tcp, [::]:9600->9600/tcp, 9650/tcp opensearch-node2 opensearchproject/opensearch:latest "./opensearch-docker…" opensearch-node2 30 seconds ago Up 30 seconds 9200/tcp, 9300/tcp, 9600/tcp, 9650/tcp -
To verify that OpenSearch is running, send the following request:
curl http://localhost:9200You should get a response similar to the one in Option 1.
You can now explore OpenSearch Dashboards by opening http://localhost:5601/.
Set up a cluster with security
This configuration enables security using demo certificates and requires additional system setup.
-
Before running OpenSearch on your machine, you should disable memory paging and swapping performance on the host to improve performance and increase the number of memory maps available to OpenSearch.
Disable memory paging and swapping:
sudo swapoff -aEdit the sysctl config file that defines the host’s max map count:
sudo vi /etc/sysctl.confSet max map count to the recommended value of
262144:vm.max_map_count=262144Reload the kernel parameters:
sudo sysctl -pFor more information, see important system settings.
-
Download the sample Compose file to your host. You can download the file with command line utilities like
curlandwget, or you can manually copydocker-compose.ymlfrom the OpenSearch Project documentation-website repository using a web browser.To use cURL, send the following request:
curl -O https://raw.githubusercontent.com/opensearch-project/documentation-website/3.9/assets/examples/docker-compose.ymlTo use wget, send the following request:
wget https://raw.githubusercontent.com/opensearch-project/documentation-website/3.9/assets/examples/docker-compose.yml -
First, create a custom admin password. Create (or edit) a
.envfile in the same directory as yourdocker-compose.ymlfile. This file stores environment variables that Docker Compose automatically reads when starting the containers. Add the following line to define the admin password:OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password> -
In your terminal application, navigate to the directory containing the
docker-compose.ymlfile you downloaded and run the following command to create and start the cluster as a background process:docker compose up -d -
Confirm that the containers are running using the following command:
docker compose psYou should see an output like the following:
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS opensearch-dashboards opensearchproject/opensearch-dashboards:latest "./opensearch-dashbo…" opensearch-dashboards 30 seconds ago Up 30 seconds 0.0.0.0:5601->5601/tcp, [::]:5601->5601/tcp opensearch-node1 opensearchproject/opensearch:latest "./opensearch-docker…" opensearch-node1 30 seconds ago Up 30 seconds 0.0.0.0:9200->9200/tcp, [::]:9200->9200/tcp, 9300/tcp, 0.0.0.0:9600->9600/tcp, [::]:9600->9600/tcp, 9650/tcp opensearch-node2 opensearchproject/opensearch:latest "./opensearch-docker…" opensearch-node2 30 seconds ago Up 30 seconds 9200/tcp, 9300/tcp, 9600/tcp, 9650/tcp -
Verify that OpenSearch is running. You should use
-k(also written as--insecure) to disable hostname checking because the default security configuration uses demo certificates. Use-uto pass the default username and password (admin:<custom-admin-password>):curl https://localhost:9200 -ku admin:<custom-admin-password>You should get a response similar to the one in Option 1.
You can now explore OpenSearch Dashboards by opening http://localhost:5601/ in a web browser on the same host that is running your OpenSearch cluster. Log in as the admin user using the custom admin password that you set in the .env file.
Common issues
If your containers fail to start or exit unexpectedly, see Common issues in the Docker installation guide.
Stop the cluster
To stop the containers that you started in Option 1, run the following command:
docker stop opensearch opensearch-dashboards
Option 1 doesn’t mount a volume, so the containers store your data internally. To start the containers again with your data intact, use docker start in place of docker stop. Removing the containers with docker rm deletes their data, including any indexes that you create in the following tutorials.
To stop the cluster that you started in Option 2, run the following command from the directory containing your docker-compose.yml file:
docker compose down
This command removes the containers and the network but keeps the named volumes in which the cluster stores your data, so running docker compose up -d again restores the cluster with your data intact. Adding -v to docker compose down deletes the volumes and the data in them.
Other installation types
In addition to Docker, you can install OpenSearch and OpenSearch Dashboards on various Linux distributions and on Windows. For all available installation guides, see Installing OpenSearch and Installing OpenSearch Dashboards.
Further reading
You successfully deployed your own OpenSearch cluster with OpenSearch Dashboards. To learn about configuration and functionality in more detail, see the following pages:
Next steps
- To learn how to send requests to OpenSearch, see Communicate with OpenSearch.