Skip to content

Latest commit

 

History

History
102 lines (68 loc) · 1.24 KB

File metadata and controls

102 lines (68 loc) · 1.24 KB

Installation MongoDB (for ubuntu 20.04)

Run following commands one after other Referece

sudo wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock
  • To start db
sudo systemctl start mongod

-To check if db started correctly

sudo systemctl status mongod
sudo systemctl status mongod
sudo systemctl enable mongod

-To restart the server

sudo systemctl restart mongod

-To stop the server

sudo systemctl stop mongod
  • Use Mongo DB after
mongo

Installing mongodb compass

wget https://downloads.mongodb.com/compass/mongodb-compass_1.26.1_amd64.deb
sudo dpkg -i mongodb-compass_1.26.1_amd64.deb
mongodb-compass