The beauty of installing MongoDB directly from its source code is that it ensures that you can run MongoDB on any server, and that you have the absolute latest version. Minimum requirements for source installation include:
Libraries needed: build-essential libffi-dev libssl-dev python-dev macOSX Compiler: Clang 3.4 of XCode 5
Libraries: XCode (especially command line tools)
Windows Compiler: Visual Studio 2013 Update 4 or later
The source build process does not follow the traditional sequence of configure, make, and make install. Installation is performed using SCons (Software Construction Tool, https://www.scons.org/), which, in turn, uses the programming language Python. Accordingly, after you clone or download the MongoDB source, you will notice many Python scripts and configuration files.
For the purposes of this illustration, we use CentOS 7. To install MongoDB from source, assuming all prerequisites listed previously are met, proceed as follows:
Download the source code from github.com. There are two ways to download the MongoDB source code from github.com: