How to install MongoDB on Ubuntu 16.04

MongoDB 3.6 Ubuntu Install

sudo mkdir -p "/etc/apt/sources.list.d"
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee "/etc/apt/sources.list.d/mongodb-org-3.6.list"
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
sudo apt-get update
sudo apt-get install -y mongodb-org

MongoDB 3.4 Ubuntu Install

sudo mkdir -p "/etc/apt/sources.list.d"
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee "/etc/apt/sources.list.d/mongodb-org-3.4.list"
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
sudo apt-get update
sudo apt-get install -y mongodb-org

Leave a comment

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

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