The official MongoDB website provides up-to-date packages containing binaries for installing MongoDB on Linux, OS X, and Windows.
Installing and configuring MongoDB
Getting ready
Visit the official website of MongoDB at https://www.mongodb.com/download-center, select Community Server, and then select your preferred operating system version of the software and download it.
Installing MongoDB and configuring it may require additional steps.
How to do it...
Visit the documentation website of MongoDB at https://docs.mongodb.com/master/installation/ for instructions and check the Tutorials section for your specific platform.
After installation, an instance of mongod-, the daemon process for MongoDB-, can be started in a standalone fashion:
- Open a new Terminal
- Create a new directory named data, which will contain the Mongo database
- Type mongod --port 27017 --dbpath /data/ to start a new instance and create a database
- Open another Terminal
- Type mongo --port 27017 to connect a Mongo shell to the instance
There's more...
As an alternative, you can opt to use a Database as a service (DBaaS) such as MongoDB Atlas, which, at the time of writing, allows you to create a free cluster with 512 MB of storage. Another simple alternative is mLab, although there are many other options.