How Can I Install a MongoDB Client?
MongoDB official website provides client installation packages for different OSs. Download the official package at https://www.mongodb.com/try/download/community-edition/releases/archive.

- The following uses RedHat/CentOS 8.0 ×64 and MongoDB 4.2.25 as examples to describe how to obtain the required installation package and install the MongoDB client.
- During the installation, select a client version that matches the instance version based on the actual operating system.
Procedure
- Obtain the installation package.
- Access https://www.mongodb.com/try/download/community-edition/releases/archive.
- Select version 4.2.25, platform RedHat/CentOS 8.0 ×64, and package tgz, as shown in MongoDB page.
- Use either of the following methods to upload the installation package to the ECS:

For details about how to log in to an ECS, see How Can I Create and Log In to an ECS?
- Click to download the binary installation package of version 4.2.25. The name of the installation package is mongodb-linux-x86_64-rhel80-4.2.25.tgz. Upload the installation package to the ECS.
- Obtain the download link, log in to the ECS, and run the wget link command.

Replace link with the actual download link address.
- Decompress the installation package on the ECS.
tar zxvf mongodb-linux-x86_64-rhel80-4.2.25.tgz

Replace the installation package name with the actual one.
- Access the bin directory where the installation package is located.
cd mongodb-linux-x86_64-rhel80-4.2.25/bin

Replace the installation package name with the actual one.
The common tools are as follows:
- MongoDB client mongo
- Data export tool mongoexport
- Data import tool mongoimport
- Make the packages executable.
- Run the chmod +x mongo command to grant a client permission to connect to an instance.
- Run the chmod +x mongoexport command to grant a client permission to export data.
- Run the chmod +x mongoimport command to grant a client permission to import data.
- Connect to an instance from the client. For details, see Connecting to a Cluster Instance, Connecting to a Replica Set Instance, and Connecting to a Single Node Instance.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.


