Installation of MongoDb on Ubuntu 22.04


I am trying to install Mongodb in Ubuntu22.04 but it is not working. Can anyone from the community tell me that, is it possible to install mongodb in Ubuntu 22.04? As , I was trying to solve this problem, I hadlooked a lot of online documentations and support where people mentioned that it is not possible to use the db with ubuntu 22.04.
Like first some kind of impish security file Release was giving error e.g., file format is not valid and
‘404: IP not found.’ Then I removed that whole file as I thought it might be of different previous versions. But in the end, got other errors and a lot of complications…

Are there other methods?
Like using Atlas or some kind of containerization using Dockers?

As one of the other methods I tried using MongoDB Atlas and trying to connect the atlas server through VS-Code, but the connection never occurs despite of using the right connection string from the hosted server…

Any suggestions or help will be welcomed:)

1 Like

Atlas with Vscode should work.What error are you getting
Check this link

Also check our forum threads for alternative solutions for Mongodb on Ubuntu 20.04

1 Like

Thanks for replying.

The problem is with IP address. It was not whitelisted before. I changed the setting. And now it is working.


It will soon be a year since the stable version of ubuntu 22.04 came out and still mongo db does not support it. Please tell me if the developers plan to support mongo db for ubuntu at all? It seems that the developers of mongo db do not care about ubuntu support

1 Like

Related Installing mongodb over Ubuntu 22.04 - #7 by Stennie

The JIRA tickets are completed so it should be possible to install following instructions in that thread.

I don’t know the reasons why it’s not in the docs yet.

I tried and replacing the last MongoDB installation commands for ubuntu 20.04 focal with with jammy installed the program.

Edit: as said above, and by @chris (below) here is the link to instructions. @chaosmos.

Could you point out here exactly how i can now install mongo db on ubuntu 22.04? There are so many different options in the thread you mentioned that it is not clear which one is working and optimal

Also, could you tell me when we should expect an official release with support for ubuntu 22.04? And what is the reason for the fact that for almost a year it is impossible to install mongo db on the most popular Linux distribution in a regular way?

1 Like

@chaosmos please check this recent shorter discussion we had:
How to install mongodb 6.0 on Ubuntu 22.04 - Ops and Admin / Installation & Upgrades - MongoDB Developer Community Forums

“Fast release cycles” of operating systems favor the latest versions of libraries (ubuntu comes every 6 months). unfortunately, “latest” does not always mean proven to be “stable” or easy to migrate. Stability is important for server programs like MongoDB so they have to use battle-tested libraries (even if they may have bugs) hence the delay of support to newer OS versions.

The fortunate thing is older libraries can still be installed and used mostly without any problems if all their dependencies can also be installed. you just need to dive into some settings manually. that is until developers manage to migrate to new libraries, which MongoDB also did but that is not just reflected in documents yet.

Follow the existing instructions. Replace focal with jammy.



Thank you. This worked perfectly for me.

Hi Chris please I am completely a newbie to MongoDB but I am using ubuntu 22.04, could you help me with the clear steps to install the latest MongoDB

As per @santimir:

The instructions are here

Step 2: Is where focal needs to be replaced withjammy. When you copy and paste that line

So that would become:

echo "deb [ arch=amd64,arm64 ] jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
1 Like

Just switch back to ubuntu 20.04 or some fedora or arch. Or learn and use docker instead. because this is only one package(mongoDB). God knows how many more softwares are not supported in 22.04 (They have done many critical upgrades like wayland, libssl1 → libssl3, etc. Wait a year or so for everything get supported in ubuntu 22.04 and based distros( like popos, mint, distros).
Happy coding fella:)

actually, it is not that easy (or complicated, depending on where you look at it) as you describe.

you can use any version of any library (even 30 years old ones) as long as their dependencies do not contradict what the current OS uses, provided they work with the architecture.

Ubuntu 22.x is called “jammy” and installs packages with that name. but you can still install packages from older (bionic, focal, trusty etc.) repositories if you need them. You just need to add their repository url to the apt source list file. the same also goes for independent packages like MongoDB: they have their own repository urls you need to add to apt source list.

Here in this topic, installing MongoDB 6.0 on Ubuntu 22.x, we have two options:

  • add one of older ubuntu repositories to your apt list (then follow remaining steps):

    • echo "deb focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
  • wait for a new build (which is already here) and use it (@chris mentioned this many times)

    • echo "deb [ arch=amd64,arm64 ] jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

The first method uses MongoDB built for “ubuntu/focal” and the second one uses “ubuntu/jammy” build. The only thing missing is the official installation page does not yet have this on it.

One can easily see which versions have been built for which ubuntu here: MongoDB Repositories. If you follow “Parent Directory” link, you can even find builds for other Linux distros there.

As you said the mongoDb server uses dependency libss1 which is upgraded to libssl3 in ubuntu 22.04. So I have to install this dependency externally which opens several velnerabilities and result in breaking system. Since there is some point in canonical’s decision to depricate libssl1

1 Like

@mkbhru i am also facing same issue by installing mangodb in raspberrypi4b .please let me know how to resolve the issue

Hello there, I am not sure if I have to open a new thread or just post my issue here, since this is my first time to post. I have the same issue with ubuntu 22.04 regarding the libssl1.1. I manage to install it following other threads,


~$ dpkg -l | grep libssl1.1
ii libssl1.1:amd64 1.1.1f-1ubuntu2 amd64


however when I run this;


$ ldd $(which mongod) | grep libssl => /lib/x86_64-linux-gnu/ (0x00007f8c3b78b000)


it is showing, does it mean mongodb 4.4 is pointing to libssl3? Is there a way to make sure that mogodb will use the libssl1. Thanks

if you see only 1 line of output, then it most possibly means what you have installed is not 4.4 version. Here is what I get for mongodb 4.4 on a WSL-Ubuntu 22.04:

$ ldd $(which mongod) | grep libssl => /lib/x86_64-linux-gnu/ (0x00007f8e25ed4000) => /lib/x86_64-linux-gnu/ (0x00007f8e25a03000)

I don’t know what steps/tutorials you have followed, but if you need 4.4 on Ubuntu 22.04, then one easy way is to just follow instruction for Ubuntu 20.04 (focal) on Mongodb 4.4 installation page and, anywhere before actual install step, run the following to be able to get “libssl1.1” from focal’s official repository.

echo "deb focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list

This works because any linux application can run on any distribution as long as the dependencies can be found and run on the current system. and above command just adds/tells where to find working openssl-1.1

Thank you for your reply. Correct me if I am wrong, once I add this

echo “deb Index of /ubuntu focal-security main” | sudo tee /etc/apt/sources.list.d/focal-security.list

Do I have to do anything to install the libssl1.1? Thanks.

You can use it for any program (or any mongodb version) that needs openssl-1.1 for new Ubuntu versions (as long as they keep compatibility). You execute this command and then follow the instructions to install with sudo apt-get install .... It will know where to look for the libssl1.1

By the way, did you notice what happened to the actual command in your reply? when you add code blocks or commands, add them in backticks, just like you quote “important” things. single ` (or double``) backticks for inline, and triple ```(or quad ````) backticks for blocks.

I will take note of what you said regarding the quotes, sorry. Anyways I finally installed the libssl1.1 and it show now the 2 version of libssl:

ldd $(which mongod) | grep libssl => /lib/x86_64-linux-gnu/ (0x00007fc8907e1000) => /lib/x86_64-linux-gnu/ (0x00007fc890310000)

however when I check the status, the service is disable:

systemctl status mongod

× mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: core-dump) since Wed 2023-11-29 14:45:48 PST; 1 day 18h ago
I did try stopping it then restarting it, however same error. Any hints? Thank you.