Search
Close this search box.

How to Install MongoDB on Ubuntu 16.04 VPS

Table of Contents

 

How to Install MongoDB on Ubuntu 16.04.

MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is published under a combination of the GNU Affero General Public License and the Apache License.

To install Mongo DB first import public key by package management system.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
After create a list file for it:
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
Use the following command to reload the local package database:
sudo apt-get update

Now install the MongoDB packages and start it by following this command
sudo apt-get install -y mongodb-org
sudo systemctl start mongod

Use this to Stop
sudo service mongod stop
And this to Restart
sudo service mongod restart

To finish enable MongoDB:
sudo systemctl enable mongodb

You have successfully installed MongoDB in Ubuntu 16.04
MongoDB in VPSie
Enjoy it.

DenyHosts

MongoDB is a popular open-source document-oriented NoSQL database that uses a JSON-like format to store data.

You can install MongoDB on Ubuntu by following these steps:

 

  1. Add the MongoDB repository to your system:

    bash
    wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list sudo apt-get update
  2. Install MongoDB:

    CSharp
    sudo apt-get install -y mongodb-org

You can start MongoDB on Ubuntu by running the following command in the terminal:

sql
sudo systemctl start mongod

You can check the status of MongoDB on Ubuntu by running the following command in the terminal:

lua
sudo systemctl status mongod

You can connect to MongoDB on Ubuntu using the mongo command in the terminal:

 
mongo

To uninstall MongoDB on Ubuntu, you can run the following command in the terminal:

CSharp
sudo apt-get purge mongodb-org*
Make a Comment
Share on
Facebook
Twitter
LinkedIn
Print
VPSie Cloud service

Fast and Secure Cloud VPS Service

Try FREE
For a month

The First 1 orders gets free discount today! Try Sign up on VPSie to get a chance to get the discount.