Contents
1. About MongoDB :
MongoDB is a NoSQL database intended for storing large amounts of data in document-oriented storage with dynamic schemas. NoSQL refers to a database with a data model other than the tabular format used in relational databases such as MySQL, PostgreSQL, and Microsoft SQL. MongoDB features include: full index support, replication, high availability, and auto-sharding.
1. Install MongoDB in Ubuntu :
Step 1 – Importing the Public Key:
First import public key of MongoDB apt repository in our system using following command.
1 |
[user@localhost $] sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 |
Step 2 – Create source list file MongoDB:
Lets add MongoDB APT repository url in /etc/apt/sources.list.d/mongodb.list.
For Ubuntu:
1 |
[user@localhost $] echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list |
For Debian:
1 |
[user@localhost $] echo "deb http://repo.mongodb.org/apt/debian "$(lsb_release -sc)"/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb.list |
Step 3 – Update the repository:
update the repository with the apt command:
1 |
[user@localhost $] sudo apt-get update |
Step 4 – Install MongoDB:
Now you can install MongoDB by typing this command:[user@tutorials-space $] apt-get install mongodb -y
Step 5 – Start MongoDB Service:
To start or stop MongoDB use init script. Below are the example commands to do.
1 |
[user@localhost $] sudo service mongodb start |
To restart MongoDB service run this command:
1 2 3 |
[user@localhost $] sudo service mongodb restart mongodb stop/waiting mongodb start/running, process 30385 |
Step 6 – Verify MongoDB version:
Finally to check installed MongoDB version you can use the below command:
1 |
[user@localhost $] mongod --version<br>sudb version v2.0.4, pdfile version 4.5<br>Fri Jan 1 19:20:35 git version: nogitversion |
5. Conclusion
In this post, i have explained How To Install and Secure phpMyAdmin on Ubuntu.
If you have any questions or feedback, feel free to leave a comment.
As always, if you found this post useful, then click like and share it 🙂