Skip to content

MongoDB

Install MongoDB

Linux Mint

A walkthrough tutorial is available on the blog site: https://blog.bensoer.com/install-mongodb-on-linux-mint/

A brief breakdown of the steps will be listed here:

  1. Run the following command:

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
    
  2. Edit the following command:

    echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
    
  3. Replace $(lsb_release -sc) with the Ubuntu version on which the Linux Mint installation is based. See the archived Linux Mint releases for the full list.

  4. Update dependencies:

    sudo apt-get update
    
  5. Install the latest version of MongoDB:

    sudo apt-get install -y mongodb-org
    

Ubuntu

To install on Ubuntu, run the following commands in order:

  1. Add the MongoDB repository key:

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
    
  2. Add the MongoDB repository:

    echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
    
  3. Update dependencies:

    sudo apt-get update
    
  4. Install the latest version of MongoDB:

    sudo apt-get install -y mongodb-org
    

Note: This installs the latest version of MongoDB. To install a specific version, see the MongoDB documentation in the resources below.

Resources