https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
Install MongoDB
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
# Ubuntu 12.04
echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
# Ubuntu 14.04
echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
# Ubuntu 16.04
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
apt-get update
apt-get install -y mongodb-org
Conf file
/etc/mongod.conf
Start MongoDB
service mongod start
Stop MongoDB
service mongod stop
Restart MongoDB
service mongod restart
Remove MongoDB
# Stop MongoDB
service mongod stop
# Uninstall MongoDB
apt-get purge mongodb-org*
# Remove confing and log file
rm -r /var/log/mongodb
rm -r /var/lib/mongodb