How to Connect to OpenSearch Database Clusters
Validated on 17 Jun 2024 • Last edited on 9 Mar 2026
OpenSearch is an open-source search and analytics suite which serves as a centralized location to manage logs forwarded from other resources, such as databases and Droplets.
You can connect to DigitalOcean Managed Databases using command line tools and other third-party clients. This guide explains where to find your OpenSearch database’s connection details and how to use them to configure tools and clients.
Retrieve Database Connection Details Using the CLI
Retrieve Database Connection Details Using the API
This API call retrieves the information about your database, including its connection details. The connection details are located in the returned connection JSON object.
View OpenSearch Cluster Connection Details
You use your database’s connection details to configure tools, applications, and resources that connect to the database. To view your database’s connection details, click the name of the cluster on the Databases page to go to its Overview page.
You can view customized connection details based on how you want to connect to the database:
-
Public network and Private network (VPC) options generate connection details based on if you want to connect via the cluster’s public hostname or the cluster’s private hostname. Only other resources in the same VPC network as the cluster can access it using its private hostname.
-
The User field updates the connection details with the user credentials that you would like to connect with.
You can also choose to view the connection details in different formats:
-
Connection parameters: Host, port, and authentication information for application configuration.
-
Connection string: A condensed URL that you can pass to a client or use with
curl.
OpenSearch exposes a REST API over HTTPS. Use the connection details to build requests to your cluster’s endpoint (for example, https://<your-cluster-hostname>:25060).
By default, the control panel doesn’t reveal the cluster’s password for security reasons. Click Copy to copy connection details with the password, or click show-password to reveal the password.
Download the SSL Certificate
Each managed database comes with an SSL certificate. You can use this SSL certificate to encrypt connections between your client applications and the database.
To download your database’s SSL certificate, click the name of the cluster on the Databases page to go to its Overview page. In the Connection Details section, click Download CA certificate.
When you configure your client applications, you can use the certificate’s location on your local system. Each client application is configured differently, so check the documentation for the tool you’re using for more detail on setting up SSL connections.
Connect to the Database
You can connect to OpenSearch using the command line (for example, curl) or a client that supports the OpenSearch or Elasticsearch API. In this guide, we show you how to connect using curl and how to find connection information for applications.
To connect to OpenSearch database clusters using curl, you need three things:
-
To add your local computer to the database’s trusted sources.
-
To have
curlinstalled on your local computer (it is preinstalled on most systems). -
To reference the database cluster’s connection details, which tell your client how to connect to the cluster.
To send a request to the cluster, use the hostname and port from the control panel with HTTP basic authentication. For example, to check cluster health:
curl -u doadmin:<your-password> \
--cacert /path/to/ca-certificate.crt \
https://<your-cluster-hostname>:25060/_cluster/health?prettyReplace <your-password> with your database user password, <your-cluster-hostname> with the hostname from the control panel, and /path/to/ca-certificate.crt with the path to your database’s SSL certificate.
When the connection succeeds, the cluster returns a JSON response with health and status information.
From here, you can run other OpenSearch API requests. Learn more in the OpenSearch API documentation.
If you’re having trouble connecting to the database, you can troubleshoot the connection using our Support page, or you can reference the OpenSearch documentation.
To connect to OpenSearch database clusters from an application, you need three things:
-
To add the application’s host or network to the database’s trusted sources.
-
A client or library that supports the OpenSearch or Elasticsearch REST API and HTTPS with SSL/TLS (for example, the OpenSearch client libraries or Elasticsearch clients).
-
To reference the database cluster’s connection details, which tell your client how to connect to the cluster.
Configure your client with the cluster endpoint URL (for example, https://<your-cluster-hostname>:25060), the database user and password from the control panel, and the path to your database’s SSL certificate for certificate verification. Exact configuration options depend on the client or library you use.
If you’re having trouble connecting to the database, you can troubleshoot the connection using our Support page, or you can reference the OpenSearch documentation.