find port in mongodb code example Example: how to know on which port my mongodb server is running Click to copysudo lsof -iTCP -sTCP:LISTEN | grep mongo