Railway

Deploy milvus-standalone

railway for milvus standalone

Deploy milvus-standalone

milvus-railway

xkos/milvus-railway

Just deployed

/var/lib/milvus

Deploy and Host Milvus Standalone on Railway

Milvus is an open-source vector database designed for AI applications, enabling efficient similarity search and analytics on massive-scale embedding vectors. This template deploys Milvus v2.4.17 in standalone mode with embedded etcd, persistent storage, password authentication, and automatic health monitoring.

About Hosting Milvus Standalone

Deploying Milvus Standalone on Railway provides a production-ready vector database infrastructure without the complexity of manual configuration. This template includes embedded etcd for metadata management, Railway Volume integration for persistent data storage, configurable password authentication, and automatic health checks with restart policies. The deployment exposes a public gRPC endpoint on port 19530, making it immediately accessible for AI applications requiring semantic search, recommendation systems, or RAG (Retrieval-Augmented Generation) implementations.

Common Use Cases

  • Semantic Search & Retrieval-Augmented Generation (RAG): Build AI chatbots and question-answering systems that retrieve relevant context from large document collections
  • Recommendation Systems: Power personalized content recommendations by finding similar items based on user behavior embeddings
  • Image & Video Similarity Search: Enable reverse image search, duplicate detection, and content-based retrieval in media applications
  • Anomaly Detection: Identify outliers in high-dimensional data for fraud detection, network security, and quality control
  • Natural Language Processing: Support tasks like document clustering, entity matching, and multilingual search using sentence embeddings

Dependencies for Milvus Standalone Hosting

  • Docker Base Image: milvusdb/milvus:v2.6.9 with embedded etcd support
  • Railway Volume: Persistent storage mounted at /var/lib/milvus for vector data, indexes, and metadata
  • Environment Variables: MILVUS_ROOT_PASSWORD for authentication (optional but strongly recommended)

Deployment Dependencies

Implementation Details

The deployment uses a custom entrypoint script that configures password authentication before starting Milvus:

# Password is set via MILVUS_ROOT_PASSWORD environment variable
# Default password is 'Milvus' if not specified

Connection example for Python applications:

from pymilvus import connections
import os

connections.connect(
    alias="default",
    host="your-app.railway.app",
    port="19530",
    user="root",
    password=os.getenv('MILVUS_ROOT_PASSWORD')
)

For inter-service communication on Railway's private network:

# Reference in other Railway services
MILVUS_HOST=${{Milvus.MILVUS_HOST}}
MILVUS_PORT=${{Milvus.MILVUS_PORT}}

Why Deploy Milvus Standalone 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 Milvus Standalone 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.


One-Click Deploy

Deploy on Railway

๐Ÿ’ก Need Custom Configuration?
If you want to customize the deployment, fork or clone the repository to your own GitHub account first:
https://github.com/xkos/milvus-railway

Getting Started

Step 1: Deploy the Template

  1. Click the "Deploy on Railway" button above
  2. Log in to your Railway account
  3. Click "Deploy Now"

Step 2: Set Password (Recommended)

โš ๏ธ Important: Set a strong password for production use!

  1. Go to your service's Variables tab
  2. Add a new variable:
    MILVUS_ROOT_PASSWORD=YourStrongPassword123!
    
  3. Save and redeploy

Default password: If not set, the default password is Milvus (not recommended for production)

Step 3: Get Connection Info

After deployment completes:

  1. Go to the Settings tab
  2. Under Networking, you'll find:
    • Public Domain: your-app.railway.app
    • Port: 19530 (gRPC endpoint)

Connecting to Milvus

Python

from pymilvus import connections

connections.connect(
    alias="default",
    host="your-app.railway.app",  # Your Railway public domain
    port="19530",
    user="root",
    password="YourStrongPassword123!"  # Your password
)

Node.js

const { MilvusClient } = require('@zilliz/milvus2-sdk-node');

const client = new MilvusClient({
  address: 'your-app.railway.app',
  port: '19530',
  username: 'root',
  password: 'YourStrongPassword123!'
});

Go

import "github.com/milvus-io/milvus-sdk-go/v2/client"

c, err := client.NewClient(context.Background(), client.Config{
    Address:  "your-app.railway.app:19530",
    Username: "root",
    Password: "YourStrongPassword123!",
})

Using with Other Railway Services

If you have other services in the same Railway project:

  1. Go to your app service's Variables tab
  2. Reference the Milvus service variables:
    MILVUS_HOST=${{Milvus.MILVUS_HOST}}
    MILVUS_PORT=${{Milvus.MILVUS_PORT}}
    MILVUS_ROOT_PASSWORD=YourPassword123!
    

Available service variables:

  • MILVUS_HOST - Private network hostname
  • MILVUS_PORT - 19530
  • MILVUS_URI - Full connection URI

Storage & Persistence

All data is automatically persisted to a Railway Volume at /var/lib/milvus:

  • Vector data
  • Indexes
  • Metadata
  • Embedded etcd data

Your data survives redeployments and restarts.

Ports

  • 19530 - gRPC endpoint (publicly exposed)
  • 9091 - Metrics & health check (internal only)
  • 2379 - Embedded etcd (internal only)

Resource Requirements

Recommended:

  • CPU: 2 cores
  • Memory: 4GB RAM
  • Storage: 10GB+

Minimum:

  • CPU: 1 core
  • Memory: 2GB RAM
  • Storage: 5GB

Troubleshooting

Connection Failed

  1. Check your Railway public domain is correct
  2. Ensure port 19530 is used
  3. Verify password matches MILVUS_ROOT_PASSWORD

Authentication Error

permission deny

Solution:

  1. Check the MILVUS_ROOT_PASSWORD variable is set correctly
  2. View deployment logs to confirm password configuration
  3. Redeploy if you just changed the password

Service Not Starting

  1. Check the Deploy Logs in Railway dashboard
  2. Ensure Volume is properly mounted
  3. Verify you have sufficient resources allocated

Health Check

The service includes automatic health monitoring:

  • Endpoint: http://localhost:9091/healthz (internal)
  • Check interval: 30 seconds
  • Auto-restart on failure

Security Best Practices

  1. Always set a strong password

    • Minimum 8 characters
    • Include uppercase, lowercase, numbers, special characters
    • Never use the default Milvus password in production
  2. Use environment variables

    • Store password in Railway Variables
    • Never hardcode credentials in your application
  3. Private networking

    • Use Railway's private network for service-to-service communication
    • Only expose necessary ports publicly

What's Next?

Version Info

  • Milvus: v2.6.9
  • Deployment Mode: Standalone with Embedded etcd
  • Storage: Local filesystem (Railway Volume)

License

Apache License 2.0


This template is perfect for:

  • ๐Ÿงช Development and testing
  • ๐Ÿš€ MVPs and prototypes
  • ๐Ÿ“Š Small to medium-scale vector search applications
  • ๐ŸŽ“ Learning Milvus

For production-scale deployments with high availability, consider Milvus cluster mode or managed services like Zilliz Cloud.


Template Content

milvus-railway

xkos/milvus-railway

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser
View Template
peppermint
Docker-compose port for peppermint.sh

HamiltonAI