Installing the mongocxx driver


  • Any standard Unix platform, or Windows 7 SP1+
  • A compiler that supports C++11 (gcc, clang, or Visual Studio)
  • CMake 3.2 or later
  • boost headers (optional)

If you encounter build failures or other problems with a platform configuration that meets the above prerequisites, please file a bug report via JIRA.


To configure and install the driver, follow the instructions for your platform:

Advanced Options

Package Managers

The Mongo C++ driver is available in the following package managers.

Vcpkg Install Instructions

If you do not already have Vcpkg installed, install it with the following command:

$ git clone
$ cd vcpkg
$ ./

Optionally, to install with Visual Studio integration:

vcpkg integrate install

Install the driver. (You may need to git pull to get the latest version of the driver)

$ ./vcpkg install mongo-cxx-driver

You can use the toolchain file, vcpkg.cmake, to instruct CMake where to find the development files, for example:

-DCMAKE_TOOLCHAIN_FILE=/<path to vcpkg repo>/vcpkg/scripts/buildsystems/vcpkg.cmake

You can find the header files in:

vcpkg/installed/<CPU ARCHITECTURE>-<OPERATING SYSTEM>/include/

The library files are in:


Conan Install Instructions

Package Specifier: mongo-cxx-driver/3.8.0

If you do not already have Conan installed, then install it and run the Conan initalization command below:

$ pip install conan
$ conan profile detect --force

Add the following to your conanfile.txt


Install the driver via Conan, and build your project:

$ conan install conanfile.txt --output-folder=build --build=missing
$ cmake \
	-B build \
	-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \
$ cmake --build build


For MacOS users, homebrew is a convienent way to install the C++ driver.

brew install mongo-cxx-driver

For an Apple Silicon Mac

Headers can be found in:


Library files can be found in:


For an Intel Mac

Headers can be found in:


Library files can be found in:


Docker Image

You can find a pre-built docker image for the C++ driver in Docker Hub.