Self-host FerretDB with Levelrail
A MongoDB compatible database that stores documents in PostgreSQL. Runs FerretDB with a bundled PostgreSQL that has the DocumentDB extension, a persistent volume and a generated password. It is not published on the host, so reach it from other services in this project at ferretdb:27017.
- AuthorFerretDB
- LicenceApache-2.0
- Memory512 MiB
- Services2
How to self-host FerretDB
-
Pull the images
2 images are pulled on your server.
Show images
ghcr.io/ferretdb/ferretdb:2.7.0ghcr.io/ferretdb/postgres-documentdb:17-0.107.0-ferretdb-2.7.0
-
Create the app
2 services start in a single Compose app, with 1 named volume mount for your data, on port 27017.
-
Fill in the secrets
2 secrets are generated and stored encrypted, 3 settings are preset, you do not have to fill in anything.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
After the first start
- Read the generated password from the app secrets, then connect with a MongoDB client as the ferretdb user from a service in the same project.
FerretDB requirements
- Memory
- About 512 MiB
- Architectures
- amd64 unknown, arm64 unknown
- Ports
- 27017
- Domain
- Optional, an sslip.io address is used without one
- Settings
- none to fill in
- License
- Apache-2.0, permissive license
- Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then FerretDB. New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the FerretDB docs page.
Deploy FerretDB your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy FerretDB from the CLI
levelrail-cli templates deploy ferretdb --name my-ferretdb Deploy FerretDB with the API
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://levelrail.example.com/api/v1/service-templates/ferretdb/deploy FerretDB configuration
FerretDB services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| ferretdb | ghcr.io/ferretdb/ferretdb:2.7.0 | 27017 | none |
| postgres | ghcr.io/ferretdb/postgres-documentdb:17-0.107.0-ferretdb-2.7.0 | none | pgdata -> /var/lib/postgresql/data |
FerretDB environment variables
| Variable | Service | Value |
|---|---|---|
| FERRETDB_POSTGRESQL_URL | ferretdb | Generated at deploy |
| FERRETDB_TELEMETRY | ferretdb | Preset by the template |
| POSTGRES_DB | postgres | Preset by the template |
| POSTGRES_PASSWORD | postgres | Generated at deploy |
| POSTGRES_USER | postgres | Preset by the template |
Ports and volumes
- Ports
- 27017
- Volumes
- 1 named mount: pgdata -> /var/lib/postgresql/data
FerretDB FAQ
How much memory does FerretDB need?
The catalog lists about 512 MiB of memory for FerretDB across its 2 services.
Does FerretDB run on arm64?
For FerretDB, arm64 support is not confirmed; amd64 is unknown.
What licence is FerretDB under?
FerretDB is licensed under Apache-2.0, which is permissive, with few conditions on reuse.
Does FerretDB need configuration before it starts?
No. The template fills in its own defaults and generates secrets at deploy time.
Which database does FerretDB bundle?
The template includes Postgres, running as its own service.
Which ports does FerretDB use?
FerretDB listens on port 27017 inside the stack.
Where does FerretDB keep its data?
In a named volume: pgdata mounted at /var/lib/postgresql/data.
Can I deploy FerretDB on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for FerretDB, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image ghcr.io/ferretdb/ferretdb:2.7.0, ghcr.io/ferretdb/postgres-documentdb:17-0.107.0-ferretdb-2.7.0 is what you deploy there.