---
title: "Deploy FerretDB"
description: "Open Source MongoDB drop-in replacement"
category: "Storage"
url: https://railway.com/deploy/cMeXM0
---

# Deploy FerretDB

Open Source MongoDB drop-in replacement

**[Deploy FerretDB on Railway](https://railway.com/template/cMeXM0)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/cMeXM0/manifest.json

- **Creator:** Ju Li's Projects
- **Category:** Storage
- **Total deploys:** 16

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/ferretdb/postgres-documentdb:16

### FerretDB

- **Image:** ghcr.io/ferretdb/ferretdb:2

## Documentation

FerretDB is an open-source alternative to MongoDB.
It is a proxy that converts MongoDB 5.0+ wire protocol queries to SQL and uses PostgreSQL with [DocumentDB extension](https://github.com/microsoft/documentdb) as a database engine.

## Connecting to FerretDB

FerretDB is a drop-in replacement for MongoDB so you can simply construct a mongodb connection string like this: `mongodb://{{postgres_username}}:{{postgres_password}}@{{railway_tcp_url}}:{{railway_tcp_port}}/`

For `{{postgres_username}}` and `{{postgres_password}}`, they are autogenerated by the Postgres service deployed by the template.

For `{{railway_tcp_url}}` and `{{railway_tcp_port}}`, they are autogenerated by the FerretDB service deployed by the template.


## Why do we need FerretDB?

MongoDB was originally an eye-opening technology for many of us developers, empowering us to build applications faster than using relational databases.
In its early days, its ease-to-use and well-documented drivers made MongoDB one of the simplest database solutions available.
However, as time passed, MongoDB abandoned its open-source roots;
changing the license to [SSPL](https://www.ferretdb.com/sspl) - making it unusable for many open-source and early-stage commercial projects.

Most MongoDB users do not require any advanced features offered by MongoDB;
however, they need an easy-to-use open-source document database solution.
Recognizing this, FerretDB is here to fill that gap.

## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/cMeXM0
