Until now, we have worked with the relational database server, MySQL. In this recipe, we will learn how to install and configure MongoDB, which is a not only SQL (NoSQL) document storage server.
To get the latest version of MongoDB, we need to add the MongoDB source to Ubuntu installation sources:
First, import the MongoDB GPG public key:
$ sudo apt-key adv \ --keyserver hkp://keyserver.ubuntu.com:80 \ --recv 7F0CEB10
Create a
list
file and add an install source to it:$ echo “deb http://repo.mongodb.org/apt/ubuntu “$(lsb_release -sc)”/mongodb-org/3.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
Update the
apt
repository sources and install the MongoDB server:$ sudo apt-get update $ sudo apt-get install -y mongodb-org
After installation completes, check the status of the MongoDB server:
$ sudo service mongod status
Now you can start using the MongoDB...