Navigation

Installing the Database Tools on Linux

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.

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:

Quick links to older documentation

Compatibility

MongoDB Server Compatibility

MongoDB Database Tools version 100.2.1 supports the following versions of the MongoDB server:

  • MongoDB 4.4
  • MongoDB 4.2
  • MongoDB 4.0
  • MongoDB 3.6

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.2.1 are supported on the following platforms on the x86_64 architecture:

  • Amazon Linux 2 and 2013.03+
  • Debian 10, 9, and 8
  • RHEL / CentOS 8, 7, and 6
  • SUSE 12
  • Ubuntu 20.04, 18.04, 16.04, and 14.04

In addition, the Database Tools also support select Linux platforms on the arm64, ppc64le, and s390x architectures. See Supported Platforms for more information.

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 the DEB Package tab.
  • To install the .rpm package on RHEL / CentOS / SUSE, click the RPM Package tab.
  • To install the .tgz tarball, click the TGZ 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
1

Download the Database Tools .deb package.

Open the MongoDB Download Center. Using the drop-down menu on the right-hand side of the page:

  1. Select your Linux Platform and Architecture
  2. Select the deb Package
  3. Click 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.

2

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.2.1.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.

3

Run the installed Tools.

Once installed, you can run any of the Database Tools directly from your system’s command line. Consult the reference page for the specific tool you wish to use for its full syntax and usage.

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
1

Download the Database Tools .rpm package.

Open the MongoDB Download Center. Using the drop-down menu on the right-hand side of the page:

  1. Select your Linux Platform and Architecture
  2. Select the rpm Package
  3. Click 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.

2

Install the downloaded package.

Navigate to the directory containing the downloaded .rpm package, then run the following command to install the Database Tools using the yum package manager:

sudo yum install -y mongodb-database-tools-*-100.2.1.rpm
3

Run the installed Tools.

Once installed, you can run any of the Database Tools directly from your system’s command line. Consult the reference page for the specific tool you wish to use for its full syntax and usage.

1

Download the Database Tools .tgz archive.

Open the MongoDB Download Center. Using the drop-down menu on the right-hand side of the page:

  1. Select your Linux Platform and Architecture
  2. Select the tgz Package
  3. Click 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.

2

Extract the files from the downloaded archive.

Run the following command from the directory containing the downloaded .tgz package:

tar -zxvf mongodb-database-tools-*-100.2.1.tgz
3

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.

4

Run the installed Tools.

Once installed, you can run any of the Database Tools directly from your system’s command line. Consult the reference page for the specific tool you wish to use for its full syntax and usage.