How is mongod run in the one-click app?


I have created a one-click droplet with MongoDB. Now I want to set up authentication. I already created users and roles. But I must enable authentication when the process is started and restart the process.

But how exactly is the mongod process started in this one-click app (I don’t want authentication to be disabled if the process needs to be restarted later on)?

I already tried changing the /etc/mongod.conf and rebooting the server (sudo reboot). But it is still possible to login to mongo without specifying a user.

I coud not find anything in the /etc/init.d or in the /etc/systemd/system directories.

This is my mongod.conf:

# mongod.conf

# for documentation of all options, see:

# Where and how to store data.
  dbPath: /var/lib/mongodb
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
  port: 27017


  authorization: enabled




## Enterprise-Only Options:



Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi @sanderdeclerck

According to the manual, the parameter authorization needs to be a string:

So change the config:

  authorization: "enabled"

And then restart MongoDB:

sudo systemctl restart mongod

You can see more in this tutorial:


You may want to take a look at this post for details on how to setup authentication with a user.

As far as starting, stopping and restarting the service, it’ll be done either via:

service mongod restart


systemctl restart mongod

In most cases, especially on newer distros, systemd is used, so the systemctl command would be what you’d use.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel