How to Install and Configure MongoDB on Ubuntu 14.04
This tutorial will show you how to install MongoDB NoSql database on ubuntu step by step.
What is MongoDB?
MongoDB is a free and open-source NoSql database used in modern web applications to increase database performance. This tutorial will help you to install and configure MongoDB on your ubuntu machine.
Now Lets’s start tutorial step by step..!!
Step-1: Open terminal by pressing Ctrl+Alt+T
Step-2: Ubuntu already include MongoDB repository but for getting most updated version of MongoDB we need to install it from MongoDB official website and also it is recommended way to installing it.
The Ubuntu package management tools (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the MongoDB public GPG Key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Step-3: Create a list file for MongoDB. run below command.
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
Step-4: Update package repository by hitting below command
sudo apt-get update
Step-4: Now install latest version of MongoDB
sudo apt-get install -y mongodb-org
Step-5: Now MongoDB installed successfully, Run below command to check.
Below are the some basic command to start, stop MongoDb
sudo service mongod start sudo service mongod stop sudo service mongod restart
After that you can use MongoDB CLI command list to understand some basic commands.
Type help to display command list..
Use db.help() to display the database commands
show dbs: to display all databases.
Follow below link for more shell commands..