How to Install and Configure MongoDB on Ubuntu

Configure MongoDB

How to Install and Configure MongoDB on Ubuntu. Here is best for install and configure MongoDB. This is Best Question answer solution for Ubuntu.

Also Read: How to configure mongodb with php

Here is step for Install and Configure MongoDB on Ubuntu

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.

mongo --help

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.

mongo

Type help to display command list..

help

Use db.help() to display the database commands

db.help()

show dbs: to display all databases.

show dbs

Follow below link for more shell commands..
http://docs.mongodb.org/manual/reference/mongo-shell/

Leave a Reply