How to install MongoDB in Ubuntu 22.04 [100% Working]

I faced some issues while installing MongoDB on Ubuntu 22.04 lts, as libssl1.1 is now depricated. And after few hacking of here and there I got it done. Here I am sharing with you my final Solution.


1. paste following commands in your terminal and press enter:

wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc |  gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

sudo apt update

sudo apt install mongodb-org

2. Then allow mongod to run as a service

1. systemctl enable mongod

2. systemctl start mongod

 


In case MongoDB doesn’t start run the command below to reload.

 -1. systemctl daemon-reload 


Next Post Previous Post
No Comment
Add Comment
comment url