I installed mongodb for learning purpose, the problem I am facing is that it starts on system boot and consume resources even if not being used. I want it to be removed from system boot, how can I do this?
35 Answers
I can't test it at the moment, but I think this should work
sudo update-rc.d mongodb disableIf this is not enough try this
sudo update-rc.d -f mongodb remove 1 This is borrowed from this answer:
echo manual | sudo tee /etc/init/mongod.override 1 This worked for me and I'm using Ubuntu 18.04:
sudo systemctl disable mongod 1 @davelupt's reference is great. However I guess the command should be
echo manual | sudo tee /etc/init/mongod.override
since the file for MongoDB under /etc/init is mongod.conf.
For Ubuntu 18 and above use
$ sudo systemctl stop mongodFor earlier versions
$ sudo service mongod stopFor MacOS:
$ brew services stop mongodb-community@4.2For Windows, Open CMD as Admin:
sc.exe delete MongoDBMore info can be found here