Railway

Deploy Milvus

Vector database for storing embeddings and finding similar items

Deploy Milvus

Just deployed

/var/lib/milvus

Just deployed

Just deployed

/var/lib/etcd

milvus-storage

Bucket

Just deployed

Deploy and Host Milvus on Railway

Milvus is an open-source vector database built for similarity search over embeddings. It stores billions of vectors alongside scalar metadata, indexes them for approximate nearest-neighbour lookup, and answers top-k queries in milliseconds with filtering and hybrid full-text search. Teams building retrieval-augmented generation, semantic search, recommendations and image retrieval use it as the retrieval layer behind their models.

Deploy Milvus on Railway and the whole standalone stack arrives wired together: the Milvus server, an etcd service for metadata, a Railway object storage bucket for segment and index data, and Attu — the official web console — as the only publicly reachable service. Your application connects privately at milvus.railway.internal:19530 while you administer everything through Attu over HTTPS. Authentication is on before first boot, so the database is never exposed with its shipped default password.

Milvus, etcd and Attu services with object storage on Railway

Getting Started with Milvus on Railway

Open the Attu URL from the Railway dashboard once the deploy finishes. Attu opens on a connection screen with the Milvus address already filled in — leave it, choose username/password, and sign in as root with the password from COMMON_SECURITY_DEFAULTROOTPASSWORD. The dashboard then shows your Milvus version, deploy mode and database count — the quickest sign that every service is talking to the others.

Your first useful action is creating a collection. Open the default database, click + Collection, name it, set the vector field's dimension to match your embedding model (768 for many sentence-transformer models, 1536 for OpenAI's text-embedding-3-small), and add scalar fields such as a title. Before saving, open the Index tab on the vector field, create an AUTOINDEX with a matching metric — COSINE for normalised embeddings, L2 otherwise — and tick Load collection immediately after creation. Insert rows from the Data tab, then use Vector Search to paste a query vector and check the results come back ranked by score.

Attu dashboard showing Milvus 2.6.22 running in standalone mode Attu data browser listing six product embedding rows Attu vector search ranking coffee products by cosine score

About Hosting Milvus

A vector database solves a problem relational stores handle badly: finding the rows whose embeddings are closest to a query embedding, over collections far too large to scan. Milvus separates storage from compute and supports HNSW, IVF, DiskANN and quantised indexes, trading recall against memory. Self-hosting matters when embeddings are sensitive, when per-query pricing on a managed service dominates the bill, or when retrieval belongs beside the app.

Key features:

  • Dense, sparse, binary and multi-vector fields in one collection, with hybrid search and reranking
  • Built-in BM25 full-text search, so keyword and semantic retrieval share one query path
  • Metadata filtering evaluated inside the index scan rather than after it
  • Partitions, role-based access control and per-collection privileges
  • SDKs for Python, Node.js, Java, Go and C#, plus a RESTful API

This deployment runs Milvus in standalone mode, packing the coordinator, proxy, query, data and streaming components into one process — the shape Milvus documents for Docker, since the distributed shape is Kubernetes-only. Standalone needs the same external dependencies as a cluster: etcd for schemas, credentials and segment metadata, and object storage for the binlogs. A Railway bucket rather than a MinIO container keeps your vector data on durable storage, not one attached disk.

Why Deploy Milvus on Railway

Railway removes the orchestration work self-hosting Milvus involves:

  • Milvus, etcd, object storage and the Attu console deploy together, already wired
  • Private networking keeps the database off the public internet, no firewall rules
  • Persistent volumes and a managed S3-compatible bucket are provisioned for you
  • Health checks and automatic restarts on each service
  • Vertical scaling from the dashboard when collections outgrow their memory

Common Use Cases

  • Retrieval-augmented generation — fetch the most relevant document chunks for an LLM prompt, filtered by tenant, source or recency
  • Semantic and hybrid product search — combine BM25 keyword scoring with embedding similarity so queries match on meaning, not wording
  • Recommendations — represent users and items as vectors, serving "more like this" in one call
  • Image and video retrieval — index CLIP embeddings for reverse-image lookup and deduplication

Dependencies for Milvus

  • Milvusmilvusdb/milvus:v2.6.22, the vector database (milvus-io/milvus). Serves gRPC and the RESTful API on 19530 and health on 9091, with its write-ahead log and mmap cache on a volume.
  • etcdquay.io/coreos/etcd:v3.5.25, the metadata store. Every schema, index descriptor, credential and segment record lives here, so it is a hard dependency, not a cache, and it keeps a volume.
  • Attuzilliz/attu:v2.6, the official console (zilliztech/attu), and the only service with a public domain.
  • Object storage — a Railway bucket holding the insert, index and statistics binlogs, over the S3 API.

Environment Variables Reference

VariableServicePurpose
COMMON_SECURITY_AUTHORIZATIONENABLEDmilvusRequires credentials on every request
COMMON_SECURITY_DEFAULTROOTPASSWORDmilvusPassword for root, seeded on first boot
ETCD_ENDPOINTSmilvusPrivate address of the etcd service
MINIO_BUCKET_NAMEmilvusBucket holding vector and index data
MILVUS_URLattuMilvus address the console connects to

Milvus maps any configuration key to an environment variable by removing ., _ and / and lowercasing, so MINIO_USE_SSL sets minio.useSSL. Every key in milvus.yaml works this way.

Deployment Dependencies

Hardware Requirements for Self-Hosting Milvus

ResourceMinimumRecommended
CPU2 vCPU8 vCPU
RAM8 GB16–32 GB
Storage5 GB volume + bucket20 GB volume + bucket
RuntimeMilvus 2.6, etcd 3.5Milvus 2.6, etcd 3.5

Memory is the binding constraint: loaded collections sit in RAM, so plan on the raw vector size plus index overhead. A million 768-dimension float vectors is roughly 3 GB before indexing, and mmap moves much of that to disk.

Self-Hosting Milvus

Milvus publishes an official image and a Compose file that runs the same three-part stack locally:

curl -sfL https://raw.githubusercontent.com/milvus-io/milvus/v2.6.22/deployments/docker/standalone/docker-compose.yml -o docker-compose.yml
docker compose up -d

Install the SDK with pip install -U pymilvus, then create a collection, insert a vector and search it:

from pymilvus import MilvusClient
client = MilvusClient(uri="http://localhost:19530", token="root:Milvus")
client.create_collection(collection_name="demo", dimension=8)
client.insert("demo", [{"id": 1, "vector": [0.1]*8, "title": "hello"}])
print(client.search("demo", data=[[0.1]*8], limit=3, output_fields=["title"]))

On Railway, swap the URI for http://milvus.railway.internal:19530 from another service in the project and use your own root password.

Is Milvus Free to Self-Host?

Milvus is free and open source under the Apache 2.0 licence, with no paid tier, seat limit or usage cap in the self-hosted build. Every feature described here — indexes, RBAC, hybrid search, the Attu console — is included, and Zilliz Cloud is an optional managed offering from the project's main contributor. On Railway you pay only for the compute, volumes and storage the services use.

FAQ

What is Milvus? Milvus is an open-source vector database that indexes high-dimensional embeddings and returns the nearest matches to a query vector in milliseconds, with metadata filtering and hybrid keyword search built in.

What does this Railway template deploy? Four pieces: the Milvus server in standalone mode, etcd for metadata, a Railway object storage bucket for vector and index data, and the Attu console as the public entry point.

Why does Milvus need etcd and object storage? Milvus separates metadata, data and compute by design. etcd holds schemas, credentials and segment records; object storage holds the binlogs that make up the collections. Neither is optional in either mode.

How do I connect my application to self-hosted Milvus? Deploy your app into the same Railway project and point your SDK at milvus.railway.internal:19530 with the token root: plus your password. Milvus has no public domain, so traffic stays on the private network; gRPC cannot cross Railway's HTTP edge, and in-project HTTP clients use the RESTful API v2 on the same port.

Which Attu version works with which Milvus version? They must match: Attu 2.6 supports Milvus 2.6 and Attu 3.x supports Milvus 3.x. This template pins both to the 2.6 line so the console and the server never drift apart.


Template Content

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
8
View Template
Redis
Self Host Latest Redis with Railway

2
View Template
EasyImg
Simple self-hostable Nuxt.js personal image hosting system.

Muhammad Bilal
0