Code‎ > ‎

MongoDB installation

Installing and running MongoDB

Download and extract the MongoDB distribution for your system.

By default MongoDB will store data in /data/db/ which means you need to create and set the properties for that folder. You can use any other location if you'd like just remember to give the server the --dbpath option.

sudo mkdir -p /data/db/
sudo chown `id -u` /data/db/

Run the server in a terminal window or use whatever means necessary to start the server process: ./<mongodb_location>/bin/mongod.

You can test whether it works by running ./<mongodb_location>/bin/mongo.

  • Default connection port: 27017
  • Default webadmin port: 28017

For more information read the manual.