How To Install MongoDB on FreeBSD

MongoDB is a very powerful resource and fast NoSQL database. As for the repositories on Debian, they update very slowly and often contain outdated versions of packages. This article’ll work for both x86 and x64 architectures, but note that MongoDB works best on 64-bit architectures.

Update the package repository

\Before installing MongoDB, you need to make sure everything is up to date. This can be done by running the following command accordingly:

pkg update

There may be the following message stating that “package management tool” is not available, type Y, press Enter to continue. You can run pkg update -f a forced update if needed. If unsuccessful, go to step 2 – Installing MongoDB

Installing MongoDB

Install MongoDB using the following command:

pkg install mongodb

Start and Test The Installation of MongoDB

Check your MongoDB installation. This command will start the service:

service mongod onestart

The consol’ll look loke this:

MongoDB shell version: 4.4
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

Turn the MongoDB at each boot

If you don’t want to use “onestart” to start Mongo on boot, you can configure it to run start instead. To do this, you need to edit /etc/rc.conf. with vi or any other text editor and add mongod_enable = “YES” to the file. Once finished, it will start when your server boots up and you can now use its service mongod start to start the Mongo service. Other service commands such as stop and status will also be available.

You can try the Hostry’s VPS here

Was this article helpful?

Related Articles

Leave A Comment?