Installing the Database Tools on Linux
On this page
Overview
The MongoDB Database Tools are a suite of command-line utilities for working with MongoDB. Use this guide to install the Database Tools on the Linux platform.
You can use the MongoDB Database Tools to migrate from a self-hosted deployment to MongoDB Atlas. MongoDB Atlas is the fully managed service for MongoDB deployments in the cloud. To learn more, see Seed with mongorestore.
To learn all the ways you can migrate to MongoDB Atlas, see Migrate or Import Data.
Versioning
Starting with MongoDB 4.4, the MongoDB Database Tools are now released separately
from the MongoDB Server and use their own versioning, with an initial
version of 100.0.0
. Previously, these tools were released
alongside the MongoDB Server and used matching versioning.
For documentation on the MongoDB 4.2 or earlier versions of these tools, reference the MongoDB Server Documentation for that version of the tool:
Compatibility
MongoDB Server Compatibility
MongoDB Database Tools version 100.10.0
supports the following versions
of the MongoDB server:
MongoDB 7.0
MongoDB 6.0
MongoDB 5.0
MongoDB 4.4
MongoDB 4.2
While the tools may work on earlier versions of MongoDB server, any such compatibility is not guaranteed.
Platform Support
The MongoDB Database Tools version 100.10.0
are supported on the following
platforms on the x86_64
architecture:
Amazon Linux 2 and 2013.03+
Debian 10 and 9
RHEL / CentOS 8, 7, and 6
SUSE 12
Ubuntu 20.04, 18.04, and 16.04
In addition, the Database Tools also support select Linux platforms
on the arm64
, ppc64le
, and s390x
architectures. See
Supported Platforms for more
information.
Note
Starting in version 100.9.5
, database tools no longer supports the
Debian 8 operating system.
Installation
The MongoDB Database Tools can be installed with your Linux distribution's package
manger or downloaded as a .tgz
archive. Select the appropriate tab
based on your Linux distribution and desired package from the tabs
below:
To install the
.deb
package on Ubuntu and Debian, click theDEB Package
tab.To install the
.rpm
package on RHEL / CentOS / SUSE, click theRPM Package
tab.To install the
.tgz
tarball, click theTGZ Archive
tab.
Note
If you have already installed the MongoDB Server via your system's package manager, you likely already have the Database Tools installed. The following command will determine if the Database Tools are already installed on your system:
sudo dpkg -l mongodb-database-tools
Download the Database Tools .deb
package.
Open the MongoDB Download Center. Using the drop-down menu on the right-hand side of the page:
Select your Linux Platform and Architecture
Select the
deb
PackageClick the Download button
If installing on a headless Linux system, click Copy Link
to the right of the Download button to copy the download
link, then use a command line tool such as wget
or curl
to
download the .deb
directly on your Linux system.
Install the downloaded package.
Navigate to the directory containing the downloaded .deb
package,
then run the following command to install the Database Tools using
the apt
package manager:
sudo apt install ./mongodb-database-tools-*-100.10.0.deb
Note
Be sure to include the leading ./
in the command above,
which instructs apt
to look for this file in the local
directory instead of searching remote repositories.
Note
If you have already installed the MongoDB Server via your system's package manager, you likely already have the Database Tools installed. The following command will determine if the Database Tools are already installed on your system:
sudo yum list installed mongodb-database-tools
Download the Database Tools .rpm
package.
Open the MongoDB Download Center. Using the drop-down menu on the right-hand side of the page:
Select your Linux Platform and Architecture
Select the
rpm
PackageClick the Download button
If installing on a headless Linux system, click Copy Link
to the right of the Download button to copy the download
link, then use a command line tool such as wget
or curl
to
download the .rpm
directly on your Linux system.
Download the Database Tools .tgz
archive.
Open the MongoDB Download Center. Using the drop-down menu on the right-hand side of the page:
Select your Linux Platform and Architecture
Select the
tgz
PackageClick the Download button
If installing on a headless Linux system, click Copy Link
to the right of the Download button to copy the download
link, then use a command line tool such as wget
or curl
to
download the .tgz
directly on your Linux system.
Make the DB Tools available in your PATH
.
You may wish to make the Database Tools available in your system's
PATH
environment variable, which allows referencing each tool
directly on the command line by name, without needing to specify its
full path, or first navigating to its parent directory.
You can either:
Copy the DB Tools binaries from the extracted directory into a directory already listed in your
PATH
, such as/usr/local/bin
. Navigate into the extracted directory, then run the following command to copy the binaries:sudo cp * /usr/local/bin/ Add the DB Tools installation directory to your PATH, by editing your shell's configuration file. For example, in
bash
, you would edit the~/.bash_profile
file.