Skip to content

Install

MongoShield needs Node.js 22.12 or newer. It also runs on Bun 1.4 and Deno 2.9 or newer (bunx --bun mongoshield, deno run -A npm:mongoshield); see the Bun and Deno guide for what is tested there.

Run it without installing:

Terminal window
npx mongoshield --help

Or install it into a project (recommended, so the version is pinned):

Terminal window
npm install --save-dev mongoshield mongodb
npx mongoshield --help

A Docker image is also available (ghcr.io/shamalrathnayake/mongoshield); see the Docker guide.

Terminal window
npm install mongoshield mongodb

mongodb (driver 6.10+ or 7.x) is a peer dependency, so MongoShield uses the same driver version as your application and can share its MongoClient.

Cloud SDKs are optional peer dependencies. Install only what you use; MongoShield loads them lazily and tells you which package is missing if one is needed.

ForInstall
S3, Cloudflare R2, Backblaze B2, MinIO, DigitalOcean Spaces, Wasabi@aws-sdk/client-s3 @aws-sdk/lib-storage
Google Cloud Storage@google-cloud/storage
Azure Blob Storage@azure/storage-blob @azure/identity
SFTPssh2
AWS KMS@aws-sdk/client-kms
Google Cloud KMS@google-cloud/kms
Azure Key Vault@azure/keyvault-keys @azure/identity
OpenTelemetry traces and metrics@opentelemetry/api

Local directories, Google Drive (gdrive://, plain fetch) and the in-memory storage used in tests need nothing extra.

The CLI and config file name storage with a URL. Credentials never go in the URL; each service uses its usual credential chain (AWS environment and profiles, Google Application Default Credentials, Azure DefaultAzureCredential, an SSH key or agent, a Dropbox refresh token in MONGOSHIELD_DROPBOX_TOKEN).

URLStorage
./backups, /var/backups, file:///abs/patha local directory
s3://bucket/prefix?region=…&endpoint=…S3 or an S3-compatible service
gs://bucket/prefixGoogle Cloud Storage
az://account/container/prefixAzure Blob Storage
sftp://user@host:port/path?fingerprint=SHA256:…SFTP
gdrive://folderGoogle Drive (token in MONGOSHIELD_GDRIVE_TOKEN, from mongoshield login gdrive)
dropbox://folderDropbox (App folder; token from mongoshield login dropbox in MONGOSHIELD_DROPBOX_TOKEN)

An endpoint=… parameter is a plain https://host[:port]: one with user info or a query string (an Azure SAS token, presigned S3 parameters) is refused, because those are credentials. On az:// URLs that sign in with DefaultAzureCredential, an endpoint outside Azure Storage's own domains (*.core.windows.net and the sovereign clouds) is refused too, since the credential sends it a bearer token; add allowCustomEndpoint=true for a host you trust, such as Azurite.

You do not need it to use MongoShield. It is worth having on the machine where you keep your recovery key, so you can confirm you could decrypt a backup without MongoShield (age installation).