MongoDB installation

Installation Of MongoDB Database Server On Redhat/Cent0s 7

MongoDB is an open source cross-platform documented-oriented database program. It stores the data in JSON like documents with dynamic schemas. Other database stores the data in table and rows.

Features of MongoDB Database:

  • Provides high performance
  • Load balancing
  • Duplication of data
  • Replication
  • Indexing
  • Supports map reduce and aggregation tools

Default port number is 27017

Main configuration file is /etc/mangod.conf

Mongodb provides supported Packages in their own repository,

  1. Mongodb-org-server = keeps mongod daemon and associated configuration files & init scripts
  2. Mongodb-org-mongos = contains mongos daemon
  3. Mongodb-org-shell = Contains mongo shell
  4. Mongodb-org-tools = Contains mongodb tools like exports , dump , start , restore and more.

Let’s install

You will have to add mongodb repository in your system.

You can manually download the Packages from here Download

Vim /etc/yum.repos.d/mongo-repo

Yum install mongodb-org –y

Now start the service,

Systemctl start mongod

Now Set The Selinux, I would recommend to disable selinux but if you do not want, follow this

semanage port -a -t mongod_port_t -p tcp 27017

Check mongoDB version

Mongod –version


Check if it’s listening on port

Netstat –antup | grep 27017

Now try to access Mongodb Server,


If you face any authorization issue, edit the file /etc/mongod.conf

Turn it from here

You can also see default databases

Show dbs

You’re done



Please enter your comment!
Please enter your name here