The default port that MongoDB runs on is 27017 and to change it we have to edit MongoDB's main configuration file, which for Linux Ubuntu/CentOS is mongod.conf and for Windows its mongod.cfg.
The default port that MongoDB runs on is 27017 and to change it we have to edit MongoDB's main configuration file, which for Linux Ubuntu/CentOS is mongod.conf and for Windows its mongod.cfg.