Moving Rocket.Chat from Bitnami MongoDB to the official MongoDB image

If your Rocket.Chat runs on rocketchat-compose with the Bitnami MongoDB 6.0 container, this page explains how to move the database to the official image safely, and what the work needs from your team.

On this page

Why Bitnami MongoDB 6.0 deployments need to move to the official image

If your Docker Compose Rocket.Chat install still runs the Bitnami MongoDB 6.0 container, the move is a contained change to the database container and its data volume, not a re-platform. Rocket.Chat's own guidance is that Bitnami MongoDB images are no longer maintained, so the database container should be replaced with the official mongodb-community-server image. Deployments that point Rocket.Chat at an external MongoDB server are not affected and can skip this work.

The change itself is narrow. The data volume path moves from /bitnami/mongodb to /data/db, and the rocketchat-compose 2.0.0 files add replica set initialization, permission-fixing containers and healthchecks. Before you edit anything, confirm which compose release you run, which MongoDB version your data was created under, and whether you have a tested backup you can restore from. Those three answers determine how much of the compose file changes.

The database image change should not be planned on its own. Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, and Rocket.Chat recommends three members for high availability. A MongoDB 6.0 container is therefore not a stable endpoint if you plan to upgrade Rocket.Chat, so decide early whether this move is a stepping stone to a newer MongoDB or the final state for your current Rocket.Chat line. Check the Rocket.Chat system requirements for the version pairing before you pick a target.

If you run an older Rocket.Chat line, also check its support window in Rocket.Chat's version durability documentation, since an end-of-life release stops receiving fixes whatever the database image. Treat the database move and any Rocket.Chat version change as one plan with a clear order, so a failed step does not leave you with an unsupported server and an unknown data state.

Which deployments this change applies to

This is the deployment the change is written for. If your Rocket.Chat runs from the rocketchat-compose project and its MongoDB service uses the Bitnami image pinned to MongoDB 6.0, the Bitnami image is no longer maintained and you should plan the move to the official mongodb-community-server image. The change replaces the database container and its data volume path, so it touches stored data and needs a verified backup first.

  • Image in use: Look for a bitnami/mongodb image reference in your compose file or running containers.
  • Data path: The volume is mounted at /bitnami/mongodb, which moves to /data/db in the new image.
  • Compose version: Older files predate rocketchat-compose 2.0.0, which adds replica set initialization, permission-fixing containers and healthchecks.
  • Replica set state: Confirm how your current MongoDB runs and whether it already operates as a replica set, because Rocket.Chat 8.x requires one.
  • Target version: Check which Rocket.Chat line you run, since the database requirements differ between lines.

Confirm the image reference and volume mount in your own files before you rely on this page.

What carries over and what changes in the move

This table compares the Bitnami MongoDB container setup with the official mongodb-community-server image across the areas the move touches. Read each row as a checkpoint: what changes in your compose file, what stays in the data, and what you must confirm before cutover.

AreaBitnami MongoDB 6.0 setupOfficial MongoDB image after the move
Data volume pathData stored under /bitnami/mongodbData stored under /data/db
Databases and collectionsRocket.Chat database and collections on the volumeCarry over when the existing volume is preserved and mounted at the new path
Replica set initializationSet up by the older compose file; check it against your current fileInitialized by rocketchat-compose 2.0.0 as part of the new setup
File permissionsOwnership handled by the Bitnami image conventionsPermission-fixing container added in rocketchat-compose 2.0.0; confirm ownership on the volume after the first start
HealthchecksDepends on your existing compose file, often noneAdded in rocketchat-compose 2.0.0; use them to confirm the database is ready before Rocket.Chat starts
Rocket.Chat application dataUsers, messages, settings and uploads referenced by the appUnchanged in the database; uploads depend on where file storage is configured, so verify separately
MongoDB version compatibilityBitnami 6.0 imageConfirm the MongoDB version against the Rocket.Chat version you run before cutover

How to switch the database container without losing messages

This sequence moves a Bitnami MongoDB 6.0 data volume onto the official MongoDB image and rocketchat-compose 2.0.0, with a verified backup and a rollback path if the switch fails.

  1. Confirm current versions and release

    Record the Rocket.Chat release, the rocketchat-compose version, and the Bitnami MongoDB 6.0 tag your stack runs, and check the compose file for the current data volume path. Confirm the target Rocket.Chat release supports the MongoDB version you will run, since Rocket.Chat 8.x requires MongoDB 8.0 or later as a replica set. Done when you have a written inventory that your change record can reference.

  2. Take a verified backup

    Back up the MongoDB data and the compose configuration files before changing anything, following the backup procedure in the official guide. Keep the copy outside the Docker volume being replaced, and confirm the archive is readable by restoring it to a scratch location or listing its contents. Done when the backup exists in a second location and the restore check has passed.

  3. Stop the running stack

    Stop the Rocket.Chat and MongoDB containers cleanly using the stop command in the official guide so no writes are in flight during the switch. Confirm no containers from the stack are still running. Done when the stack is down and the data volume is no longer in use.

  4. Account for the volume path change

    Note that the data directory moves from /bitnami/mongodb to /data/db in the official image. Confirm how your existing data maps onto the new path as the guide describes, and plan the file ownership check that the new permission-fixing containers handle. Done when you can state which host directory feeds the new path and who owns the files.

  5. Update to rocketchat-compose 2.0.0

    Replace the compose files with rocketchat-compose 2.0.0 and apply any local edits (domain, ports, environment values) to the new files, following the guide's list of changes. This version adds replica set initialization, permission-fixing containers and healthchecks. Done when the compose files validate and differences from your old files are limited to the documented changes.

  6. Let replica set initialization run

    Start the MongoDB service first and allow the replica set initialization to complete before starting Rocket.Chat, as the guide describes. Watch the MongoDB healthcheck until it reports healthy. Done when the replica set reports a primary and the healthcheck is passing.

  7. Start the stack and verify messages

    Start the full stack, then check that Rocket.Chat loads, existing channels and direct messages show their history, uploaded files open, and users can sign in. Confirm the Rocket.Chat release in the administration panel matches the one recorded in step one. Done when the spot checks pass and the workspace reports the expected version.

  8. Keep the backup for rollback

    If verification fails, stop the stack, restore the backup taken in step two, and restart on the previous compose files as the official guide describes. Do not delete the backup until users have confirmed their history after the switch. Done when either the switch is accepted and the backup is archived, or the rollback restores the previous working state.

How to confirm the new database is healthy

Run these checks in order after the move to the official MongoDB image. Each one tests a different layer, from the replica set itself to the files users depend on, so a passing result in one does not hide a fault in another.

Replica set status

Open a shell in the MongoDB container and check that the set reports one PRIMARY member and that the node is healthy. Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, so a standalone instance or a node stuck in SECONDARY state is a failure even if the containers look up. Confirm the reported version matches what your Rocket.Chat release expects before moving on.

System requirements

Rocket.Chat connects to the database

Check the Rocket.Chat container logs after restart and confirm the server reaches the database without connection retries. A repeated error about the replica set name, an authentication failure or a timeout usually means the connection string or the new volume path was not carried over correctly. The application should reach a ready state and serve its web page without manual intervention.

Logins and existing conversations

Sign in with a known user account, then confirm that existing channels, direct messages and message history load with their original dates and authors. Missing history with a working login points to the wrong database name or a restore that landed in an empty database. Check at least one private group and one direct message thread, since those are the first places a partial restore shows.

Uploads still accessible

Open a file shared before the migration and check that it downloads, and confirm that avatars display. If you store uploads in the local file store, the Rocket.Chat container must still mount that path. Broken links after a successful database move usually mean the upload storage was not connected to the restored instance, so treat them as a separate fault to fix before cutover.

Compose healthchecks passing

Run docker compose ps and confirm that the MongoDB and Rocket.Chat services report healthy, not just running. The rocketchat-compose 2.0.0 file adds healthchecks, permission-fixing containers and replica set initialization, so a service stuck in starting or restarting shows where the setup failed. Review the permission-fixing container logs if the data directory is not writable.

Bitnami migration guide

Backup restore tested on a copy

Restore the new backup into a separate, non-production environment and repeat the login and history checks there. A backup that has never been restored is not proven. Confirm the restore completes, the replica set initializes and users can see their conversations. Record the steps so the next backup and restore follows the same procedure.

Questions teams ask before changing the database container

Does moving from the Bitnami MongoDB container to the official image require downtime?

Yes, plan for a maintenance window. The database container is stopped, its data is backed up, the volume path changes from /bitnami/mongodb to /data/db, and the database is brought back up under the new image. Users cannot send messages while Rocket.Chat is stopped. The length of the window depends on the size of the database and the files that must be copied, and on how long your team takes to verify the result before reopening the workspace. Confirm the window with your own staging test before scheduling production.

How long does the database container move take?

The duration is driven by factors you can measure in your own environment, not by a fixed number. The main drivers are the size of the MongoDB data directory, the speed of the backup storage, how many steps your team must rehearse, and how many Compose files and environment variables need editing. Run a rehearsal on a copy of the deployment to measure the backup and restore time, then size the maintenance window from that result with a margin for verification.

Can our own team make this change without a partner?

Yes, if your team already runs Docker Compose and can read MongoDB logs. The change is a sequence of backups, configuration edits and checks, and Rocket.Chat's guide documents the steps. The work is harder when the deployment has been customized, when no one has restored a MongoDB backup before, or when there is no tested rollback. Teams that want a second pair of hands usually ask for a written scope covering the rehearsal, the production change and the verification checklist.

What access and resources does the change need from our team?

You need shell access to the Docker host, permission to edit the Compose project and its environment files, and write access to backup storage with enough free space for a full database backup. You also need someone who can approve the maintenance window and an owner who can test logins, messages and file downloads afterward. If the deployment runs in your cloud account or data center, confirm that change approvals and snapshot procedures allow these steps before the window is booked.

Do we have to upgrade Rocket.Chat to 8.x at the same time?

No. The container move is a separate change from a Rocket.Chat major upgrade, and keeping them apart makes failures easier to diagnose. Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, so the upgrade needs its own database prerequisites and planning. Confirm which Rocket.Chat version and MongoDB version your deployment runs now, then read the upgrade guidance for your line before deciding the order of the two changes.

What should we do if the replica set fails to initialize?

Stop the stack, read the MongoDB container logs and the rocketchat-compose 2.0.0 initialization output before changing anything else. Common causes include the permission-fixing step not running on the new data path, a volume still pointing at the old /bitnami/mongodb location, or a leftover data directory from a failed attempt. Restore the backup to a clean volume if the state is unclear, and do not delete the original volume until the restored system passes checks. Escalate to the Rocket.Chat documentation or support when the logs do not explain the failure.

Does the change affect a deployment that uses an external MongoDB?

No. Rocket.Chat's guidance says deployments that use an external MongoDB are not affected by the Bitnami container change. The steps apply to Docker Compose users who run the Bitnami MongoDB 6.0 container from an older rocketchat-compose setup. Check your Compose file and environment settings first, because a deployment that points at a managed or self-hosted MongoDB service has no Bitnami container to replace.

What usually goes wrong during the volume change

The Bitnami to official image move looks small because the container swap is one line in a compose file. Most failures come from the data itself: the wrong path, ownership on the new volume, a backup nobody has restored, or an old data set that does not initialize cleanly as a replica set. Each card below names one failure and the check that prevents it.

Restoring into the wrong volume path

The data directory moves from /bitnami/mongodb to /data/db. If the backup is copied into the old path, or the new container still mounts the old volume name, MongoDB starts on an empty database and the instance appears to have lost its messages. Before starting the new stack, confirm the volume mapping in the compose file points the data volume at /data/db and that the restored files are in that volume. Check the database contents with a query before opening Rocket.Chat to users.

Migration guide

Permission errors on the data path

The official MongoDB image runs its process under its own user, so files copied in as root or under the Bitnami user can prevent mongod from writing its journal and data files at startup. The symptom is a container that restarts in a loop with permission denied messages in its logs. The rocketchat-compose 2.0.0 release adds a permission-fixing container for this case, so confirm that container runs before the database service starts, and check the logs of both containers on the first start.

A backup that was never test-restored

A dump or volume copy is only useful if it restores. Many teams take the backup, confirm the file exists, and proceed with the upgrade, then discover a truncated archive or missing files during the cutover window. Restore the backup into a separate throwaway environment with the new image, open the database, and count documents in the main collections. Keep the original volume untouched until the production instance has run cleanly for a period you have agreed with the business.

Replica set initialization failing on older data

Rocket.Chat 8.x requires MongoDB running as a replica set, and rocketchat-compose 2.0.0 initializes one on first start. An older data set that was never run as a replica set can fail that step, or the oplog may not match what the initialization expects. Read the initialization output in the logs and confirm the member reports as primary before starting Rocket.Chat. If it fails, resolve the error on the restored copy first rather than on the production volume.

Running an old Rocket.Chat version on MongoDB 8.0

Rocket.Chat 8.x requires MongoDB 8.0 or later. If the Rocket.Chat image is still on a 6.x or 7.x tag when the database moves to the newer engine, the application may fail to connect or behave unpredictably. Check the Rocket.Chat version and the system requirements for the release you plan to run before changing the database image, and plan the Rocket.Chat upgrade as its own step with its own backup. Confirm the target MongoDB version in the system requirements page instead of relying on the compose file default.

System requirements

Leftover Bitnami settings in the compose file

Bitnami images read their own environment variables, such as the MongoDB root and replica set settings, and a compose file copied forward can keep those names after the image changes. The official image ignores them, so a password or replica set setting you believed was applied may not be. Compare the environment block of the database service with the rocketchat-compose 2.0.0 file, remove Bitnami-only variables, and confirm authentication and replica set settings by querying the running server.

What drives the effort and cost of this change

The largest cost in this move is staff time, and most of it goes to backup, change control and verification rather than to the copy itself. Someone has to take and check a backup, schedule a maintenance window, switch the data volume path from /bitnami/mongodb to /data/db, bring up the rocketchat-compose 2.0.0 stack, and confirm that messages, users and uploads are intact. The size of the database and the uploads store sets how long each of those steps takes, because a larger dump takes longer to write, transfer and restore, and a larger upload set takes longer to verify. Ask the provider to state which of these steps are included in the fixed scope and which depend on your data size, rather than accepting a single lump-sum figure without that breakdown.

Two factors multiply the work. The first is the number of Rocket.Chat versions between your current release and the target, since each version step may need its own check of database compatibility and client connectivity. Rocket.Chat 8.x requires MongoDB 8.0 or later as a replica set, so a deployment that is also moving to 8.x adds a database prerequisite on top of the image change. The second is the number of customized compose files. Every local change to environment values, volumes, networks or reverse proxy settings must be reviewed against the 2.0.0 template, and each one that diverges adds merge and test effort. Confirm the version gap and the list of local compose edits before any quote is finalized.

The move itself is one-time. Ongoing cost is recurring: Rocket.Chat standard releases are supported for 6 months and LTS releases for 12 months, according to the vendor's version durability documentation, so the team must keep applying patches and upgrades after the move is finished. Ask for a written scope that names the restore test you expect (who restores, into which environment, and what is compared), the rollback plan if verification fails, and whether ongoing patching is priced separately. Also confirm that your team has a tested restore path. If no one has restored a backup of this deployment before, budget for that test as part of the work, because a backup that has never been restored is not yet evidence that the migration is safe.

Factors that raise or lower the effort

This table lists the factors that most change how much work the Bitnami MongoDB replacement takes, and what to confirm about each one before quoting or scheduling. Read each row against your own deployment, since a small single-server compose stack and a customized production stack with a reverse proxy differ mainly in these areas. The main takeaway is that the backup and staging copy steps are the cheapest places to reduce risk.

DriverEffect on effortWhat to confirm
Data volumeLarger databases take longer to back up, copy and verify, and extend the maintenance windowSize of the MongoDB data directory under /bitnami/mongodb and the expected restore time on your host
Rocket.Chat version gapA deployment far behind the current line may need an upgrade path before or after the database moveYour running Rocket.Chat image tag and whether that line still receives fixes
Customized compose file or reverse proxyHand-edited compose files need merging with the 2.0.0 changes, and proxy settings may need reviewWhether you changed the compose file, environment variables, networks or proxy routes
File storage locationUploads on local volumes need their own backup and permission checks, while external storage such as S3 adds a separate cutoverWhere uploads and avatars are stored and whether they are part of the same backup plan
Availability requirementsA stack that cannot tolerate downtime needs a planned window, rollback steps and user communicationAcceptable outage window, who approves it, and whether users depend on the server during the window
Access to a staging copyA tested staging run catches volume path and permission problems before production, while skipping it shifts risk to live usersWhether a non-production host with a copy of the data and the same compose version is available
External MongoDBDeployments using an external MongoDB are not affected by this change, so the work may not applyWhether your compose file actually runs a Bitnami MongoDB container

How the parts of the stack change during the move

The move starts with the existing Compose stack, where Rocket.Chat talks to a Bitnami MongoDB container whose data lives under /bitnami/mongodb. A backup is taken and the stack is stopped before the compose files are updated to rocketchat-compose 2.0.0. That update adds replica set initialization, permission-fixing containers and healthchecks, and the data volume moves to /data/db on the official image. Verification happens before the old volume is retired, and the backup is the rollback path if the new database does not come up cleanly.

The move path from the Bitnami stack to the official MongoDB image, with the backup as rollback.

When an outside team is worth bringing in

An outside team earns its place when the Bitnami MongoDB swap touches a workspace that people depend on and that carries obligations you cannot pause. The most common cases are a production workspace under compliance or recordkeeping requirements, a backup state nobody has verified, several environments (development, staging and production) that drift apart, or a planned move to Rocket.Chat 8.x in the same maintenance window. Rocket.Chat 8.x requires MongoDB 8.0 or later as a replica set, so a team that is already changing the database container and its volume path may find that the upgrade prerequisites and the container change need to be sequenced together. If two or more of these apply, the cost of a failed restore usually outweighs the cost of a second set of eyes on the plan.

DeployOpen works within a fixed, written scope agreed before work starts. For this migration, that scope would typically cover reviewing the current docker-compose files and Bitnami image tag, confirming the backup and restore path on a copy of the data, planning the move of data from /bitnami/mongodb to /data/db, updating to rocketchat-compose 2.0.0, and running the verification checks described in this guide. Each deliverable, the environments covered and the acceptance checks should be written into the scope so that the boundary of the work is clear. Ask any partner to state in writing which steps they perform and which remain with your team, including who runs the production cutover and who signs off on the restored data.

Throughout the engagement, your data, backups and infrastructure stay in your own environment, whether that is your cloud account, a data center or an air-gapped network. DeployOpen does not take custody of your workspace database or uploads. Confirm this clause, along with access revocation at the end of the work and where any backup copies are kept, before you sign. Price follows from the written scope, so ask for a quote that lists each component, the one-time work, and any recurring support or retainer separately, and that names the environments and the Rocket.Chat version it covers.

How DeployOpen scopes and delivers this database change

DeployOpen treats the move from the Bitnami MongoDB container to the official MongoDB image as a controlled change to your production database, not a container swap. We scope the backup, volume path change, rocketchat-compose 2.0.0 update and verification in writing before work starts, inside the infrastructure you control.

How we scope

  • Confirm your current rocketchat-compose version, Bitnami MongoDB tag and whether your deployment uses an external MongoDB instead
  • Agree the backup, rollback and maintenance window approach before any container is stopped
  • Record the data volume path change from /bitnami/mongodb to /data/db and its effect on your host
  • Set the written scope and deliverables as a fixed-scope engagement, with ongoing support available as a retainer

How we build

  • Take and verify a full database backup and copy the existing data volume before changing the compose file
  • Update the stack to rocketchat-compose 2.0.0 and check replica set initialization and permission-fixing containers
  • Test the cutover on a staging copy of your workspace before running it on production
  • Confirm Rocket.Chat starts against the new MongoDB container and that healthchecks report healthy

How we hand over

  • Document the final compose file, volume mapping, backup procedure and restore steps for your team
  • Provide a verification checklist covering login, message history, file uploads and push notifications
  • Record the MongoDB and Rocket.Chat versions in use and the rollback path that was tested
  • Walk your administrators through the changed paths and healthchecks so they can run the stack without us

How we support

  • Review the Rocket.Chat version line you run, since end-of-life versions stop receiving security fixes
  • Plan follow-on upgrades of Rocket.Chat and MongoDB as separate, scoped work
  • Offer ongoing support, upgrades and continuous testing as a retainer after handover
  • Retest the stack after each change so backup and restore procedures stay current

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.