How to Install MongDB on Amazon Linux 2

How to Install MongoDB on Amazon Linux 2

Steps to follow

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

Then paste this content into that file

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

After that, run this

sudo yum install -y mongodb-org

Start MongoDB server by running this command.

sudo systemctl start mongod

Check status by running this command

sudo systemctl status mongod

Everything that is mentioned above is also displayed in this video as well. I hope this will help you to setup MongoDB on your AWS account.

2 thoughts on “How to Install MongoDB on Amazon Linux 2”

  1. Pingback: How to install Nodejs on Amazon Linux 2 – AWS with Atiq

Leave a Comment

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