First, install MongoDB from ports: sudo port install mongodb Second: sudo mkdir /opt/local/etc/mongodb and save what follows as /opt/local/etc/mongodb/mongod.conf # configuration file /opt/local/etc/mongodb/mongod.conf # Store data alongside MongoDB instead of the default, /data/db/ dbpath = /opt/local/var/db/…