
ChromaDB
The AI-native embedding database
Chroma
chroma-core/chroma:0.6.3
Just deployed
/chroma/chroma
The AI-native embedding database
Current Version: 0.6.3
Deploy and Host ChromaDB on Railway
ChromaDB is the AI-native open-source embedding database that makes it easy to build AI applications with embeddings. ChromaDB is designed to be easy, fast and effecient and is optimized for managing high-dimensional vector data with built-in distance functions and metadata filtering.
About Hosting ChromaDB
Hosting ChromaDB provides you with a powerful embedding database which is capable of handling vector-data, similarity searches and metadata filtering at scale. ChromaDB excels at semantic search, similarity matching and retrieval-agumented generation (RAG) workflows.
ChromaDB deployments on Railway benefit from scalable CPU, RAM and storage while supporting enterprise-grade network security through built-in token authentication and Railway's secure private network features. Railway provides automated deployment and comprehensive logging to support your AI application operations.
Common Use Cases
- Retrieval-Augmented Generation (RAG): Store tokenized knowledge, search-results and other data that AI applications can use for better contextual understanding and personalized responses.
- Semantic Search Applications: Powers search engines and applications that seek to find patterns that match not just similarity but meaning, leading to powerfull and relevant results.
- Recommendation Systems: Build strong recommendation engines for e-commerce, content platforms, and social media that suggest items and media based on user preferences.
- AI Agent Memory: Serve long-term persistent memory to AI agents, which helps agents remember past interactions, learned preferences and contextual information.
Dependencies for ChromaDB Hosting
chromadb
: The core ChromaDB Python packageuvicorn
: ASGI server for running the ChromaDB HTTP server
Deployment Dependencies
- The official ChromaDB image: https://hub.docker.com/r/chromadb/chroma
- The GitHub repo for ChromaDB: https://github.com/chroma-core/chroma
Implementation Details
Authentication Configuration
This ChromaDB template uses token authentication by default as specified in the CHROMA_SERVER_AUTHN_PROVIDER
service variable. A secure token is automatically generated and stored in the CHROMA_SERVER_AUTHN_CREDENTIALS
service variable.
The authentication system provides secure access to your vector database, ensuring that only authorized applications can read from or write to your collections.
Network Configuration
The template is configured to work with both public and private networking:
- Public Access: Available through the
CHROMA_PUBLIC_URL
service variable for external connections - Private Network: Recommended for production use through the
CHROMA_PRIVATE_URL
service variable within Railway's private network
To enable private network access, set CHROMA_HOST_ADDR
to ::
on the ChromaDB service.
Quick Start Guide
Here's a super quick rundown of how to use this template.
Assuming we have this template deployed and we have another NodeJS service next to it that we want to use to connect to ChromaDB. You can easily connect by doing the following:
Setting Up Service Variables
In your client application service, create the following service variables:
CHROMA_TOKEN="${{Chroma.CHROMA_SERVER_AUTHN_CREDENTIALS}}"
CHROMA_URL="${{Chroma.CHROMA_PUBLIC_URL}}"
> Note: This assumes the ChromaDB service name wasn't changed from "Chroma".
Creating a Client Connection
In your application, add the following code to connect to ChromaDB:
import { ChromaClient } from "chromadb";
const chroma = new ChromaClient({
path: process.env.CHROMA_URL,
auth: {
provider: "token",
credentials: process.env.CHROMA_TOKEN,
tokenHeaderType: "AUTHORIZATION"
}
});
// Example: Create a collection and add embeddings
const collection = await chroma.createCollection({
name: "my_collection"
});
await collection.add({
ids: ["id1", "id2"],
embeddings: [[1.2, 2.3, 4.5], [6.7, 8.9, 1.2]],
metadatas: [{"source": "doc1"}, {"source": "doc2"}],
documents: ["This is document 1", "This is document 2"]
});
> Note: Ensure you have the chromadb
package installed in your application dependencies.
Private Network Connection
For production deployments, use Railway's private network for enhanced security:
- Set
CHROMA_HOST_ADDR
to::
in your ChromaDB service - Update your client service variables to use the private URL:
CHROMA_URL="${{Chroma.CHROMA_PRIVATE_URL}}"
Why Deploy ChromaDB on Railway?
Railway is a singular platform to deploy your AI infrastructure stack. Railway will host your vector database so you don't have to deal with configuration complexities, while allowing you to scale vertically based on your embedding storage and query needs.
By deploying ChromaDB on Railway, you are one step closer to supporting a complete AI application stack with minimal operational burden. Host your embedding database, AI platforms, application servers, and more on Railway to build powerful semantic search and RAG applications.
Template Content