Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How To Install MongoDB on Ubuntu 14.04  (Read 1408 times)

0 Members and 1 Guest are viewing this topic.

vichithrakumart

  • Guest
How To Install MongoDB on Ubuntu 14.04
« on: June 23, 2018, 11:28:46 am »
Step 1 — Importing the Public Key

MongoDB is already included in Ubuntu package repositories, but the official MongoDB repository provides most up-to-date version and is the recommended way of installing the software. Ubuntu ensures the authenticity of software packages by verifying that they are signed with GPG keys, so we first have to import they key for the official MongoDB repository.

Code: [Select]
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
After successfully importing the key you will see:

Code: [Select]
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

Step 2 — Creating a List File

Next, we have to add the MongoDB repository details so APT will know where to download the packages from.

Code: [Select]
wcho "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
After adding the repository details, we need to update the packages list.

Code: [Select]
sudo apt-get update
Step 3 — Installing and Verifying MongoDB

Code: [Select]
sudo apt-get install -y mongodb-org
This command will install several packages containing latest stable version of MongoDB along with helpful management tools for the MongoDB server.

After package installation MongoDB will be automatically started. You can check this by running the following command.

Code: [Select]
service mongod status
If MongoDB is running, you'll see an output like this (with a different process ID).

Code: [Select]
mongod start/running, process 1611