Install MongoDB 4 on CentOS 7

Create file

vi /etc/yum.repos.d/mongodb-org-4.0.repo

Add

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

Install MongoDB with

yum install -y mongodb-org

Set MongoDB to start on boot.

chkconfig mongod on

Start MongoDB

service mongod start

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *