determine which port mongo db is running

MongoDB only listens on one port by default (27017). If the --rest interface is active, port 28017 (27017+1000) will also be open handling web requests for details.

Image

You can do this from the Operating System shell by running:

sudo lsof -iTCP -sTCP:LISTEN | grep mongo

Advertisement