Package Installation Reference#

libbson and libmongoc are available from several package management tools on a variety of systems.

Important

The third-party packages detailed here are not directly controlled via the mongo-c-driver maintainers, and the information found here may be incomplete or out-of-date.

Package Names and Availability#

This table details the names and usage notes of such packages.

Note

The development packages (ending in -dev or -devel) include files required to build applications using libbson and libmongoc.

See also

For a step-by-step tutorial on installing packages, refer to Installing Prebuilt MongoDB C Driver Libraries.

Packaging Tool

Platform(s)

libbson package(s)

libmongoc package(s)

Notes

APT (apt/apt-get)

Debian-based Linux distributions (Debian, Ubuntu, Linux Mint, etc.)

libbson-1.0-0, libbson-dev, libbson-doc

libmongoc-1.0-0, libmongoc-dev, libmongoc-doc

Yum/DNF

RHEL-based systems (RHEL, Fedora, CentOS, Rocky Linux, AlmaLinux)

libbson, libbson-devel

mongo-c-driver-libs, mongo-c-driver-devel

Except on Fedora the EPEL repositories must be enabled (i.e. install the epel-release package first)

APK

Alpine Linux

libbson, libbson-dev, libbson-static

libmongoc, libmongoc-dev, libmongoc-static

pacman

Arch Linux

mongo-c-driver

mongo-c-driver

A single package provides both runtime and development support for both libbson and libmongoc

Homebrew

macOS

mongo-c-driver

mongo-c-driver

Conan

Cross-platform

mongo-c-driver

mongo-c-driver

See: Conan Settings and Features

vcpkg

Cross-platform

libbson

mongo-c-driver

See: vcpkg Optional Features

Conan Settings and Features#

The mongo-c-driver Conan recipe includes several build settings that correspond to the configure-time build settings available when building the mongo-c-driver project.

Setting

Options

Default

Notes

shared

(Boolean)

False

Build the shared library instead of the static library

fPIC

(Boolean)

True

Compile code as position-independent

srv

(Boolean)

True

Enables MongoDB SRV URI support

with_ssl

openssl, libressl, windows, darwin, False

openssl [1]

Select a TLS backend. Setting to “False” disables TLS support.

with_sasl

sspi, cyrus, False

sspi on Windows, False elsewhere

Enable SASL authentication support

with_snappy

(Boolean)

True

Enable Snappy compression

with_zlib

(Boolean)

True

Enable Zlib compression

with_zstd

(Boolean)

True

Enable Zstd compression

vcpkg Optional Features#

The mongo-c-driver package offered by vcpkg supports several optional features.

Feature

Notes

icu

Installs the ICU library, which is necessary for non-ASCII usernames and passwords in pre-1.25 libmongoc

openssl

Use OpenSSL for encryption, even on Windows and Apple platforms which provide a native TLS backend.

If omitted, the default will be to use the preferred TLS implementation for the system.

snappy

Enable the Snappy compression backend

zstd

Enable the Zstd compression backend