Railway

Deploy DocumentDB

This template deploys the latest official DocumentDB image on Railway.

Deploy DocumentDB

/home/documentdb/postgresql

Deploy and Host DocumentDB on Railway

DocumentDB is a powerful, scalable, MongoDB-compatible open-source document database built on PostgreSQL.

You can connect just like you would with MongoDB:

from pymongo import MongoClient, AsyncMongoClient

mongo_client: MongoClient = MongoClient(MONGO_URL)

Set the environment variable:

MONGO_URL=${{documentdb.PRIVATE_URL}}

If you prefer, you can also use:

MONGO_URL=${{documentdb.URL}}

⚠️ Note: Using the public URL incurs egress costs. The PRIVATE_URL avoids this when used inside Railway’s network.


About Hosting DocumentDB

Deploying DocumentDB on Railway involves:

  • Creating a service (DocumentDB instance)
  • Attaching a volume for persistent storage

This setup ensures your data remains safe and accessible across deployments.


Connect via MongoDB Compass or Mongosh

You can connect directly using the URL environment variable:

  1. Copy the value of ${{documentdb.URL}}.
  2. Paste it into MongoDB Compass or Mongosh connection input.

That’s it—you’ll be connected to your DocumentDB instance.


Template Content

More templates in this category

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

PROJETOS
View Template
Postgres Backup to Cloudflare R2 (S3-Compatible)
Automated PostgreSQL backups to S3-compatible storage with encryption

Artour
View Template
ReadySet
A lightweight caching engine for Postgres

Milo