1 Answer
if you've installed the mongoDB,Navigate to the MongoDB configuration file using the vim or your favourite editor and edit the following line
vim /etc/mongod.conf
port :< your desired port number>
Comment the default port number and save thew configuration file
Restart the service of MongoDB
systemctl restart mongod
Your Answer