For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Install libmongocrypt for CSFLE

Learn how to install libmongocrypt, a core component of Client-Side Field Level Encryption.

The libmongocrypt library performs encryption and decryption, and manages communication between the driver and the Key Management System (KMS).

Warning

Do not build libmongocrypt from source. Install and verify the package by following the steps on this page.

Select your operating system for installation steps.

To install on macOS:

1
brew install mongodb/brew/libmongocrypt

To install on Windows:

1

Click here to see the latest libmongocrypt release.

2

The public key for libmongocrypt is available at https://pgp.mongodb.com

To install on Amazon Linux:

1

Replace <linux-version> in the URL with the following, depending on which version of Amazon Linux you are using:

  • Amazon Linux 2023: amazon/2023

  • Amazon Linux 2: amazon/2013.03

  • Amazon Linux: amazon/2

[libmongocrypt]
name=libmongocrypt repository
baseurl=https://libmongocrypt.s3.amazonaws.com/yum/<linux-version>/libmongocrypt/release/x86_64
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/libmongocrypt.asc
2
sudo yum install -y libmongocrypt

To install on Debian:

1

Note

If you are using the extrepo repository manager, you can view and enable the libmongocrypt repository by running the commands:

extrepo search libmongocrypt
sudo extrepo enable libmongocrypt

To configure the repository manually:

  1. Import the public key used to sign the package repositories:

    sudo sh -c 'curl -s --location https://pgp.mongodb.com/libmongocrypt.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/libmongocrypt.gpg'
  2. Add the MongoDB repository to your package sources

    Important

    Change <release> in the following shell command to your platform release (for example "bookworm" or "trixie").

    echo "deb https://libmongocrypt.s3.amazonaws.com/apt/debian <release>/libmongocrypt/release main" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
2
sudo apt-get update
3
sudo apt-get install -y libmongocrypt-dev

To install on Red Hat Enterprise Linux:

1
[libmongocrypt]
name=libmongocrypt repository
baseurl=https://libmongocrypt.s3.amazonaws.com/yum/redhat/$releasever/libmongocrypt/release/x86_64
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/libmongocrypt.asc
2
sudo yum install -y libmongocrypt

To install on Suse:

1
sudo rpm --import https://pgp.mongodb.com/libmongocrypt.asc
2

Important

Change <release> in the following shell command to your platform release (e.g. "12" or "15").

sudo zypper addrepo --gpgcheck "https://libmongocrypt.s3.amazonaws.com/zypper/suse/<release>/libmongocrypt/release/x86_64" libmongocrypt
3
sudo zypper -n install libmongocrypt

To install on Ubuntu:

1

Note

If you are using the extrepo repository manager, you can view and enable the libmongocrypt repository by running the commands:

extrepo search libmongocrypt
sudo extrepo enable libmongocrypt

To configure the repository manually:

  1. Import the public key used to sign the package repositories:

    sudo sh -c 'curl -s --location https://pgp.mongodb.com/libmongocrypt.asc
    | gpg --dearmor >/etc/apt/trusted.gpg.d/libmongocrypt.gpg'
  2. Add the MongoDB repository to your package sources:

    Important

    Change <release> in the following shell command to your platform release (for example "jammy" or "noble").

    echo "deb https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/release universe" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
2
sudo apt-get update
3
sudo apt-get install -y libmongocrypt-dev
Rate this page

On this page