Install MongoDB on AWS Ubuntu EC2 Instance

In the earlier blogs we see about installing the other relational databases in the AWS EC2 instances, now I started exploring the options to integrate the NoSQL database with our Backup and DR application

In this blog lets see on Installing MongoDB Community Edition on Ubuntu 18.04 EC2 instance in AWS

Installing the MongoDB in ubuntu via aptitude is very simple

To install MongoDB Community on your Ubuntu system, these instructions will use the official mongodb-org package, which is maintained and supported by MongoDB Inc.

Import the public key used by the package management system

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -

Add Sources

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

Reload local package database.

sudo apt update

Install the MongoDB packages.

sudo apt install -y mongodb-org

Start and verify the service

sudo systemctl start mongod
sudo systemctl status mongod

Enable the service start on every reboot

sudo systemctl enable mongod

Also published on Medium.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading