ferretdb

ferretdb

Official

Docker app from llalon's Repository

Overview

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 as a database engine.

FerretDB

[!TIP] Looking for FerretDB v1? It is there.

Go Reference

Go codecov

Security Packages Docs

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 as a database engine.

flowchart LR
  A["Any application<br>Any MongoDB driver"]
  F{{FerretDB}}
  P[(PostgreSQL<br>DocumentDB extension)]

  A -- "MongoDB protocol<br>BSON" --> F
  F -- "PostgreSQL protocol<br>SQL" --> P

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 - 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.

Scope and current state

FerretDB is compatible with MongoDB drivers and popular MongoDB tools. It functions as a drop-in replacement for MongoDB 5.0+ in many cases. Features are constantly being added to further increase compatibility and performance.

We welcome all contributors. See our public roadmap, lists of known differences and supported commands, and contributing guidelines.

Quickstart

Run this command to start FerretDB with PostgreSQL, make sure to update <username> and <password>:

docker run -d --rm --name ferretdb -p 27017:27017 \
  -e POSTGRES_USER=<username> \
  -e POSTGRES_PASSWORD=<password> \
  ghcr.io/ferretdb/ferretdb-eval:2

This command will start a container with FerretDB, pre-packaged PostgreSQL with DocumentDB extension, and MongoDB Shell for quick testing and experiments. However, it is unsuitable for production use cases because it keeps all data inside and loses it on shutdown. See our installation guides for instructions that don't have those problems.

With that container running, you can:

  • Connect to it with any MongoDB client application using the MongoDB URI mongodb://<username>:<password>@127.0.0.1:27017/.
  • Connect to it using the MongoDB Shell by just running mongosh. If you don't have it installed locally, you can run docker exec -it ferretdb mongosh.
  • For PostgreSQL, connect to it by running docker exec -it ferretdb psql -U <username> postgres.

You can stop the container with docker stop ferretdb.

We also provide binaries and packages for various Linux distributions. as well as Go library package that embeds FerretDB into your application. See our documentation for more details.

Building and packaging

[!NOTE] We advise users not to build FerretDB themselves. Instead, use binaries, Docker images, or packages provided by us.

FerretDB could be built as any other Go program, but a few generated files and build tags could affect it. See there for more details.

Managed FerretDB at cloud providers

Community

If you want to contact FerretDB Inc., please use this form.

Install Ferretdb on Unraid in a few clicks.

Find Ferretdb in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for Ferretdb Review the template variables and paths Click Install

Requirements

Postgresql database installed and database+user created for ferretdb.

Defaults to ferretdb/ferretdb

Categories

Download Statistics

19,798
Total Downloads
576
This Month
704
Avg / Month

Total Downloads Over Time

Loading chart...

Related apps

Explore more like this

Explore all

Details

Repository
ghcr.io/ferretdb/ferretdb:2
Last Updated2025-11-10
First Seen2026-03-07

Runtime arguments

Network
bridge
Shell
sh
Privileged
false

Template configuration

Postgresql Database URLVariable

Full URL for the postgresql database

Target
FERRETDB_POSTGRESQL_URL
Default
postgres://ferretdb:password@127.0.0.1:5432/ferretdb
FerretDB PortPorttcp

Port for FerretDB

Target
27017
Default
27017
Value
27017