Wednesday, December 21, 2016

Install MongoDB on Ubuntu 16.04

Step 1 - Importing the Public Key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

Step 2 - Create source list file MongoDB

Create a MongoDB list file in /etc/apt/sources.list.d/ with this command:
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

Step 3 - Update the repository

update the repository with the apt command:

sudo apt-get update

Step 4 - Install MongoDB

Now you can install MongoDB by typing this command:


sudo apt-get install -y mongodb-org

Step 4 - Run mongo

Now you can install MongoDB by typing this command:


sudo service mongo start

No comments:

Post a Comment