Top Hosting Forum

WebHosting Reviews Forum

How to Install MongoDB in CentOS?

Virtual Private Server Forum and Dedicated Server Forum - Discussion on dedicated server and VPS issues - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting

Hosting Forum Description
Virtual Private Server Forum and Dedicated Server Forum - Discussion on dedicated server and VPS issues

How to Install MongoDB in CentOS?

Postby darshan » Mon Jan 28, 2019 8:22 pm

MongoDB is a Free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB avoids the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster.

Following are the steps to install the MongoDB in centOS:

Step - 1: Login to the system via SSH.

Step - 2: Create a MongoDB repository file using an editor as below.

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

Step -3: If you are running a 64-bit system, add the below information to the file you have created.


name=MongoDB Repository




Step - 4: Press CTRL+x to exit and press Y to save the file

Step - 5: It will ask to confirm filename and path. Just press enter.

Step - 6: As a best practice, we should also update our package using below command.

yum -y update

Step - 7: Now, run below command to install MongoDB.

yum -y install mongodb-org mongodb-org-server

That's it. MongoDB is installed.

Ad: There You can have your forum site-wide banner/text ad for $19 monthly. Contact admin

AccuWeb Hosting - One stop shop for your hosting needs.
Posts: 144
Joined: Tue Mar 04, 2014 4:16 pm

Re: How to Install MongoDB in CentOS?

Postby akshaypandit » Wed Feb 27, 2019 8:17 am

Using .rpm Packages (Recommended)
Configure the package management system (yum).

Create a /etc/yum.repos.d/mongodb-org-4.0.repo file so that you can install MongoDB directly using yum:

Code: Select all
name=MongoDB Repository

Install the MongoDB packages.

To install the latest stable version of MongoDB, issue the following command:

Code: Select all
sudo yum install -y mongodb-org

To install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example:
Code: Select all
sudo yum install -y mongodb-org-4.0.6 mongodb-org-server-4.0.6 mongodb-org-shell-4.0.6 mongodb-org-mongos-4.0.6 mongodb-org-tools-4.0.6

You can specify any available version of MongoDB. However yum upgrades the packages when a newer version becomes available. To prevent unintended upgrades, pin the package. To pin a package, add the following exclude directive to your /etc/yum.conf file:

Code: Select all

Posts: 58
Joined: Wed Feb 27, 2019 7:26 am

Return to VPS & Dedicated Server Forum

Who is online

Users browsing this forum: No registered users and 0 guests