This installation works for Mac and Linux:
- Download the binary files for the version you want of MongoDB from https://www.mongodb.com/download-center#community.
- Extract the files from the downloaded file; you can use the terminal and use this command:
tar -zxvf mongodb-osx-ssl-x86_64-3.6.3.tgz
- Copy the extracted folder to the location from which MongoDB will run:
mkdir -p mongodb cp -R -n mongodb-osx-ssl-x86_64-3.6.3/ mongodb
- Ensure the location of the binaries is in the PATH variable. You can add the following line in your shell's rc file, such as ~/.bashrc or ~/.bash_profile:
export PATH=<your-mongodb-install-directory>/bin:$PATH