How to Install MongoDB on Ubuntu 16.04.
MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is published under a combination of the GNU Affero General Public License and the Apache License.
To install Mongo DB first import public key by package management system.sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
After create a list file for it:echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
Use the following command to reload the local package database:sudo apt-get update
Now install the MongoDB packages and start it by following this commandsudo apt-get install -y mongodb-org
sudo systemctl start mongod
Use this to Stopsudo service mongod stop
And this to Restartsudo service mongod restart
To finish enable MongoDB:sudo systemctl enable mongodb
You have successfully installed MongoDB in Ubuntu 16.04
Enjoy it.
MongoDB is a popular open-source document-oriented NoSQL database that uses a JSON-like format to store data.
You can install MongoDB on Ubuntu by following these steps:
Add the MongoDB repository to your system:
bashwget -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 $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list sudo apt-get update
Install MongoDB:
CSharpsudo apt-get install -y mongodb-org
You can start MongoDB on Ubuntu by running the following command in the terminal:
sudo systemctl start mongod
You can check the status of MongoDB on Ubuntu by running the following command in the terminal:
sudo systemctl status mongod
You can connect to MongoDB on Ubuntu using the mongo
command in the terminal:
mongo
To uninstall MongoDB on Ubuntu, you can run the following command in the terminal:
sudo apt-get purge mongodb-org*