Package installation

To install MongoDB on an Ubuntu/Debian server, you will need root access. A unique feature of Debian-based Linux distributions is that direct login as root is not allowed for security reasons. Accordingly, you can promote yourself to root using su, or you can precede the various commands with sudo, which instructs the OS to process this command as root.

Please proceed as follows:

  1. Import the public key from the MongoDB key server. This is needed so that the package manager can authenticate the MongoDB package:
  1. Add the MongoDB repository to the Linux server's sources list:
The commands listed should be on one line. ...

Get MongoDB 4 Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.