MongoDB
Installing to Windows

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 Windows
  5. Download
I didn't want to install it to the Program files and not as a Service, so I installed it like this
  1. From below window I chose "Custom"

  2. And then in below window, I clicked "Browse" and I changed the path to c:/mongo

  3. Then in below window I unchecked the option "Install MongoDB as a Service"

  4. Then in below window I checked the option "Install MongoDB Compass"

Now the server (mongod) and the client (mongo) is installed.

Creating the data directory

Before you can start the server, you have to create a folder for the data. By default Mongo is expecting that the folder is c:/data/db. You can create the folder like this:

  • Open the command prompt
  • Execute command md \data\db

Starting the Server

After installing and making the data-folder, you can start the MongoServer

  • Open the command prompt and navigate to the directory (ex. c:\mongo)
  • Execute command bin\mongod to start the server

Connecting to Mongo-Server

When the server is running, you can connect to it. The command-line client is also in the bin-folder, you can start to use it like this:

  • Open the command prompt and navigate to the directory (ex. c:\mongo)
  • Execute command bin\mongo to start the client



Toggle Menu