Follow the steps below to install the latest stable version of MongoDB on your CentOS server :
Enabling MongoDB repository
To add the MongoDB repository to your system, open your text editor and create a new YUM repository configuration file named mongodb-org.repo inside the /etc/yum.repos.d/ directory:
nano /etc/yum.repos.d/mongodb-org.repo
[mongodb-org-4.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
If you want to install an older version of MongoDB, replace each instance of 4.0 with your preferred version. Continue reading “Install MongoDB on CentOS 7” »