Add following content in yum repository configuration file mongodb.repo as per your required MongoDB version and system architecture.
CentOS and RedHat systems Only
Fedora users can install it directory from its official yum repositories.
Step 2 – Install MongoDB Server
Let’s use the yum package manager to install mongodb-org package, it will automatically install all its dependencies. To install any specific revision of MongoDB specify package name with version like mongodb-org-4.0.0. The following command will install latest stable version available.
Step 3 – Start MongoDB Service
Package mongodb-org-server provided MongoDB init script, Use that script to start service.
Configure MongoDB to autostart on system boot.
Step 4 – Check MongoDB Version
Use the following command to check installed MongoDB version
Connect MongoDB using the command line and execute some test commands for checking proper working.
Congratulation’s You have successfully installed mongodb server on your system. For practice only you may use MongoDB browser shell.