How Do You Install MongoDB on a Debian/Ubuntu Linux Server?

Problem scenario
You want to install MongoDB on an Ubuntu/Debian Linux server.  How do you do this?

1.  If you know your distribution of Linux, go to step #2.  Otherwise try this command:  cat /etc/*-release

2.  Do one of the following that corresponds to your distribution of Linux:

On Debian:  sudo apt-get -y install mongodb mongodb-server

On Ubuntu 16.x or Ubuntu 17.x run these two commands (that may span three lines):

curl > /tmp/mongodb-org-server_3.6.4_amd64.deb
dpkg -i /tmp/mongodb-org-server_3.6.4_amd64.deb

3.  To test:  mongod -version

If you want to install MongoDB on a RedHat derivative of Linux, please see this posting.

Leave a comment

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