Server Management (Unmanaged)

Downgrading MongoDB to version 4.4 on CentOS, AlmaLinux, and RockyLinux

By the Domain India teamPublished 6 min read
Knowledge base article
Contents (8 sections)

MongoDB 5.0 and every later version need a CPU with AVX instructions. On an older processor, or a virtual machine whose CPU model hides AVX, mongod crashes at start with "Illegal instruction". The usual workaround is MongoDB 4.4, the last version without that requirement. This guide shows how to check, the risks of running 4.4 in 2026, and how to install it safely on your own AlmaLinux or Rocky Linux 8 server.

Key takeaways

Run grep -o -m1 -w avx /proc/cpuinfo. If it prints nothing, MongoDB 5.0+ cannot run on that machine. MongoDB 4.4 reached end of life in February 2024 and gets no security fixes, so first consider a server with AVX or a managed MongoDB service. If you must use 4.4, you can't downgrade binaries in place: export your data with mongodump, remove the newer packages, install 4.4 from MongoDB's RHEL 8 repository, lock the version and restore. MongoDB publishes no 4.4 packages for RHEL 9, and CentOS Linux itself is end of life.

This is for your own server

Everything here needs root access on a server you manage, such as a VPS. Shared hosting customers can't install or change server software like MongoDB.

1. Confirm AVX is the problem

The symptoms are distinctive. sudo systemctl status mongod shows the service failed with status=4/ILL, and running mongod --version by hand prints Illegal instruction (core dumped).

Check the CPU flags:

bash
grep -o -m1 -w avx /proc/cpuinfo || echo "No AVX on this CPU"

If avx is printed, AVX is present and the crash has another cause; see debugging and troubleshooting MongoDB. If it isn't, MongoDB 5.0 or later will not run here, whatever you configure.

On a virtual machine, the physical host may support AVX while the CPU model presented to your VM does not. Ask whoever runs the host.

2. Decide before you downgrade

OptionGood forWatch out for
Move to a CPU with AVXAnyone who can move to another serverNeeds a migration, but you stay on a supported MongoDB version
Managed MongoDB serviceApps that only need a database connectionMonthly cost; data sits with that provider
Install MongoDB 4.4Keeping an existing app running on this hardwareEnd of life since February 2024: no security fixes
Switch databaseNew or small projectsCode changes
MongoDB 4.4 is end of life

MongoDB 4.4 has received no updates since February 2024. Treat it as a stopgap: keep it off the public internet, turn on authentication, and plan a move to a supported version. Many current drivers and tools are also dropping 4.4 support.

The operating system matters too. CentOS Linux 8 reached end of life at the end of 2021 and CentOS Linux 7 in June 2024, so neither gets security updates. Use AlmaLinux or Rocky Linux instead. We checked MongoDB's repository on 23 September 2026: 4.4 packages exist for the RHEL 8 family (the latest was 4.4.31), and the RHEL 9 repository has no 4.4 packages. So on AlmaLinux or Rocky Linux 9, 4.4 can't be installed from MongoDB's repository. There, running MongoDB in a container is the usual route; see running MongoDB in a Docker container.

3. Why you can't just swap the binaries

MongoDB's own downgrade process requires you to lower the featureCompatibilityVersion while the newer version is still running, then replace the binaries, one major version at a time. Without AVX, the newer mongod can't start, so you can't do that step on this machine. Data files written by 5.0 or later will make 4.4 refuse to start.

The safe route is a logical export and import:

  • If the data has only ever been used by 4.4 or older, keep the data directory as it is.
  • If it was written by 5.0 or later, export it with mongodump on a machine that can run that version, or use an existing dump, then restore it into an empty 4.4 data directory.

Features that 4.4 doesn't have, such as time series collections, will not restore. Test the restore before you depend on it.

4. Install MongoDB 4.4 on AlmaLinux or Rocky Linux 8

  1. Back up.
    Take a mongodump of your data (for example mongodump --archive=mongo-backup.gz --gzip) and copy /etc/mongod.conf.
  2. Stop and remove the newer version.
    Run sudo systemctl stop mongod, then sudo dnf remove -y 'mongodb-org*'.
  3. Set the old data aside.
    If the data was written by 5.0 or later, move it out of the way with sudo mv /var/lib/mongo /var/lib/mongo.old. Installing the 4.4 package creates a fresh, empty /var/lib/mongo.
  4. Remove other MongoDB repositories. List them with `ls /etc/yum.repos.d/
    grep -i mongo` and delete or disable every file except the one you create next.
  5. Add the 4.4 repository
    as shown below, then run sudo dnf clean all.
  6. Install and lock the version
    with the commands below.
  7. Start MongoDB
    with sudo systemctl enable --now mongod.
  8. Restore your data
    with mongorestore --archive=mongo-backup.gz --gzip, and check your collections and indexes.

The repository file, with the release number written out (on the RHEL 8 family $releasever also resolves to 8):

bash
sudo tee /etc/yum.repos.d/mongodb-org-4.4.repo > /dev/null <<'EOF'
[mongodb-org-4.4]
name=MongoDB 4.4 Repository
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-4.4.asc
EOF

Install, then lock the packages so a routine dnf update never pulls in a newer major version:

bash
sudo dnf install -y mongodb-org
sudo dnf install -y python3-dnf-plugin-versionlock
sudo dnf versionlock add 'mongodb-org*'

For more on version locks, see how to version lock RPM packages.

5. Verify

bash
mongod --version
mongo --quiet --eval 'db.version()'
sudo systemctl status mongod

The first two commands should report a 4.4 version. MongoDB 4.4 ships the legacy mongo shell; the newer mongosh also connects to 4.4 if you prefer it.

6. Lock it down

A 4.4 server gets no more security fixes, so reduce its exposure:

  • keep net.bindIp: 127.0.0.1 in /etc/mongod.conf unless another server must connect, and then allow only that server's IP in your firewall;
  • never open port 27017 to the whole internet;
  • create an administrative user and set security.authorization: enabled;
  • take regular mongodump backups and store them off the server.

7. Troubleshooting

  • dnf still installs 6.0 or 7.0: another MongoDB repository is still enabled. Run dnf repolist | grep -i mongo, disable the others, then sudo dnf clean all. dnf --showduplicates list mongodb-org-server shows which versions each repository offers.
  • Still "Illegal instruction": a 5.0+ binary is still installed. Check rpm -qa | grep -i mongodb.
  • 4.4 won't start and the log mentions featureCompatibilityVersion or an unsupported data format: the data directory was written by a newer version. Start with an empty directory and restore from a dump.
  • Permission or SELinux errors after moving the data path: the packages set up the default /var/lib/mongo. A custom path needs the right owner and SELinux context.

8. Running this on Domain India

MongoDB is server software, so on Domain India it belongs on a VPS. VPS plans are self-managed, with root access and no cPanel, so you install and maintain MongoDB yourself. Run the AVX check in section 1 on your VPS before you choose a MongoDB version; if AVX is missing, ask support about your options.

On shared hosting you can't run a MongoDB server, but a Node.js app can connect to an external managed MongoDB database. The App Platform runs Node.js apps with automatic detection, and other stacks with a Dockerfile. For choosing a database in the first place, see choosing between PostgreSQL, MySQL, SQLite and MongoDB. The card shows the live price, excluding 18% GST.

VPS Starter
₹552.65/mo + GST
  • 1 vCPU
  • 2 GB DDR4 RAM
  • 64 GB NVMe SSD Storage
  • 2 TB Monthly Bandwidth
See plan details
Why does MongoDB 5.0 or later fail with "Illegal instruction"?

MongoDB 5.0 and later require a CPU with AVX instructions. On a processor or virtual machine without AVX, mongod crashes immediately. Check with grep -o -m1 -w avx /proc/cpuinfo; if nothing is printed, AVX is missing.

Is MongoDB 4.4 still supported?

No. MongoDB 4.4 reached end of life in February 2024 and receives no security fixes. Use it only as a stopgap, keep it off the public internet with authentication on, and plan a move to a supported version.

Can I install MongoDB 4.4 on AlmaLinux or Rocky Linux 9?

Not from MongoDB's repository. When we checked on 23 September 2026, 4.4 packages were published for the RHEL 8 family only. On a version 9 system, running MongoDB in a container is the usual alternative.

Can I downgrade MongoDB by just installing the 4.4 packages over my data?

Not if the data was written by 5.0 or later. MongoDB's downgrade process needs the newer version running to lower the feature compatibility version first. Export the data with mongodump, install 4.4 with an empty data directory, and restore it with mongorestore.

How do I stop dnf from upgrading MongoDB 4.4 again?

Install the dnf versionlock plugin and lock the packages with sudo dnf versionlock add 'mongodb-org*', and make sure no other MongoDB repository is enabled.

Can I run MongoDB on Domain India shared hosting?

No. MongoDB server has to be installed on a server you control, such as a Domain India VPS. Apps on shared hosting can connect to an external managed MongoDB database instead.

Ready to set up MongoDB on your own server? Compare VPS plans, or open a support ticket to ask about your options before you order.

Need a server for MongoDB?

Self-managed VPS plans with root access, so you can install and configure the database version your app needs.

See VPS plans

Ready when you are

Get VPS from ₹552.65/mo + GST

See plans

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app