MongoDB
Installing to Mac

If you want to use MongoDB on Windows, you can install it with these steps:

  1. Navigate to http://www.mongodb.org/downloads
  2. Choose option "On-premises MongoDB locally"
  3. Choose "MongoDB Community Server"
  4. Choose platform Mac
  5. Download

Now you have the tar-file in Downloads and you can extract it by clicking the file.

After you have extracted the tar file do this

  1. Open the Terminal
  2. Move the mongodb-macos-x86_64-5.0.3 folder from Downloads to your home folder with this command
    mv Downloads/mongodb-macos-x86_64-5.0.3 ./
    
  3. Install Compass with the commands
    sudo mongodb-macos-x86_64-5.0.3/bin/install_compass
    
  4. Create folder for mongo data
    mkdir mongodata
    
  5. Now you can start the mongoserver (mongod) with the command
    ./mongodb-macos-x86_64-5.0.3/bin/mongod --dbpath ./mongodata
    
  6. You can start the client(mongo) with the command
    ./mongodb-macos-x86_64-5.0.3/bin/mongo
    
You can exit from the client with the command exit and you can stop the server by pressing CTRL+C



Toggle Menu