Deploy milvus-standalone
railway for milvus standalone
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/milvusfor vector data, indexes, and metadata - Environment Variables:
MILVUS_ROOT_PASSWORDfor authentication (optional but strongly recommended)
Deployment Dependencies
- Milvus Official Documentation
- Milvus Python SDK (pymilvus)
- Milvus Node.js SDK
- Milvus Go SDK
- Source Repository
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
๐ก 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
- Click the "Deploy on Railway" button above
- Log in to your Railway account
- Click "Deploy Now"
Step 2: Set Password (Recommended)
โ ๏ธ Important: Set a strong password for production use!
- Go to your service's Variables tab
- Add a new variable:
MILVUS_ROOT_PASSWORD=YourStrongPassword123! - 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:
- Go to the Settings tab
- Under Networking, you'll find:
- Public Domain:
your-app.railway.app - Port:
19530(gRPC endpoint)
- Public Domain:
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:
- Go to your app service's Variables tab
- 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 hostnameMILVUS_PORT- 19530MILVUS_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
- Check your Railway public domain is correct
- Ensure port 19530 is used
- Verify password matches
MILVUS_ROOT_PASSWORD
Authentication Error
permission deny
Solution:
- Check the
MILVUS_ROOT_PASSWORDvariable is set correctly - View deployment logs to confirm password configuration
- Redeploy if you just changed the password
Service Not Starting
- Check the Deploy Logs in Railway dashboard
- Ensure Volume is properly mounted
- 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
-
Always set a strong password
- Minimum 8 characters
- Include uppercase, lowercase, numbers, special characters
- Never use the default
Milvuspassword in production
-
Use environment variables
- Store password in Railway Variables
- Never hardcode credentials in your application
-
Private networking
- Use Railway's private network for service-to-service communication
- Only expose necessary ports publicly
What's Next?
- ๐ Milvus Documentation
- ๐ง Milvus Python SDK
- ๐ฌ Railway Discord
- ๐ Report Issues
- ๐ฆ Source Repository
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