How to Install MongoDB on Ubuntu 18.04 LTS (Linux)


  1. Import the public key used by the package management system
    $ sudo apt-key adv --keyserver hkp:// --recv 0C49F3730359A14518585931BC711F9BA15703C6
  2. Create a list file for MongoDB
    $ echo "deb trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
  3. Reload local package database
    $ sudo apt-get update
  4. Install the MongoDB packages
    $ sudo apt-get install -y mongodb-org

Start MongoDB

$ sudo service mongod start

Stop MongoDB.

$ sudo service mongod stop

Restart MongoDB.

$ sudo service mongod restart

Video Instructions

Partner Sites

Be the first to comment

Leave a Reply

Your email address will not be published.