Deploy OpenSearch
OpenSearch 3.9 search engine and Dashboards with security on by default
OpenSearch Dashboards
Just deployed
OpenSearch
Just deployed
/usr/share/opensearch/data
Deploy and Host OpenSearch on Railway
OpenSearch is an open-source search and analytics engine, forked from Elasticsearch 7.10 and maintained under the Linux Foundation. It stores JSON documents in indices and offers full-text search, aggregations, log analytics, and vector (k-NN) search through a REST API. OpenSearch Dashboards is its web interface for exploring data and building visualizations.
About Hosting OpenSearch
This template runs OpenSearch 3.9.0 as a single node, plus OpenSearch Dashboards 3.9.0. The security plugin is on from the first boot, and anonymous requests get a 401. The admin password and the internal Dashboards (kibanaserver) password are generated at deploy time. The upstream demo users with public default passwords are not created. Index data lives on a Railway volume, so it survives redeploys. OpenSearch is reachable over HTTPS on its Railway domain with basic auth, and over the private network for your other services. Dashboards connects to it over the private network. The JVM heap defaults to 1 GB, so plan on about 2 GB of RAM.
Common Use Cases
- Full-text search for a website, app or product catalog
- Log, event and metrics analytics with dashboards
- Vector and hybrid search (k-NN) for RAG and recommendation features
Dependencies for OpenSearch Hosting
- OpenSearch 3.9.0 (official
opensearchproject/opensearchimage, pinned by digest) with a volume for index data - OpenSearch Dashboards 3.9.0 (official
opensearchproject/opensearch-dashboardsimage, pinned by digest)
Deployment Dependencies
- OpenSearch: https://github.com/opensearch-project/OpenSearch/releases/tag/3.9.0
- OpenSearch Dashboards: https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/3.9.0
- Docker install guide: https://docs.opensearch.org/latest/install-and-configure/install-opensearch/docker/
- Start scripts used by this template: https://github.com/aalfath/opensearch-railway-template
Implementation Details
Sign in to Dashboards with the user admin and the password in the OpenSearch service's OPENSEARCH_INITIAL_ADMIN_PASSWORD variable. From the same service, use OPENSEARCH_URL for the public endpoint and OPENSEARCH_PRIVATE_URL (http://opensearch.railway.internal:9200) for other services in the project:
curl -u admin:YOUR-ADMIN-PASSWORD https://YOUR-OPENSEARCH-DOMAIN/_cluster/health
How it is set up:
- Railway's edge serves HTTPS, so TLS on the HTTP layer is off inside the private network. The transport port is bound to 127.0.0.1 only.
discovery.type=single-nodeandcluster.default_number_of_replicas=0, so new indices stay green on one node.- The container starts as root only to hand the root-owned volume to the
opensearchuser (uid 1000). OpenSearch itself runs as that user. - Users are stored in the security index on first boot. After that, change passwords in Dashboards (Security, then Internal users). Editing the variables later does not change them. If you change the
kibanaserverpassword, updateKIBANASERVER_PASSWORDon the OpenSearch service too, because Dashboards reads it from there. - For a bigger heap, set
OPENSEARCH_JAVA_OPTS(for example-Xms2g -Xmx2g) and keep it at about half of the service's memory.
Why Deploy OpenSearch on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying OpenSearch on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
OpenSearch Dashboards
opensearchproject/opensearch-dashboards:3.9.0OpenSearch
opensearchproject/opensearch:3.9.0
