VPS Snaps

How to upgrade Rocket.Chat to 9.0 in Docker with a backup you can roll back to

Rocket.Chat 9.0.0 was released on November 10, 2026. It needs MongoDB 8.0, and workspaces without a Premium plan lose LDAP, SAML and Custom OAuth login when they upgrade. If your team signs in through one of those, the upgrade can lock everyone out, and Rocket.Chat's docs do not describe a way to downgrade. Your way back is a database dump taken just before the upgrade. This guide takes that dump, upgrades a Docker deployment made with the official rocketchat-compose repository, shows how to roll back to 8.x from the dump, and then schedules nightly dumps and tests a restore. Commands are for Docker Compose v2 on a Linux VPS, with the bundled MongoDB service named mongodb.

Check what 9.0 changes before you upgrade

Change in 9.0What to do first
MongoDB 8.0 is requiredCheck your MongoDB version (below). The current compose files use 8.2, which works
LDAP and SAML login are removed on workspaces without a Premium plan that includes themMake sure at least one admin can log in with a local username and password
Custom OAuth (for example Keycloak or Authentik) now needs Premium, and some built-in OAuth providers were removedSame: confirm a local admin login works
MESSAGE_MAX_PARSE_LENGTH now defaults to 10,000 charactersSet it to 0 in .env if you want the old unlimited behavior
ALLOW_UNSAFE_QUERY_AND_FIELDS_API_PARAMS was removedCheck any integrations that relied on it
Images now use Node.js 24.22.1 on Debian bookwormNothing, unless you build custom images on top

Upgrade one major version at a time. Rocket.Chat's docs say skipping major versions can cause severe compatibility problems. If you are on 7.x, upgrade to the latest 8.x first, check it works, take a new backup, then go to 9.0.

Run these from your rocketchat-compose folder to see which MongoDB you have:

Terminal
docker compose -f compose.database.yml exec mongodb mongosh --quiet \
  --eval 'db.version()'

grep -E '^(RELEASE|MONGODB_VERSION)=' .env

If MongoDB is older than 8.0, or you are still on the old Bitnami MongoDB image, move to the official MongoDB 8 image first. Rocket.Chat's guide to migrating from Bitnami MongoDB covers it, and Rocket.Chat 8.0 and later already require MongoDB 8.

Back up the database and the config

What to save:

  • The rocketchat MongoDB database. With the default GridFS file storage, uploaded files are inside it too.
  • Your .env and compose files, so you can bring the same setup back.
  • Uploaded files, only if you switched file storage to FileSystem or an S3 bucket. Those live outside MongoDB and need their own copy.
Terminal
cd /path/to/rocketchat-compose
mkdir -p mongodb-backup

docker compose -f compose.database.yml exec -T mongodb mongodump \
  --uri='mongodb://localhost:27017/?directConnection=true' \
  --archive --gzip --db=rocketchat \
  > mongodb-backup/rocketchat-before-9.0-$(date +%F).gz

tar czf mongodb-backup/config-before-9.0-$(date +%F).tgz .env *.yml
ls -lh mongodb-backup/

The dump should be roughly the size of your data, not a few kilobytes. Copy both files off the server, for example with rclone to a bucket you own. If your cloud provider supports it, take a server snapshot too.

Do this in a quiet period. The dump runs while Rocket.Chat is up, and without --oplog writes made during the dump are not frozen at one moment. On a busy server, post a short maintenance notice first.

Upgrade to 9.0

Set RELEASE in .env to the 9.0 release you want. Use a fixed version, not latest. Check the newest 9.0.x on Rocket.Chat's GitHub releases page; 9.0.0 is the first.

Terminal
sed -i 's/^RELEASE=.*/RELEASE=9.0.0/' .env
grep '^RELEASE=' .env

Start the stack with the same compose files you deployed with. The list below is the full set from Rocket.Chat's docs with Traefik. Drop any file you did not use, such as compose.traefik.yml if you run Nginx.

Terminal
FILES="-f compose.monitoring.yml -f compose.traefik.yml -f compose.database.yml -f compose.yml -f compose.nats.yml -f docker.yml"

docker compose $FILES up -d
docker ps

Watch the Rocket.Chat container's logs with docker logs -f <rocketchat-container> until the server reports it is running. Then log in, open Manage, then Workspace, and check that it shows 9.0. Try a normal user login, send a message, and open an old uploaded file.

Roll back to 8.x if logins or integrations break

Rocket.Chat changes the database when it starts on a new version, so do not just set the old RELEASE and start it on the upgraded data. Restore the pre-upgrade dump first. This replaces everything in the rocketchat database, so messages sent after the upgrade are lost.

The dropDatabase() step deletes the current rocketchat database. Check that your pre-upgrade dump exists and is the right size before you run it.

Terminal
FILES="-f compose.monitoring.yml -f compose.traefik.yml -f compose.database.yml -f compose.yml -f compose.nats.yml -f docker.yml"

# 1. Stop everything (volumes are kept), then start only MongoDB
docker compose $FILES down
docker compose -f compose.database.yml up -d

# 2. Drop the upgraded database and restore the pre-upgrade dump
docker compose -f compose.database.yml exec -T mongodb mongosh --quiet \
  'mongodb://localhost:27017/rocketchat?directConnection=true' \
  --eval 'db.dropDatabase()'

cat mongodb-backup/rocketchat-before-9.0-<date>.gz \
  | docker compose -f compose.database.yml exec -T mongodb mongorestore \
      --uri='mongodb://localhost:27017/?directConnection=true' --archive --gzip

# 3. Pin the version you were on and start the stack
sed -i 's/^RELEASE=.*/RELEASE=<previous-8.x-version>/' .env
docker compose $FILES up -d

Dropping the database first matters. mongorestore --drop only replaces the collections that are in the dump, so collections that 9.0 created would be left behind.

The commands assume MongoDB has no authentication, which is how rocketchat-compose sets it up. If you added a MongoDB user, put the username and password in each connection string.

Schedule nightly dumps

Once you are on 9.0, keep taking dumps. Add these to root's crontab with sudo crontab -e, replacing /opt/rocketchat-compose with your folder. % has to be escaped as \% in cron.

crontab
15 2 * * * cd /opt/rocketchat-compose && docker compose -f compose.database.yml exec -T mongodb mongodump --uri='mongodb://localhost:27017/?directConnection=true' --archive --gzip --db=rocketchat > /var/backups/rocketchat/rocketchat-$(date +\%F).gz
45 2 * * * find /var/backups/rocketchat -name 'rocketchat-*.gz' -mtime +14 -delete

Create the folder first with sudo mkdir -p /var/backups/rocketchat. That keeps 14 days on the server; copy each night's file to object storage as well, so losing the VPS does not take the backups with it.

Test a restore

Restore last night's dump into a throwaway MongoDB container and compare the user count with production. This never touches your live database.

Terminal
docker run -d --name rc-restore-test mongodb/mongodb-community-server:8.2-ubi8
sleep 10

docker exec -i rc-restore-test mongorestore --archive --gzip \
  < /var/backups/rocketchat/rocketchat-<date>.gz

# Restored copy
docker exec rc-restore-test mongosh --quiet rocketchat \
  --eval 'db.users.countDocuments()'

# Production, for comparison
docker compose -f compose.database.yml exec mongodb mongosh --quiet \
  'mongodb://localhost:27017/rocketchat?directConnection=true' \
  --eval 'db.users.countDocuments()'

docker rm -f rc-restore-test

The two numbers should match, or be very close if people signed up since the dump. If the restore prints errors or the count is zero, fix the backup job before you need it.

Frequently asked questions

Can I downgrade Rocket.Chat 9.0 back to 8.x?
Rocket.Chat's docs do not describe a downgrade. The safe way back is to restore a MongoDB dump taken on 8.x before the upgrade, then start the old version.
Which MongoDB version does Rocket.Chat 9.0 need?
MongoDB 8.0. Later 8.x releases in the supported range also work, and the current rocketchat-compose files use 8.2.
Can I go straight from Rocket.Chat 7.x to 9.0?
No. Upgrade one major version at a time: 7.x to the latest 8.x, then 8.x to 9.0, with a backup before each step.
Does the mongodump include uploaded files?
Yes, if file storage is GridFS, the default. If you set it to FileSystem or an S3 bucket, back up that location separately.

How this was checked

Commands, limits and prices were checked against these official pages, on November 16, 2026: