Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Run mongod with some decent settings on startup

Create the mongod.conf and insert the config content.

sudo vim /usr/local/var/mongodb/mongod.conf

Grab the path to mongod. which mongod

Create the org.mongo.mongod.plist file and insert the plist content and update the path to mongod.

sudo vim /Library/LaunchDaemons/org.mongo.mongod.plist

Assign the right permissions to it and load it.

sudo chown root:wheel /Library/LaunchDaemons/org.mongo.mongod.plist
sudo launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist


# Location of MongoDB databases
dbpath = /usr/local/var/mongodb
# Location of log files
logpath = /usr/local/var/log/mongodb/mongo.log
# Only accept local connections
bind_ip = localhost
# Enable journaling
journal = true
# Enable REST
rest = true
# Enable smaller default file sizes
# (saves space on development servers)
smallfiles = true
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment