This a demo on how to install mongodb 7 in ubuntu.
Install MongoDB Community Edition:
1 Import the public key used by the package management system
sudo apt-get install gnupg curl
import the MongoDB public GPG key
curl -fsSL https://pgp.mongodb.com/server-7.0.asc |
sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg
–dearmor
2 Create a list file for MongoDB
echo “deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
3 Reload local package database
sudo apt-get update
4 Install the MongoDB packages
sudo apt-get install -y mongodb-org
Run MongoDB Community Edition
1 Start MongoDB
sudo systemctl start mongod
2 Verify that MongoDB has started successfully
sudo systemctl status mongod
3 This will ensure MongoDb to start on the next reboot
sudo systemctl enable mongod
Begin using MongoDB
mongosh
Create MongoDB Admin User
mongosh
use admin
db.createUser({user:”admin”, pwd:”password”, roles:[{role:”root”, db:”admin”}]})
Enable MongoDB authentication
sudo nano /etc/mongod.conf
security:
authorization: enabled
sudo systemctl restart mongod
Confirm if MongoDB is allowing remote connections using the following command.
sudo lsof -i | grep mongo
Reboot
sudo systemctl restart mongod
sudo systemctl stop mongod
sudo systemctl daemon-reload
sudo systemctl start mongod
Steps to install Robo 3T or Studio 3T free on Ubuntu 22.04
Update Ubuntu 22.04
download
cd Downloads
ls
tar -xvf (tarfile)
Run the Studio 3T installer.
./studio-3t-linux-x64.sh
Registration
My Other Channel:
https://www.youtube.com/channel/UCGCxdq6PYTy5doi9763eTCQ
Buy me a coffee:
https://www.buymeacoffee.com/arboiscodemedia
Join my facebook group for more:
https://www.facebook.com/groups/52326754561224