MongoDB
Tick MongoDB on an app and it gets its own database name on the server's shared MongoDB. Here is exactly what that gives you, what it doesn't cover yet, and when a dedicated instance makes more sense.
What you get
- MongoDB 7 (mongo:7), shared on the server: each app gets its own database name (app_<id>) on that instance, exposed as MONGODB_URL and the MONGODB_URI, MONGO_URL, MONGOLAB_URI and MONGOHQ_URL aliases some frameworks expect.
- Unlike Postgres and MySQL, the shared add-on doesn't create a separate login per app yet; isolation is by database name and the server's private network, not by per-app credentials.
- Not part of the scheduled backup pipeline, that covers Postgres, MySQL and ClickHouse. Moving an app to a database server copies its MongoDB data across as a one-time step.
- No point-in-time recovery or automatic failover for the shared add-on; those cover Postgres (PITR) or Postgres, MySQL and Redis (standby failover).
- Apps that need a real replica set, for change streams, get their own dedicated MongoDB container as part of a stack instead of the shared add-on, because a single shared instance can't offer that.
How to add it
- 1
Tick MongoDB when you create the app
On New app, or later from Edit → Add-ons, check MongoDB and deploy. Railyard injects MONGODB_URL (and its aliases) before the build runs.
- 2
Or add it from the CLI
railyard apps create <name> <git-url> --addons mongodb does the same thing from a terminal.
- 3
Reaching it from outside your apps
Trusted addresses, the TCP proxy for connecting from your own machine, currently covers Postgres, MySQL, ClickHouse, Redis and RabbitMQ. MongoDB isn't on that list yet, so query it from another app on the same server or team network, or over SSH to the server itself.
A one-click example
LibreChat deploys its own single-node MongoDB replica set alongside the app, the pattern Railyard uses whenever an app needs change streams rather than the shared add-on. Rocket.Chat does the same thing for team chat.
Or deploy a standalone instance deploys a standalone MongoDB instance with a generated root user and password, if that's all you need.