Step 1: Download the installer: MongoDB Community Server
Example: https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.20-signed.msi
Step 2: Run the MongoDB installer
Example: mongodb-win32-x86_64-2008plus-ssl-4.0.20-signed.msi
Step 3: Follow the MongoDB Community Edition installation wizard
Click Next
Click “I accept…” then click Next
Click complete
You can change Service name, Data directory and Log directory
Click Next
Note: on Windows 7 and MongoDb 4, you can’t install mongodb compass, deselect checkbox Install MongoDB compass
Click Install … wait a few minutes
Done! Now you can see service MongoDB Server on service manager.