Search code examples
mongodbstartup

Start mongod service at system startup


I recently updated mongodb, and I run Linux Mint (an Ubuntu based system) and every time I start it up, i cannot use Robomongo because the service mongod is not automatically started; every time I need to open up a terminal and use

sudo service mongod start

Is there a way to start mongod automatically at system start?


Solution

  • You can either put the command in your /etc/bashrc script under and if condition i.e. if the mongod process is not already running, then start it.

    Other way is to modify your /etc/rc.local and add the command to start mongod in that file. It will start at bootup.