Installing `mongorestore` on Ubuntu 22.04

When working with MongoDB, the mongorestore utility is an essential tool for restoring databases from BSON dump files. On Ubuntu 22.04, mongorestore is included in the MongoDB Database Tools package, which is distributed separately from the MongoDB server. This guide walks you through the installation process step by step.


Step 1: Import the MongoDB Public GPG Key

Before adding the MongoDB repository, you need to import its public GPG key:


Step 2: Add the MongoDB APT Repository

Add the MongoDB repository to your system’s APT sources:


Step 3: Update the Package List

Update the local package index to include the new MongoDB repository:


Step 4: Install the MongoDB Database Tools

Install the tools package, which includes mongorestore along with other utilities such as mongodump, mongoimport, and mongoexport:


Step 5: Verify the Installation

Confirm that mongorestore is installed and available on your system:

You should see version information confirming that the tool is ready to use.


Notes

  • The MongoDB Database Tools are independent of the MongoDB server package, so you can install them even if your server is managed separately (via snap, Docker, or tarball installation).
  • In addition to mongorestore, the package provides several other useful utilities for backup, import, and export tasks.

With these steps, you’ll have mongorestore installed on your Ubuntu 22.04 system and ready to use for restoring MongoDB databases from backups.

Have a project or a problem?

Talk with a senior engineer for practical recommendations—no obligation.

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.