Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
Database Manual
/ / / /

Installation Requirements

Learn about the applications and libraries you must install to use Client-Side Field Level Encryption (CSFLE).

Before you can use CSFLE, you must set up the following items in your development environment:

  • (Optional) Download the Automatic Encryption Shared Library. The Automatic Encryption Shared Library is a preferred alternative to mongocryptd and does not require spawning a new process. mongocryptd is still supported.

  • Install MongoDB Enterprise Edition.

  • Install a MongoDB Driver Compatible with CSFLE.

  • Start a MongoDB instance or Atlas Cluster.

  • Ensure that you're using an x64 operating system. CSFLE requires x64 support.

If you're using driver version 3.0 or later, you must also complete the following steps:

<PropertyGroup>
<!-- replace the version here with your package version -->
<MongoDriverEncryptionVersion>3.4.2</MongoDriverEncryptionVersion>
<MongoDriverEncryptionPath>$(NuGetPackageRoot)mongodb.driver.encryption\$(MongoDriverEncryptionVersion)</MongoDriverEncryptionPath>
</PropertyGroup>
<PropertyGroup>
<!-- Suppresses the duplicate file error -->
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<!-- Ensures the correct library after build or publish -->
<Target Name="EnsureCorrectMongoEncryption" AfterTargets="Build;Publish" Condition="'$(RuntimeIdentifier)' != ''">
<!-- Determine paths based on current operation -->
<PropertyGroup>
<_TargetDir Condition="Exists('$(PublishDir)')">$(PublishDir)</_TargetDir>
<_TargetDir Condition="'$(_TargetDir)' == ''">$(OutputPath)</_TargetDir>
</PropertyGroup>
<!-- Copy the correct library based on runtime identifier (RID) -->
<ItemGroup>
<_CorrectMongoLib Include="$(MongoDriverEncryptionPath)/runtimes/linux/native/x64/libmongocrypt.so"
Condition="'$(RuntimeIdentifier)' == 'linux-x64'" />
<_CorrectMongoLib Include="$(MongoDriverEncryptionPath)/runtimes/linux/native/arm64/libmongocrypt.so"
Condition="'$(RuntimeIdentifier)' == 'linux-arm64'" />
<_CorrectMongoLib Include="$(MongoDriverEncryptionPath)/runtimes/linux/native/alpine/libmongocrypt.so"
Condition="'$(RuntimeIdentifier)' == 'linux-musl-arm64'" />
</ItemGroup>
<!-- Copy with overwrite -->
<Copy SourceFiles="@(_CorrectMongoLib)"
DestinationFolder="$(_TargetDir)"
Condition="'@(_CorrectMongoLib)' != ''"
OverwriteReadOnlyFiles="true" />
<Message Text="Fixed MongoDB encryption library for $(RuntimeIdentifier)"
Condition="'@(_CorrectMongoLib)' != ''" />
</Target>
  • Install libmongocrypt. The libmongocrypt library contains bindings to communicate with the native library that manages the encryption.

  • Install mongodb-crypt. The mongodb-crypt library contains bindings to communicate with the native library that manages the encryption.

  • Install mongodb-client-encryption, a Node.js wrapper for the libmongocrypt encryption library. The libmongocrypt library contains bindings to communicate with the native library that manages the encryption.

When using Node.js driver version 6.0.0 or later, mongodb-client-encryption must have the same major version number as the driver.

For example, Node.js driver v6.x.x requires mongodb-client-encryption v6.x.x.

  • Install pymongocrypt, a Python wrapper for the libmongocrypt encryption library. The libmongocrypt library contains bindings to communicate with the native library that manages the encryption.

To start using CSFLE, see CSFLE Quick Start.

To learn how to use CSFLE with a remote Key Management System provider, see CSFLE Tutorials.

Back

Features

On this page