FerretDB (previously MangoDB) was founded to become the de-facto open-source substitute to MongoDB. FerretDB is an open-source proxy, converting the MongoDB 6.0+ wire protocol queries to SQL - using PostgreSQL as a database engine.
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 database solution. Recognizing this, FerretDB is here to fill that gap.
Scope and current state
FerretDB will be compatible with MongoDB drivers and will strive to serve as a drop-in replacement for MongoDB 6.0+.
These steps describe a quick local setup. They are not suitable for most production use-cases because they keep all data inside containers and don't encrypt incoming connections. For more configuration options check Configuration flags and variables page.
Store the following in the
version: "3" services: postgres: image: postgres container_name: postgres ports: - 5432:5432 environment: - POSTGRES_USER=username - POSTGRES_PASSWORD=password - POSTGRES_DB=ferretdb ferretdb: image: ghcr.io/ferretdb/ferretdb:latest container_name: ferretdb restart: on-failure ports: - 27017:27017 environment: - FERRETDB_POSTGRESQL_URL=postgres://postgres:5432/ferretdb networks: default: name: ferretdb
postgrescontainer runs PostgreSQL that would store data.
Fetch the latest version of FerretDB with
docker compose pull. Afterwards start services with
docker compose up -d.
If you have
mongoshinstalled, just run it to connect to FerretDB. It will use credentials passed in
mongoshflags or MongoDB URI to authenticate to the PostgreSQL database. You'll also need to set
PLAIN. The example URI would look like:
See Security#Authentication for more details.
If you don't have
mongosh, run the following command to run it inside the temporary MongoDB container, attaching to the same Docker network:
docker run --rm -it --network=ferretdb --entrypoint=mongosh mongo "mongodb://username:password@ferretdb/ferretdb?authMechanism=PLAIN"
You can also install with FerretDB with the
provided for each release.
Building and packaging
We strongly advise users not to build FerretDB themselves.
Instead, use Docker images or .deb and .rpm packages provided by us.
If you want to package FerretDB for your operating system or distribution,
the recommended way is to use the
see our instructions for contributors for more details.
FerretDB could also be built as any other Go program,
but a few generated files and build tags could affect it.
See there for more details.
- Website and blog: https://ferretdb.io.
- Twitter: @ferret_db.
- Mastodon: @email@example.com.
- Slack chat for quick questions.
- GitHub Discussions for longer topics.
- GitHub Issues for bugs and missing features.
- Open Office Hours meeting every Monday at 18:00 UTC at Google Meet.
If you want to contact FerretDB Inc., please use this form.