How to Install and Configure MongoDb on Redhat 7/CentOS 7

How do I install the latest mongoDB database server and components in Redhat 7 or a centos 7 box?

There are no Mongodb packages available in the default yum repository. You need to add the mongoDb repository and then install and configure it. Follow the guide given below which has the steps for the same.

Install MongoDb on Redhat 7/CentOS 7

1. Add repository

2. Install mongodb.

3. Set SElinux content for mongodb port, if it is in enforcing mode. You can check the SELinux status using “sestatus” command.

4. Start MongoDB service.

You can check the mongoDB logs using the following command.

5. Add mongod service to boot.

6. To stop and restart mongoDB service, you can use the following commands.

Enable MongoDB Remote Access

By default mongoDb can be accessed only on the installed host. If you want remote access of mongodb instance, you need to do the following configuration.

1. Open mongod.conf file

2. Search for bindIP parameter in the file, and repalace its value to as shown below. If you want to bind the mongodb service to a specific port, you can replace to the IP.

3. restart the mongod service.


SSL (Secure Socket Layer) is a protocol , which establishes a secure connection between a web browser and the server so…

Read more

I have an application running on port 8080. I want to check if the port is open and the application is successfully…

Read more

Note: In Linux, everything is treated as files. Even folders are treated as files. There will be situations where…

Read more

Internet is huge! Help us find great content


Never miss a thing! Sign up for our newsletter to stay updated.


The Best Tutorials & Tips to Speedup Your DevOps Workflow.

Created by Bibin Wilson.



Udemy Black Friday Offer Courses For $9.99 For Limited Time