start mongod in background code example Example: run MongoDB manually as a background process macos mongod --config /usr/local/etc/mongod.conf --fork