---
title: "Deploy Elasticsearch"
description: "Elasticsearch 9.5 search engine with Kibana, security on and a volume"
category: "Storage"
url: https://railway.com/deploy/elasticsearch-3
---

# Deploy Elasticsearch

Elasticsearch 9.5 search engine with Kibana, security on and a volume

**[Deploy Elasticsearch on Railway](https://railway.com/template/elasticsearch-3)**

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

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

## Template content

### Kibana https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/kibana.svg

- **Image:** elastic/kibana:9.5.6@sha256:c7ed45da5c3cfea020fc6c99ce027f4d21d19dab330379c5115d5eb95f6ecebc
- **Start command:** `/bin/tini -s -- /bin/bash -c 'echo IyBLaWJhbmEgc3RhcnQgc2NyaXB0IGZvciB0aGUgUmFpbHdheSB0ZW1wbGF0ZQpzZXQgLWUKZXhwb3J0IFNFUlZFUl9QT1JUPSIke1BPUlQ6LTU2MDF9IgpleHBvcnQgU0VSVkVSX0hPU1Q9IiR7U0VSVkVSX0hPU1Q6LTo6fSIKZXhwb3J0IEVMQVNUSUNTRUFSQ0hfVVNFUk5BTUU9IiR7RUxBU1RJQ1NFQVJDSF9VU0VSTkFNRTota2liYW5hX3N5c3RlbX0iCmV4cG9ydCBURUxFTUVUUllfT1BUSU49IiR7VEVMRU1FVFJZX09QVElOOi1mYWxzZX0iCmV4cG9ydCBNT05JVE9SSU5HX1VJX0NPTlRBSU5FUl9FTEFTVElDU0VBUkNIX0VOQUJMRUQ9IiR7TU9OSVRPUklOR19VSV9DT05UQUlORVJfRUxBU1RJQ1NFQVJDSF9FTkFCTEVEOi1mYWxzZX0iCmVjaG8gInJhaWx3YXktdGVtcGxhdGU6IEtpYmFuYSBvbiBwb3J0ICRTRVJWRVJfUE9SVCwgRWxhc3RpY3NlYXJjaCBhdCAkRUxBU1RJQ1NFQVJDSF9IT1NUUyBhcyAkRUxBU1RJQ1NFQVJDSF9VU0VSTkFNRSIKZXhlYyAvdXNyL2xvY2FsL2Jpbi9raWJhbmEtZG9ja2VyCg== | base64 -d > /tmp/start.sh && exec /bin/bash /tmp/start.sh'`
- **Health check:** /api/status
- **Public domain:** Yes

### Elasticsearch https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/elasticsearch.svg

- **Image:** elastic/elasticsearch:9.5.6@sha256:79b4f1de4c15e6eca824723086a51e5934406d614d410cc11be77748cafac537
- **Start command:** `/bin/tini -s -- /bin/bash -c 'echo IyBFbGFzdGljc2VhcmNoIHN0YXJ0IHNjcmlwdCBmb3IgdGhlIFJhaWx3YXkgdGVtcGxhdGUgKHJ1bnMgYXMgcm9vdCwgdGhlbiBkcm9wcyB0byB1aWQgMTAwMCkKc2V0IC1lCkVTX0hPTUU9L3Vzci9zaGFyZS9lbGFzdGljc2VhcmNoCkRBVEFfRElSPSIke0VTX0RBVEFfRElSOi0vZXNkYXRhL2VsYXN0aWNzZWFyY2h9IgpleHBvcnQgUE9SVD0iJHtQT1JUOi05MjAwfSIKZXhwb3J0IEVTX0pBVkFfT1BUUz0iJHtFU19KQVZBX09QVFM6LS1YbXMxZyAtWG14MWd9Igpta2RpciAtcCAiJERBVEFfRElSIgppZiBbICIkKGlkIC11KSIgPSAiMCIgXTsgdGhlbiBjaG93biAtUiAxMDAwOjAgIiREQVRBX0RJUiI7IGZpCk1NQVA9dHJ1ZQpNQVBTPSQoY2F0IC9wcm9jL3N5cy92bS9tYXhfbWFwX2NvdW50IDI+L2Rldi9udWxsIHx8IGVjaG8gMCkKaWYgWyAiJE1BUFMiIC1sdCAyNjIxNDQgXTsgdGhlbiBNTUFQPWZhbHNlOyBmaQplY2hvICJyYWlsd2F5LXRlbXBsYXRlOiB2bS5tYXhfbWFwX2NvdW50PSRNQVBTIGFsbG93X21tYXA9JE1NQVAgaGVhcD0nJEVTX0pBVkFfT1BUUycgcG9ydD0kUE9SVCBkYXRhPSREQVRBX0RJUiIKY2F0ID4gIiRFU19IT01FL2Nv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EFTU1dPUkQiIF0gJiYgWyAtbiAiJEVMQVNUSUNfUEFTU1dPUkQiIF07IHRoZW4KICAoICgKICAgIGZvciBpIGluICQoc2VxIDEgMTIwKTsgZG8KICAgICAgc2xlZXAgNQogICAgICBpZiBjdXJsIC1mc1MgLW8gL2Rldi9udWxsIC11ICJlbGFzdGljOiRFTEFTVElDX1BBU1NXT1JEIiAtWCBQT1NUIC1IICdDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24nIFwKICAgICAgICAiaHR0cDovLzEyNy4wLjAuMTokUE9SVC9fc2VjdXJpdHkvdXNlci9raWJhbmFfc3lzdGVtL19wYXNzd29yZCIgXAogICAgICAgIC1kICJ7XCJwYXNzd29yZFwiOlwiJEtJQkFOQV9TWVNURU1fUEFTU1dPUkRcIn0iIDI+L2Rldi9udWxsOyB0aGVuCiAgICAgICAgZWNobyAicmFpbHdheS10ZW1wbGF0ZToga2liYW5hX3N5c3RlbSBwYXNzd29yZCBzZXQiOyBleGl0IDAKICAgICAgZmkKICAgIGRvbmUKICAgIGVjaG8gInJhaWx3YXktdGVtcGxhdGU6IGNvdWxkIG5vdCBzZXQgdGhlIGtpYmFuYV9zeXN0ZW0gcGFzc3dvcmQiCiAgKSAmICkKZmkKY2QgIiRFU19IT01FIgppZiBbICIkKGlkIC11KSIgPSAiMCIgXTsgdGhlbgogIGV4ZWMgY2hyb290IC0tc2tpcC1jaGRpciAtLXVzZXJzcGVjPTEwMDA6MCAvIGVudiBIT01FPSIkRVNfSE9NRSIgL3Vzci9sb2NhbC9iaW4vZG9ja2VyLWVudHJ5cG9pbnQuc2ggZXN3cmFwcGVyCmZpCmV4ZWMgL3Vzci9sb2NhbC9iaW4vZG9ja2VyLWVudHJ5cG9pbnQuc2ggZXN3cmFwcGVyCg== | base64 -d > /tmp/start.sh && exec /bin/bash /tmp/start.sh'`
- **Health check:** /_cluster/health
- **Public domain:** Yes

## Documentation

# Deploy and Host Elasticsearch on Railway

Elasticsearch is the distributed search and analytics engine from Elastic, built on Apache Lucene. It stores JSON documents and makes them searchable in near real time through a REST API, with full-text search, aggregations, geo queries and vector (kNN) search. This template runs Elasticsearch 9.5.6 with Kibana 9.5.6 as its web UI.

## About Hosting Elasticsearch

Elasticsearch runs on the JVM and keeps its indices on disk, so hosting it means giving it a persistent volume, a fixed heap size and a secure network setup. This template runs a single node (`discovery.type=single-node`) with its data on a Railway volume and a 1 GB heap. Security is on: every request needs the `elastic` user and the generated `ELASTIC_PASSWORD`. Railway's domain terminates HTTPS, and other services reach the node over the private network on port 9200. Kibana connects as the built-in `kibana_system` user, whose password the Elasticsearch service sets at every start. Kibana is optional and can be deleted after deploy.

## Common Use Cases

* Full-text and faceted search for websites, shops and documentation
* Log, metric and event analytics, explored and charted in Kibana
* Vector and hybrid search for RAG and recommendation features

## Dependencies for Elasticsearch Hosting

* A persistent volume for the index data (mounted at `/esdata`)
* Kibana (optional) for the web UI, Dev Tools console and dashboards

### Deployment Dependencies

* [Elasticsearch 9.5.6 release notes](https://www.elastic.co/docs/release-notes/elasticsearch)
* [Elasticsearch on GitHub](https://github.com/elastic/elasticsearch)
* [Elasticsearch Docker image docs](https://www.elastic.co/docs/deploy-manage/deploy/self-managed/install-elasticsearch-docker-basic)
* [Kibana Docker image docs](https://www.elastic.co/docs/deploy-manage/deploy/self-managed/install-kibana-with-docker)
* Images: `elastic/elasticsearch:9.5.6` and `elastic/kibana:9.5.6` (Elastic's own Docker Hub images, pinned by digest)

### Implementation Details

**Connecting.** Log in to Kibana with the username `elastic` and the `ELASTIC_PASSWORD` value from the Elasticsearch service's Variables tab. From another Railway service, use reference variables:

```
ELASTICSEARCH_URL=${{Elasticsearch.ELASTICSEARCH_PRIVATE_URL}}
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=${{Elasticsearch.ELASTIC_PASSWORD}}
```

From outside Railway, use `ELASTICSEARCH_PUBLIC_URL` (HTTPS, port 443):

```
curl -u "elastic:$ELASTIC_PASSWORD" "$ELASTICSEARCH_PUBLIC_URL/_cluster/health?pretty"
```

For applications, create a scoped API key in Kibana (Stack Management &gt; API keys) instead of using the `elastic` superuser.

**What the start command does.** It writes `elasticsearch.yml` with single-node discovery, security on, HTTP TLS off (Railway's edge does TLS) and transport bound to localhost. It then fixes the volume's ownership and starts Elasticsearch as the image's non-root user. Anonymous requests can only read `GET /_cluster/health`, which Railway's health check uses. Every other request without valid credentials gets `401`.

**Tuning.** Add an `ES_JAVA_OPTS` variable to change the heap (default `-Xms1g -Xmx1g`). Keep it at about half the memory you want the service to use. Single-node indices with replicas show as `yellow`, which is expected. Set `"number_of_replicas": 0` on your indices to make them `green`.

## Why Deploy Elasticsearch 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 Elasticsearch 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

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/elasticsearch-3
