MongoDB is an open source, document-oriented free database that is classified as a NoSQL database because it does not rely on the traditional tabular structure of a relational database. Instead, it uses JSON-like documents with dynamic schemas. Unlike relational databases, MongoDB does not require a predefined schema before adding data to the database. You can change the schema at any time and as often as needed, without having to set up a new database with the updated schema.

In this article, we provide you with a quick guide to installing and testing the mongodb daemon using the example of Centos7 OS with sudo -s superuser rights activated in advance.

Adding an up-to-date MongoDB repository

First of all, add the mongodb-org repository to the server, for this, in any editor convenient for you, create a file:

nano /etc/yum.repos.d/mongodb-org.repo

with the following content:


name = MongoDB Repository

baseurl = https: //$releasever/mongodb-org/4.4/x86_64/

gpgcheck = 1

enabled = 1

gpgkey = https: //

After that we apply the updates:

yum update

Installing MongoDB

Now we can install mongodb using the previously added repository:

yum install mongodb-org

After that, you can start the MongoDB service with the following command:

systemctl start mongod

The systemctl utility produces no output after the start command, but we can verify that the service is running by looking at the end of the mongod.log file with the tail command:


As a result, we can see that the server is waiting for a connection, which means that the MongoDB service has started successfully and we can access the database server using the MongoDB Shell:

MongoDB is a multi-threaded application. It can launch additional processes to handle its workload. The warning states that for MongoDB to be as efficient as possible, the number of processes it is allowed to run should be half the number of files it can open at any given time. To resolve this warning, change the soft rlimit for mongod processes by editing the 20-nproc.conf file and adding the following line:

mongod soft nproc 32000

Next, you need to restart the service:

 systemctl restart mongod

Checking running mongodb

The first way to check that the mongod daemon starts up with the system is to run the following command, where output 0 means the daemon has started successfully:

systemctl is-enabled mongod; echo $?

Now, you can continue to customize the database service for your needs by loading the necessary json datasets that are required for your application to work.