How to Install MongoDB on CentOS 7

Install MongoDB on CentOS 7

In this article, we will have explained the necessary steps to install MongoDB on CentOS 7. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

MongoDB is a free, distributed, and an open-source document database at its core that powers high availability, horizontal scaling, and geographic distribution. It stores data in JSON-like documents and supports Ad hoc queries, indexing, and real-time aggregation.

Install MongoDB on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install MongoDB.

Add the MongoDB repository to your system, open your text editor and create a new YUM repository configuration:

Now that the repository is enabled you can install the mongodb-org meta-package using the yum utility:

Once the installation is completed, start the MongoDB daemon and enable it to start on boot by typing:

Use the following command to check installed MongoDB version:

Congratulation, you have learned how to install MongoDB on CentOS 7. If you have any question, please leave a comment below.