How can I install MongoDb on ubuntu linux??
This article will let you know the easy steps to install MongoDB.MongoDB is the open-source community software and It’s very frequent for the system administrator, to install the software for the clients. Here I will let you know the 5 easy steps to install MongoDB on the Ubuntu machine.
READ MORE: How to Install MySQL on Ubuntu 18.04 Release
First run the following command to add the repository in Ubuntu machine.
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
After above command, run this command:
# echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
Now update the Ubuntu packages.
# sudo apt-get update
Now, we will run the installation command for the MongoDB on the ubuntu server.
# sudo apt-get install -y mongodb-org
After installing, start the MongoDB service.
# sudo systemctl start mongod
Command to check the service status:
# sudo systemctl status mongod
Enable the MongoDb service permanently on, even on the restart Ubuntu.
# sudo systemctl enable mongod
By default, Ubuntu firewall is diabled. If you have enable Ubuntu firewall, need to allow MongoDb to through the firewall. To check the Ubuntu firewall active status, use this command:
# sudo ufw status
In case of firewall is set Active, then next step is to allow database port the through the firewall.
# sudo ufw allow 27017
Conclusion: You learned how to install MongoDB with easy 5 steps on Ubuntu machine.