
Deploy MongoDB Atlas Local | (Just Updated) Atlas Search + Vector Search, Auth On
Atlas Search + Vector Search on MongoDB 8, auth on, data kept
mongodb-atlas-local
Just deployed
/data
Deploy and Host MongoDB Atlas Local on Railway
MongoDB Atlas Local is the official MongoDB image that bundles the database with the Atlas Search engine (mongot). It gives you $search full-text queries and $vectorSearch similarity queries on your own Railway project, the same aggregation stages you would use on MongoDB Atlas. This template runs it as a single digest-pinned service, with the database port on a Railway TCP proxy and a Railway volume holding the data.
About Hosting MongoDB Atlas Local
- Atlas Search and Vector Search work out of the box. Create a search index with
createSearchIndexand query it with$searchor$vectorSearch. Verified on a live deploy: a text index and a cosine vector index both reached READY and returned the expected documents. - Authentication is on from the first connection. A root user named
adminis created at first boot with a password generated per deploy. Connections with a wrong password are refused. - Your data survives redeploys. The data, config and search directories live on a Railway volume mounted at
/data. The server runs as root so the root-owned volume is writable, and the deploy log prints the user id and mount owner. - Two ways in. Services in the same project use the private URL; clients elsewhere use the TCP proxy URL. Both include
directConnection=true, which this single-node replica set requires.
Common Use Cases
- Building retrieval-augmented generation (RAG) apps with
$vectorSearchon embeddings - Adding full-text search to a MongoDB application without running Elasticsearch
- A staging database that behaves like MongoDB Atlas, for apps you will later move to Atlas
- Prototyping hybrid search (text plus vector) from your laptop with a driver
Dependencies for MongoDB Atlas Local Hosting
- One Railway volume for the data directory (created by the template)
Deployment Dependencies
- Atlas Local documentation: https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local/
- Official image: https://hub.docker.com/r/mongodb/mongodb-atlas-local
Implementation Details
| Variable | Purpose |
|---|---|
MONGO_PASSWORD | Password of the admin user, generated per deploy. |
MONGO_PRIVATE_URL | Connection string on the private network, for services in the same project. |
MONGO_PUBLIC_URL | Connection string on the TCP proxy, for clients outside Railway. |
The image does not include mongosh; connect with mongosh "$MONGO_PUBLIC_URL" from your machine or with any driver, for example:
from pymongo import MongoClient
client = MongoClient(PUBLIC_URL)
client.test.docs.create_search_index({"name": "txt", "definition": {"mappings": {"dynamic": True}}})
Why Deploy MongoDB Atlas Local 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 MongoDB Atlas Local 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.
Template Content
mongodb-atlas-local
mongodb/mongodb-atlas-local:8.0