Install mongodb from Ports
cd /usr/ports/databases/mongodb/ make install
Append the following lines to /etc/rc.conf
mongod_config="/usr/local/etc/mongodb.conf" mongod_dbpath="/var/db/mongodb" mongod_enable="YES"
Reboot the machine
reboot
Now after reboot, test the configuration by connecting to the MongoDB server
mongo
The output would be like this if the server has been connected successfully
root@mongoserver:~ # mongo MongoDB shell version: 2.4.8 connecting to: test Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user >