Install MongoDB
cat > /tmp/mongodb.list << EOF
deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse
EOF
sudo mv /tmp/mongodb.list /etc/apt/sources.list.d/
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
sudo apt-get update
sudo apt-get install -y mongodb-org
cat > /tmp/mongodb.service << EOF
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
EOF
sudo mv /tmp/mongodb.service /etc/systemd/system
sudo systemctl start mongodb
sudo systemctl enable mongodb