---
title: "Deploy OpenSearch"
description: "OpenSearch 3.9 search engine and Dashboards with security on by default"
category: "Analytics"
url: https://railway.com/deploy/opensearch-1
---

# Deploy OpenSearch

OpenSearch 3.9 search engine and Dashboards with security on by default

**[Deploy OpenSearch on Railway](https://railway.com/template/opensearch-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/opensearch-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Analytics

## Template content

### OpenSearch Dashboards https://cdn.jsdelivr.net/gh/selfhst/icons/svg/opensearch.svg

- **Image:** opensearchproject/opensearch-dashboards:3.9.0@sha256:256d4cea5928868ac09bca642a0ac8285a2b7e4b7fdd45c4ec06e75a5cf3184c
- **Start command:** `bash -c 'cd /usr/share/opensearch-dashboards && exec ./opensearch-dashboards-docker-entrypoint.sh opensearch-dashboards --server.host=:: --server.port=5601 --opensearch.hosts=http://$OPENSEARCH_HOST:9200 --opensearch.username=kibanaserver --opensearch.password="$KIBANASERVER_PASSWORD" --opensearch_security.cookie.secure=true --opensearch_security.cookie.password="$COOKIE_PASSWORD"'`
- **Health check:** /app/login
- **Public domain:** Yes

### OpenSearch https://cdn.jsdelivr.net/gh/selfhst/icons/svg/opensearch.svg

- **Image:** opensearchproject/opensearch:3.9.0@sha256:3b55f6b6249cfdb92b52ee59adc8a266203ba9ef9f5d82544fad6f1af2f3609e
- **Start command:** `bash -c 'echo c2V0IC1lCkg9L3Vzci9zaGFyZS9vcGVuc2VhcmNoCmlmIFsgIiQoaWQgLXUpIiA9IDAgXTsgdGhlbgogIHJtIC1yZiAkSC9kYXRhL2xvc3QrZm91bmQKICBbICIkKHN0YXQgLWMgJXUgJEgvZGF0YSkiID0gMTAwMCBdIHx8IGNob3duIC1SIDEwMDA6MTAwMCAkSC9kYXRhCiAgZXhlYyBjaHJvb3QgLS11c2Vyc3BlYz0xMDAwOjEwMDAgLyBlbnYgSE9NRT0kSCBiYXNoIC1jICJjZCAkSCAmJiBiYXNoIC90bXAvc3Rhcn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Y29uZmlnL29wZW5zZWFyY2gtc2VjdXJpdHkvaW50ZXJuYWxfdXNlcnMueW1sIDw8WU1MCl9tZXRhOgogIHR5cGU6ICJpbnRlcm5hbHVzZXJzIgogIGNvbmZpZ192ZXJzaW9uOiAyCmFkbWluOgogIGhhc2g6ICIkKGhwICIkT1BFTlNFQVJDSF9JTklUSUFMX0FETUlOX1BBU1NXT1JEIikiCiAgcmVzZXJ2ZWQ6IHRydWUKICBiYWNrZW5kX3JvbGVzOiBbImFkbWluIl0KICBkZXNjcmlwdGlvbjogIkFkbWluIHVzZXIiCmtpYmFuYXNlcnZlcjoKICBoYXNoOiAiJChocCAiJEtJQkFOQVNFUlZFUl9QQVNTV09SRCIpIgogIHJlc2VydmVkOiB0cnVlCiAgZGVzY3JpcHRpb246ICJPcGVuU2VhcmNoIERhc2hib2FyZHMgc2VydmVyIHVzZXIiCllNTApmaQpleHBvcnQgRElTQUJMRV9JTlNUQUxMX0RFTU9fQ09ORklHPXRydWUgRElTQUJMRV9QRVJGT1JNQU5DRV9BTkFMWVpFUl9BR0VOVF9DTEk9dHJ1ZQpleHBvcnQgT1BFTlNFQVJDSF9KQVZBX09QVFM9IiR7T1BFTlNFQVJDSF9KQVZBX09QVFM6LS1YbXMxZyAtWG14MWd9IgpleGVjIC4vb3BlbnNlYXJjaC1kb2NrZXItZW50cnlwb2ludC5zaCBvcGVuc2VhcmNoIC1FY2x1c3Rlci5uYW1lPW9wZW5zZWFyY2ggLUVub2RlLm5hbWU9b3BlbnNlYXJjaC1ub2RlMSAtRWRpc2NvdmVyeS50eXBlPXNpbmdsZS1ub2RlIC1FaHR0cC5ob3N0PTo6IC1FaHR0cC5wb3J0PTkyMDAgLUV0cmFuc3BvcnQuaG9zdD0xMjcuMC4wLjEgLUVjbHVzdGVyLmRlZmF1bHRfbnVtYmVyX29mX3JlcGxpY2FzPTAK | base64 -d > /tmp/start-os.sh && exec bash /tmp/start-os.sh'`
- **Health check:** /_plugins/_security/health
- **Public domain:** Yes

## Documentation

# 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/opensearch` image, pinned by digest) with a volume for index data
* OpenSearch Dashboards 3.9.0 (official `opensearchproject/opensearch-dashboards` image, 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:

```bash
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-node` and `cluster.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 `opensearch` user (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 `kibanaserver` password, update `KIBANASERVER_PASSWORD` on 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.



## Similar templates

- [Plausible WordPress](https://railway.com/deploy/deploy-plausible-for-wordpress-sites) — Cookie-free WordPress stats from your own Plausible
- [Typesense Multilingual](https://railway.com/deploy/deploy-typesense-multilingual-search) — Locale-aware multilingual search with Typesense
- [Formbricks](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Open this page in a browser: https://railway.com/deploy/opensearch-1
