How to Install MongoDB 4.x on CentOS

How to Install MongoDB 4.x on CentOS

December 10, 2019

MongoDB is a popular NoSQL database system that provides scalability, high performance, and availability. In this step-by-step guide, we’ll walk through the installation process for MongoDB 4.x Community Edition on CentOS.

Prerequisites

Before you begin, ensure that you have the following prerequisites:

  • A CentOS system (version 7 or 8)
  • Administrative privileges (you can use sudo)

MongoDB

Installation Steps

1. Configure the Package Management System (yum)

Create a file named /etc/yum.repos.d/mongodb-org-4.4.repo to set up the MongoDB repository for installation using yum. You can use the following command to create the file:

sudo vi /etc/yum.repos.d/mongodb-org-4.4.repo

Add the following content to the file:

[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc

2. Install MongoDB Packages

Open a terminal and run the following command to install the latest stable version of MongoDB:

sudo yum install -y mongodb-org

Alternatively, if you want to install a specific release of MongoDB, specify each component package individually and append the version number to the package name. For example:

sudo yum install -y mongodb-org-4.4.29 mongodb-org-server-4.4.29 mongodb-org-shell-4.4.29 mongodb-org-mongos-4.4.29 mongodb-org-tools-4.4.29

3. Start MongoDB Service

After installation, start the MongoDB service using the following command:

sudo systemctl start mongod

4. Enable MongoDB to Launch on Boot

To ensure MongoDB starts automatically when your system boots up, enable it with:

sudo systemctl enable mongod

5. Access MongoDB Shell

To interact with MongoDB, open the MongoDB shell by entering:

mongo

Conclusion

You’ve successfully installed MongoDB on CentOS! Feel free to explore its features and start building your applications. Remember to check the official MongoDB documentation for any additional details or troubleshooting tips. Happy coding! 🚀🌟

Congratulations! You have successfully installed MongoDB server on your system. For practice, you may use the MongoDB browser shell.

References:
http://docs.mongodb.org/manual/installation/

13 Comments

  1. discount androxal real price August 16, 2025 at 4:55 pm

    cheap androxal australia pharmacy

    ordering androxal usa pharmacy

  2. how to order enclomiphene uk pharmacy August 16, 2025 at 4:57 pm

    cheap enclomiphene cheap in canada

    cheap enclomiphene generic from the uk

  3. buy cheap rifaximin how to purchase viagra August 17, 2025 at 1:54 am

    rifaximin the 800 number to place order

    get rifaximin generic drug india

  4. order xifaxan August 17, 2025 at 1:57 am

    buy xifaxan american pharmacy

    buy xifaxan buy in london

  5. ordering staxyn low cost August 17, 2025 at 3:24 am

    how to buy staxyn how to purchase viagra

    discount staxyn cheap online canada

  6. how to order avodart price uk August 17, 2025 at 3:25 am

    buy avodart canada suppliers

    buy cheap avodart american express

  7. buying dutasteride price south africa August 17, 2025 at 4:43 am

    ordering dutasteride uk buy over counter

    online order dutasteride retail price

  8. purchase flexeril cyclobenzaprine usa cheap

    buy flexeril cyclobenzaprine generic when will be available

  9. online order gabapentin uk meds August 17, 2025 at 5:41 am

    cheapest buy gabapentin us prices

    order gabapentin buy in london

  10. fildena cod delivery next day August 17, 2025 at 5:47 am

    how to buy fildena usa seller

    order chewable fildena

  11. Buy itraconazole online perscription August 17, 2025 at 6:36 am

    how to order itraconazole lowest price

    cheapest buy itraconazole generic ingredients

  12. kamagra žádná předpisová kanada

    na dobírku online recepty kamagra

  13. acheter kamagra gracieux August 17, 2025 at 7:20 am

    medicament kamagra pharmacie gracieux ans

    kamagra avec un médecin consulter

Leave A Comment

ZiniSoft

Hello! We are a group of skilled developers and programmers.

Hello! We are a group of skilled developers and programmers.

We have experience in working with different platforms, systems, and devices to create products that are compatible and accessible.