Install MongoDB Database Tools
on a GitHub Actions runner. The action adds mongodump, mongorestore,
mongoexport, mongoimport, and the other Database Tools commands to PATH.
This community-maintained action is not affiliated with or endorsed by MongoDB, Inc.
permissions:
contents: read
steps:
- uses: brianlund/setup-mongodb-database-tools@v1
with:
version: "100.17.0"
- name: Dump MongoDB
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
run: mongodump --uri="$MONGODB_URI" --archive=mongodb.archive --gzipPin an exact version for reproducible workflows. Set version to latest to install the latest release:
- uses: brianlund/setup-mongodb-database-tools@v1
with:
version: latestAmazon DocumentDB supports mongodump, mongorestore, mongoexport, and
mongoimport. As of July 2026, AWS recommends MongoDB Database Tools 100.6.1
or earlier for DocumentDB. Pin that version unless AWS updates its
compatibility guidance.
- uses: brianlund/setup-mongodb-database-tools@v1
with:
version: "100.6.1"
- name: Download the Amazon RDS CA bundle
run: |
curl --fail --silent --show-error --location \
https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem \
--output global-bundle.pem
- name: Dump Amazon DocumentDB
env:
DOCUMENTDB_URI: ${{ secrets.DOCUMENTDB_URI }}
run: |
mongodump \
--uri="$DOCUMENTDB_URI" \
--ssl \
--sslCAFile=global-bundle.pem \
--archive=documentdb.archive \
--gzipPlace the runner inside a VPC that can reach the DocumentDB cluster.
| Input | Description | Default |
|---|---|---|
version |
Exact Database Tools version, or latest |
latest |
| Output | Description |
|---|---|
version |
Exact version installed |
path |
Directory containing the installed binaries |
cache-hit |
true when restored from the runner tool cache |
CI tests the action on:
- Ubuntu 24.04 on x64 and ARM64
- macOS 15 on Intel and Apple silicon
- Windows Server 2025 on x64
The action supports compatible self-hosted Ubuntu, Debian, Amazon Linux, RHEL-family, and SUSE runners when MongoDB publishes an archive for the requested version and architecture. On Linux, the action selects the newest published distribution build that is not newer than the runner.
The action uses the Node.js 24 action runtime. Self-hosted runners must use a GitHub Actions runner version that supports Node.js 24 actions.
The action performs these checks:
- Resolves releases from MongoDB's official Database Tools manifests.
- Downloads archives only from
fastdl.mongodb.org. - Verifies the archive against MongoDB's published SHA-256 value.
- Checks that
mongodumpreports the requested version. - Stores the verified installation in the runner tool cache.
Later steps in the same job and persistent self-hosted runners can reuse the cache.
Brian Lund licenses the action source code under the MIT License. The End User License Agreement also governs your use of the action.
This repository does not include MongoDB Database Tools. The action downloads them from MongoDB, and MongoDB's terms govern their use. MongoDB is a registered trademark of MongoDB, Inc.