Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Support] jasonbean - MongoDB

Featured Replies

Does anyone know how to upgrade MongoDB from v4.4.3 to v5 or greater?

  • 2 months later...
  • Replies 76
  • Views 41.2k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Edit the template (click on icon, edit) then in the repository instead of :latest (if it's there) change it to :4.4.7 (or add it)

  • That worked perfectly, thanks.   For the benefit of anyone else with the same issue, changing version to "5" as demonstrated by @danktankk allowed mongoDB to run, and therefore get terminal

  • It's not on by default. You can do it by editing the container, enabling Advanced view, and setting the extra parameters field like so:   mongo --auth #  

Posted Images

Hello, How do I enable authorization?

Editing `mongod.conf.orig` or creating new `mongod.conf` doesn't help.

  • 1 month later...
On 5/20/2023 at 3:36 AM, Denocyte said:

Hello, How do I enable authorization?

Editing `mongod.conf.orig` or creating new `mongod.conf` doesn't help.


1. Open a terminal and create the mongodb folder
- mkdir /mnt/user/appdata/mongodb
 

2. Change directory
- cd /mnt/user/appdata/mongodb
 

3. Create key file mongodb.key (mongodb will use it for authorization)
- openssl rand -base64 741 > mongodb.key
- chmod 600 mongodb.key

Step 3 is how you create the key and then in your mongod.conf file you need to add the below if you don't already have it:

 

security:
  authorization: "enabled"
  keyFile: /data/db/mongodb.key

  • 1 month later...

My MongDB container no longer stays running. This started after a recent update, but no other action taken or config changes. I see the following in the logs:

 

{"t":{"$date":"2023-08-23T08:35:12.363-05:00"},"s":"F",  "c":"CONTROL",  "id":20573,   "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"5.0\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '5.0'; expected '6.0' or '6.3' or '7.0'. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 6.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/6.0/#upgrade-procedures."}}

 

Does anyone know how to solve this issue?

I just encountered the same problem with the same error:


{"t":{"$date":"2023-08-23T23:31:04.280+02:00"},"s":"F",  "c":"CONTROL",  "id":20573,   "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"5.0\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '5.0'; expected '6.0' or '6.3' or '7.0'. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 6.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/6.0/#upgrade-procedures."}}

 

I did a quick google and followed some links but no solution was found.

I temporary forced the docker to use mongo:5.0 and all is good (for now)

On 8/23/2023 at 5:02 PM, sirKitKat said:

I temporary forced the docker to use mongo:5.0 and all is good (for now)

 

How did you go about forcing mongo:5.0 ? 

On 8/23/2023 at 10:17 PM, guipace said:

My MongDB container no longer stays running. This started after a recent update, but no other action taken or config changes. I see the following in the logs:

 

{"t":{"$date":"2023-08-23T08:35:12.363-05:00"},"s":"F",  "c":"CONTROL",  "id":20573,   "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"5.0\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '5.0'; expected '6.0' or '6.3' or '7.0'. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 6.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/6.0/#upgrade-procedures."}}

 

Does anyone know how to solve this issue?

Same for me. set mine to Repository = mongo:5.0 back up and running. 

How do you migrate and upgrade to MangoDB 6.0?

I installed the official MongoDB app through unraid and it uses Mongo 7 (no option to select a version from the deployment page). 

 

With regards to starting with authentication required, it took me longer than I care to admit, that there are two important environment variables missing that you have to manually add when deploying the docker app:

MONGO_INITDB_ROOT_USERNAME

MONGO_INITDB_ROOT_PASSWORD

 

Without those, it will not start mongodb with --auth. However, once you add those (and set them) it works as expected, no further modifications needed.

  • 4 weeks later...

 Hello,

since a few days I have problems with Rocket Chat and MongoDB. Perhaps you can help me further.

I updated the two Dockers and since then MongoDB no longer starts with the following error message:

Unrecognized option: storage.journal.enabled
try 'mongod --help' for more information

Unfortunately I can not find a solution to start the database again.

Thank you in advance.

On 8/30/2023 at 10:50 AM, simplysuperc said:

I installed the official MongoDB app through unraid and it uses Mongo 7 (no option to select a version from the deployment page). 

 

With regards to starting with authentication required, it took me longer than I care to admit, that there are two important environment variables missing that you have to manually add when deploying the docker app:

MONGO_INITDB_ROOT_USERNAME

MONGO_INITDB_ROOT_PASSWORD

 

Without those, it will not start mongodb with --auth. However, once you add those (and set them) it works as expected, no further modifications needed.

 

was there anything else you needed to do? It looks like the lastest docker image includes those variables.  But adding the mongo --auth # still doesnt work for me?

On 9/24/2023 at 9:41 AM, i-B4se said:

 Hello,

since a few days I have problems with Rocket Chat and MongoDB. Perhaps you can help me further.

I updated the two Dockers and since then MongoDB no longer starts with the following error message:

Unrecognized option: storage.journal.enabled
try 'mongod --help' for more information

Unfortunately I can not find a solution to start the database again.

Thank you in advance.

Does no one have an idea what this could be? 😅

On 9/29/2023 at 5:03 PM, i-B4se said:

Does no one have an idea what this could be? 😅

according to this info https://www.mongodb.com/docs/manual/core/journaling/ journaling is automatic now in the latest versions so there is no need to manually enabling it in .conf file

therefore you have to change the file appdata\mongodb\mongod.conf and remove the lines:

journal:
enabled: true

or put # in front, like so:

# journal:
# enabled: true

it worked for me, hopefully will work for you too. cheers

  • 4 weeks later...

I am trying to get the unifi-network-application docker from Linuxserver running. It requires MongoDB running externally so I have also installed this docker. Unfortunately when I start the UNA docker I get an error- 

Defined MONGO_HOST is not reachable, cannot proceed

This probably indicates that I have the wrong value for the MONGO_HOST variable defined in the UNA docker but I don't know how to determine the correct value.

 

MongoDB docker run

docker run
  -d
  --name='MongoDB'
  --net='unifi'
  -e TZ="America/New_York"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Brunnhilde"
  -e HOST_CONTAINERNAME="MongoDB"
  -e 'MONGO_INITDB_ROOT_USERNAME'='unifi'
  -e 'MONGO_INITDB_ROOT_PASSWORD'='password'
  -e 'MONGO_INITDB_DATABASE'='unifi'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/jason-bean/docker-templates/master/jasonbean-repo/mongo.sh-600x600.png'
  -p '27017:27017/tcp'
  -v '/mnt/user/appdata/mongodb/':'/data/db':'rw' 'mongo:4.4.25'
27d1cb80431f39864d8c72479b155efbb0ca5e554f0b4b7cd87ed47c85358e0a

The command finished successfully!

 

unifi-network-application docker run

docker run
  -d
  --name='unifi-network-application'
  --net='unifi'
  -e TZ="America/New_York"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Brunnhilde"
  -e HOST_CONTAINERNAME="unifi-network-application"
  -e 'MONGO_USER'='unifi'
  -e 'MONGO_PASS'='password'
  -e 'MONGO_HOST'='unifi-db'
  -e 'MONGO_PORT'='27017'
  -e 'MONGO_DBNAME'='unifi'
  -e 'MEM_LIMIT'='1024'
  -e 'MEM_STARTUP'='1024'
  -e 'MONGO_TLS'=''
  -e 'MONGO_AUTHSOURCE'=''
  -e 'PUID'='99'
  -e 'PGID'='100'
  -e 'UMASK'='022'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/unifi-network-application-icon.png'
  -p '8443:8443/tcp'
  -p '3478:3478/udp'
  -p '10001:10001/udp'
  -p '8080:8080/tcp'
  -p '1900:1900/udp'
  -p '8843:8843/tcp'
  -p '8880:8880/tcp'
  -p '6789:6789/tcp'
  -p '5514:5514/udp'
  -v '/mnt/cache/appdata/unifi-network-application':'/config':'rw' 'lscr.io/linuxserver/unifi-network-application'
11418dad9c98efa345f75bd91d63abd411d69a4620d9c3e3f2d6bead7156e3bd

The command finished successfully!

 

Hoping someone here can help with getting the UNA docker connected to this one.

  • 3 months later...

Guys I'm having trouble understanding this vs. MariaDB.

I'm not expert but I have a fundamental understanding on MySQL and MariaDB.

 

I also use Adminer to admin MariaDB.

 

The thing I don't understand is in MariaDB, I create different databases for different things such as Fireflly3 and SpeedtestTracker.  

Each one gets their own database within the MariaDB container. I can also create users, etc.

 

But with my initial look into MondoDB, I'm not really seeing that it works the same way.  

Do you not "log into" MondoDB and then create different databses (with their own unique names)?

 

I tried to get into MondoDB from Adminer but it told me 

None Of The Supported PHP Extensions (Mongo, Mongodb) Are Available.

 

I have Graylog installed and I believe that's using MongoDB, I'm just not exactly sure how haha

 

Thanks for any info guys! Ultimately I wanna get in there and create separate databases so it's nice and clean.

17 hours ago, DevanteWeary said:

Ultimately I wanna get in there and create separate databases so it's nice and clean.

I get what you want to do, but there are good reasons to not do it that way.

 

Multiple separate containers have advantages, if one database gets messed up you can blow it away and redo it without disturbing the others. There is no extra storage penalty for multiple identical containers, the program parts all share the same data layers, the only extra storage for each additional container is the data and custom configuration, very close to the total of one container with all your databases anyway.

 

The only extra work is keeping track of the names and ports, but that's minor compared to the extra work of fixing one bad database while keeping the rest running in a single container.

  • 1 year later...
On 2/11/2024 at 10:03 AM, JonathanM said:

I get what you want to do, but there are good reasons to not do it that way.

 

Multiple separate containers have advantages, if one database gets messed up you can blow it away and redo it without disturbing the others. There is no extra storage penalty for multiple identical containers, the program parts all share the same data layers, the only extra storage for each additional container is the data and custom configuration, very close to the total of one container with all your databases anyway.

 

The only extra work is keeping track of the names and ports, but that's minor compared to the extra work of fixing one bad database while keeping the rest running in a single container.

 

How do you create separate containers using different ports? When I go through add contains, and select the existing mongo template, I can't change the container port. I can only change the host port, and then end up connecting to the same instance through a different port.

 

If I remove the Host Port 1 line and re-add, I can atleast modify the host port.

 

But I can't get the mongodb port changed to a different port. mongod --port won't work in the console or at startup.

Edited by jkexbx
Made it further

  • 3 months later...

Hi,

MongoDB update (official container) not working anymore since a few days (all other docker updates works fine). Any ideas?

image.png

On 8/2/2025 at 10:04 AM, Neo78 said:

Hi,

MongoDB update (official container) not working anymore since a few days (all other docker updates works fine). Any ideas?

image.png

Problem found/solved! My ADGuard DNS filter suddenly started blocking a page that is necessary for the update.

  • 4 weeks later...

Is it possible to have mongodb run as another user and group? In unraid, we normally want every docker running on 99/100 but I can't find how to do this with this container

  • 2 months later...

My MongoDB1 won't start anymore. I tried to upgrade to unraid 7.2.0 and it didn't come up, so I went back down to 7.1.4 and it still won't come back up. Any idea's what I need to do?

{"t":{"$date":"2025-11-02T09:13:34.550-06:00"},"s":"F", "c":"CONTROL", "id":20573, "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"7.0\" }. See https://docs.mongodb.com/master/release-notes/8.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '7.0'. Expected one of the following versions: ''8.2', '8.1', '8.0'. See https://docs.mongodb.com/master/release-notes/8.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 8.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/8.0/#upgrade-procedures."}}

1 hour ago, hawkcfa said:

My MongoDB1 won't start anymore. I tried to upgrade to unraid 7.2.0 and it didn't come up, so I went back down to 7.1.4 and it still won't come back up. Any idea's what I need to do?

I have the same problem. I use MongoDB for Your_Spotify, but the database just stops itself. I cannot see any logs either

1 hour ago, hawkcfa said:

My MongoDB1 won't start anymore. I tried to upgrade to unraid 7.2.0 and it didn't come up, so I went back down to 7.1.4 and it still won't come back up. Any idea's what I need to do?

1 hour ago, hawkcfa said:

I have the same problem. I use MongoDB for Your_Spotify, but the database just stops itself. I cannot see any logs either

On 11/2/2025 at 10:49 AM, hawkcfa said:

My MongoDB1 won't start anymore. I tried to upgrade to unraid 7.2.0 and it didn't come up, so I went back down to 7.1.4 and it still won't come back up. Any idea's what I need to do?

{"t":{"$date":"2025-11-02T09:13:34.550-06:00"},"s":"F", "c":"CONTROL", "id":20573, "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"7.0\" }. See https://docs.mongodb.com/master/release-notes/8.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '7.0'. Expected one of the following versions: ''8.2', '8.1', '8.0'. See https://docs.mongodb.com/master/release-notes/8.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 8.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/8.0/#upgrade-procedures."}}


It gives you a link to the upgrade procedures. Just follow them.

And also dont use :latest if you dont know the consequences of it.

But if you need the TL;DR:

1) Change image to mongodb:8.0

2) Start Container

3) Connect to the admin database: docker exec -it MongoDB mongosh admin

4) Run the upgrade command: db.adminCommand( { setFeatureCompatibilityVersion: "8.0", confirm: true } )

If you're fine with 8.0, stop there, if you want 8.2:

5) Stop the container.
6) Change back to :latest or even better pinning to 8.2 :8.2
7) Start container.
8) Run the upgrade command: `db.adminCommand( { setFeatureCompatibilityVersion: "8.2", confirm: true } )


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.