[mongodb] make MongoDB available on localhost only
If you want to hide MongoDB from the world and only want to allow connections to it from localhost, then here is a basic config file:
# /etc/mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # Where and how to store data. storage: dbPath: /var/lib/mongodb journal: enabled: true # engine: # mmapv1: # wiredTiger: # where to write logging data. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log # network interfaces net: port: 27017 bindIp: 127.0.0.1
In MongoDB 3.2 WiredTiger is the default storage engine. The interesting part here is the “net” configuration.
I have a Digital Ocean VPS with MongoDB preinstalled and this config file comes from there.