// Bitnami alternatives / mongodb
Bitnami MongoDB alternative
Replacing bitnamilegacy/mongodb
The bitnamilegacy/mongodb image has had about 4.1 million pulls since Bitnami moved it to the legacy repository, and it receives no updates. Switching to the official mongo image means changing environment variables and the data path. Get either wrong and the new container starts empty.
Trusted globally by enterprises




Bitnami MongoDB variables and their official equivalents
Bitnami MongoDB image to official mongo:
| Setting | Bitnami | Official image |
|---|---|---|
| Root user | MONGODB_ROOT_USER | MONGO_INITDB_ROOT_USERNAME |
| Root password | MONGODB_ROOT_PASSWORD | MONGO_INITDB_ROOT_PASSWORD |
| Initial database | MONGODB_DATABASE | MONGO_INITDB_DATABASE |
| App user | MONGODB_USERNAME / MONGODB_PASSWORD | Create in an init script |
| Data path | /bitnami/mongodb | /data/db |
What breaks when you switch
- The official image only creates the root user. Bitnami's app-user variables have to become a script in /docker-entrypoint-initdb.d.
- Replica set variables (MONGODB_REPLICA_SET_*) have no official equivalent.
- Official images for MongoDB 5.0 and later need a CPU with AVX, and the image warns at start-up when it is missing.
bitnami/mongodb Helm chart values the drop-in image reads
With architecture set to replicaset, the bitnami/mongodb chart runs its own setup script before mongod starts. The script sources /opt/bitnami/scripts/mongodb-env.sh, exports MONGODB_REPLICA_SET_MODE as primary or secondary, and then executes /opt/bitnami/scripts/mongodb/entrypoint.sh. In 10.x and early 11.x releases the role comes from the pod name. Later releases, including 12.x and 13.x, ask the running members for the current primary with mongosh. The official mongo image has none of those scripts. The OSSeva image keeps them. Checked against chart 10.31.5 (MongoDB 4.4) and 13.18.5 (MongoDB 6.0).
| Chart value | What the chart passes to the container |
|---|---|
| architecture | standalone (the default) or replicaset |
| auth.rootUser, auth.rootPassword | MONGODB_ROOT_USER, MONGODB_ROOT_PASSWORD |
| auth.usernames, auth.passwords, auth.databases | MONGODB_EXTRA_USERNAMES, MONGODB_EXTRA_PASSWORDS, MONGODB_EXTRA_DATABASES (chart 8.x used a single auth.username for MONGODB_USERNAME) |
| auth.replicaSetKey | MONGODB_REPLICA_SET_KEY |
| replicaSetName | MONGODB_REPLICA_SET_NAME, rs0 by default |
| replicaSetHostnames | MONGODB_ADVERTISED_HOSTNAME set to the pod's DNS name (true by default) |
| persistence.mountPath | Data volume at /bitnami/mongodb |
MongoDB versions OSSeva publishes
Each line below has a patched OSSeva image. The second column shows which bitnami/mongodb chart releases defaulted to that line, which tells you the chart major to stay on during the swap.
| Version line | Bitnami chart releases |
|---|---|
| MongoDB 4.2 | bitnami/mongodb later 7.x and 8.x |
| MongoDB 4.4 | bitnami/mongodb 9.x to 11.x |
| MongoDB 5.0 | bitnami/mongodb 12.x |
| MongoDB 6.0 | bitnami/mongodb 13.x |
Replication and high availability in the MongoDB charts
A replicaset install runs replicaCount data-bearing members (2 by default) plus an arbiter, which is on by default. The arbiter and any hidden members (hidden.enabled) run from the same image value, so they move with the swap.
MONGODB_INITIAL_PRIMARY_HOST points at the <release>-0 pod, which initiates the set on first install. From later 11.x releases the setup script also checks which member is primary at every start and configures the pod against it, rather than assuming <release>-0.
Chart 14.x moves to MongoDB 7.0. MongoDB upgrades one major version at a time, raising featureCompatibilityVersion at each step, so a 4.4 deployment cannot jump straight to a current chart.
What happened to the Bitnami MongoDB image
For years, bitnami/mongodb on Docker Hub was one of the most common ways to deploy MongoDB on Kubernetes, usually through the Bitnami MongoDB Helm chart. On 28 August 2025 Broadcom moved every versioned Bitnami container image, including this one, to the bitnamilegacy repository, and removed the public docker.io/bitnami catalog on 29 September 2025. The free tier now offers only latest tags of a limited set of images for development.
The legacy Docker image still pulls, so existing deployments keep working. It no longer receives updates, which means every vulnerability disclosed since the move stays open in the MongoDB binary, in the base image and in every bundled dependency. Container scanners will report a growing count at every audit, and a workload that depends on a frozen public repository is one registry change away from ImagePullBackOff.
How to migrate MongoDB off Bitnami safely
- Find every reference to bitnami/mongodb and bitnamilegacy/mongodb in running workloads, Helm values files and CI pipelines, including init containers.
- Record the MongoDB version each deployment pins. Versions past upstream end of life are not covered by the free open source images.
- Take a backup and test a restore before touching a stateful workload.
- Mirror the replacement container images into your own registry, and scan them before you deploy.
- Move one replica or one environment at a time, and confirm the data path, file ownership and credentials on the new image.
- Remove every remaining legacy reference so nothing falls back to the archive on the next deploy.
Your options
OSSeva drop-in image
A patched image that keeps Bitnami's variables, paths and user, covering MongoDB 4.2 to 6.0, including hardware without AVX. Your chart keeps working after a registry change.
Official mongo image
Free and maintained for current versions. Apply the mapping above and move the volume.
Bitnami Secure Images
Broadcom's paid catalog keeps the Bitnami layout for supported versions, sold within TrueSource.
Repoint the Bitnami MongoDB Helm chart
- Run helm list to record the chart version, then helm get values <release> to save what is deployed.
- Keep that chart major: 13.x for 6.0, 12.x for 5.0, 9.x to 11.x for 4.4.
- Override image.registry, image.repository and image.tag on the same MongoDB minor version. The arbiter and hidden members pick up the same image.
- Leave out global.security.allowInsecureImages. Bitnami added that image check in December 2024 (mongodb 16.4.0), and every chart for MongoDB 6.0 and earlier is older.
- Run helm upgrade with --reuse-values and the override, then run rs.status() in mongosh and confirm every member reports a healthy state.
# values-osseva.yaml
# helm upgrade my-mongodb oci://registry-1.docker.io/bitnamicharts/mongodb \
# --version 13.18.5 --reuse-values -f values-osseva.yaml
image:
registry: registry.example.com # OSSeva registry or your mirror of it
repository: mongodb
tag: "<6.0.x tag>"
global:
imagePullSecrets:
- registry-credentialsThis works only with an image that keeps Bitnami's layout. With the official image, rewrite the chart or move to an operator. See replacing bitnamilegacy images for the full inventory and rollout steps.
Frequently asked questions
What is the best alternative to the Bitnami MongoDB image?
To keep the Bitnami MongoDB Helm chart unchanged, use a Bitnami-compatible image; OSSeva ships patched ones covering MongoDB 4.2 to 6.0, including hardware without AVX. To rewrite the deployment, use the official mongo image.
Is bitnamilegacy/mongodb still getting security updates?
No. Bitnami moved versioned images to the bitnamilegacy repository on 28 August 2025 and describes it as receiving no further updates. It had about 4.1 million pulls by September 2026.
Can I keep using the Bitnami MongoDB Helm chart?
Yes, with a maintained image that keeps Bitnami's layout. Set image.registry and image.repository in your values file, and set global.security.allowInsecureImages to true, because recent Bitnami charts refuse non-Bitnami images otherwise.
Is Bitnami no longer free?
Not for production. Since 28 August 2025, versioned Bitnami images live in the bitnamilegacy repository with no updates, and the free tier offers latest tags of a limited set of images for development. Maintained, versioned images are sold as Bitnami Secure Images, which Broadcom prices by quote.
Where does the Bitnami MongoDB image store data?
Under /bitnami/mongodb. The official image uses /data/db, so the volume mount must change when you switch images.
Keep your MongoDB chart. Change the image.
Send us your image list and versions; we reply with coverage and a migration plan within five working days.