Deploy FerretDB (MongoDB Alternative)
Open-source MongoDB alternative. FerretDB 2.x + Postgres DocumentDB.
ferretdb
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host FerretDB (MongoDB Alternative) on Railway
FerretDB is the truly open-source MongoDB alternative. It speaks the MongoDB wire protocol — so your existing drivers, Mongoose/Prisma code, mongosh, and Compass keep working — while storing data in reliable PostgreSQL with Microsoft's DocumentDB extension. No SSPL license worries, no vendor lock-in, real Postgres durability underneath.
About Hosting FerretDB (MongoDB Alternative)
This template deploys the full FerretDB 2.x stack in one click: a PostgreSQL 17 instance with the DocumentDB extension (the storage engine FerretDB 2.x requires) on a persistent Railway volume, plus the FerretDB proxy wired to it over Railway's private network. A strong database password is auto-generated at deploy time, and a public TCP endpoint is exposed on the MongoDB port (27017) so you can connect from anywhere. Grab your connection string from the ferretdb service and you're live in about a minute.
Connect from your app:
mongodb://:@:/
Find the TCP proxy domain/port on the ferretdb service → Settings → Public Networking. The user and password are on the Postgres service variables. Apps deployed inside the same Railway project can use the private hostname ferretdb.railway.internal:27017 instead — free, faster, and never leaves Railway's network.
Common Use Cases
- Drop-in MongoDB replacement for Node.js/Express, NestJS, Python, or Go apps using standard MongoDB drivers
- Escaping MongoDB Atlas pricing or the SSPL license while keeping your existing codebase unchanged
- New projects that want a document API with battle-tested PostgreSQL storage and backups underneath
Dependencies for FerretDB (MongoDB Alternative) Hosting
- PostgreSQL 17 with the DocumentDB extension (included as the
Postgresservice in this template) - Persistent Railway volume for the database files (included, mounted at
/var/lib/postgresql/data)
Deployment Dependencies
Implementation Details
The ferretdb service connects to Postgres via:
FERRETDB_POSTGRESQL_URL=postgres://user:pass@postgres-private-domain:5432/postgres
Authentication uses your PostgreSQL credentials over SCRAM — the same POSTGRES_USER / POSTGRES_PASSWORD pair works as your MongoDB username/password. Both images are the official FerretDB 2.7.0 releases published on GitHub Container Registry.
Why Deploy FerretDB (MongoDB Alternative) 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 FerretDB (MongoDB Alternative) 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