Installing MongoDB on Linux

This section will cover steps for a Centos or RHEL environment as an example. For more information on installing MongoDB on other Operating Systems, refer to the MongoDB documentation here (Install MongoDB).

About this task

To install MongoDB 4.4 on Linux, use the following MongoDB 4.2 example as a reference.

  • MongoDB 3.6.x and 4.2.x versions are supported on HCL Sametime 11.6. MongoDB 4.4.x is the recommended version for HCL Sametime 11.6. Upgrading MongoDB 3.6.x or 4.2.x to 4.4.x instructions can be found here.
  • All commands provided require running as ROOT or SUDO access. If not running as root user, preface all commands with ‘sudo'.
  • Screen shots provided are from MongoDB 4.2, but apply the same to 4.4.


  1. Create a repository file for YUM to install MongoDB. Use VI to create and edit the file mongodb-org-4.4.repo
    > cd /etc/yum.repos.d 
    > vi mongodb-org-4.4.repo
    Note: “vi” is a screen-oriented text editor originally created for the Unix operating system.
  2. To edit the file, use Insert (I) and copy/paste the following contents:
    name=MongoDB Repository 
    Note: When copying and pasting, ensure all characters are present. The "-" in the baseurl can be removed in certain scenarios.

    Prese “Esc” to exit INSERT mode and save/exit with the command wq. Open a command with “:” and use “wq” to save and exit.

    Note: If the error “E212: Can’t open file for writing” is received, root user or sudo access is not being used.

  3. Execute YUM to install the MongoDB package.
    >yum install mongodb-org 

    Enter “y” to confirm the download and installed size.

    Enter “y” to accept the GPG key import.

    The MongoDB install will report “Complete!”


    For more information on MongoDB documentation, click Install MongoDB.

  4. The results of the install will create the mongodb components, user, default log and data directories. You can validate this by checking if the following two directories exist and are owned by ‘mongod'.


  5. To start the MongoDB server, enter the command:
    > service mongod start

    To stop the MongoDB server, enter the command:

    > service mongod stop

    To verify the status of the MongoDB service, enter the command:

    > systemctl status mongod

What to do next

Configuring MongoDB for Sametime