linux restart mongodb code example Example 1: mongo restart sudo service mongod start Example 2: mongodb restart command ubuntu sudo systemctl restart mongod