DebianLinuxTutorials

How To Install MongoDB on Debian 8

Install MongoDB on Debian 8

In this tutorial, we will show you how to install and configure MongoDB on Debian 8 Jessie server. For those of you who didn’t know, MongoDB is a NoSQL document-oriented database. Refers to a database with a data model other than the tabular format used in relational databases such as MySQL, PostgreSQL, and Microsoft SQL. MongoDB features include full index support, replication, and high availability, and auto-sharding. It is cross-platform and it makes the process of data integration faster and much easier. Since it is free and open-source, MongoDB is used by a number of websites and organizations.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of MongoDB on a Debian 8 (Jessie) server.

Prerequisites

  • A server running one of the following operating systems: Debian 8 (Jessie).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install MongoDB on Debian 8 Jessie

Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt-get commands in the terminal:

apt-get update
apt-get upgrade

Step 2. Installing MongoDB.

For installing the latest stable version of MongoDB you should add the MongoDB repository but first, you should Import the public key used by the package management system:

echo "deb http://repo.mongodb.org/apt/debian "$(lsb_release -sc)"/mongodb-org/3.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-3.4.list

Install the latest stable version of MongoDB:

apt-get update
apt-get install mongodb-org

Verifying MongoDB database:

To verify it is successfully installed, run the commands below to view its running status:

# sudo service mongodb enable
# sudo service mongodb start
# sudo service mongodb status
● mongodb.service - LSB: An object/document-oriented database
   Loaded: loaded (/etc/init.d/mongodb; bad; vendor preset: enabled)
   Active: active (running) since Thu 2017-05-4 16:40:35 IST; 14s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2849 ExecStart=/etc/init.d/mongodb start (code=exited, status=0/SUCCESS)
  Main PID: 1593 (code=exited, status=0/SUCCESS)
    Tasks: 13 (limit: 512)
   Memory: 51.9M
      CPU: 100ms
   CGroup: /system.slice/mongodb.service
           └─2861 /usr/bin/mongod --config /etc/mongodb.conf

A good way to start using MongoDB on your Debian 8 is to read the MongoDB manual on the official website.

https://docs.mongodb.org/manual/

Congratulations! You have successfully installed MongoDB. Thanks for using this tutorial for installing the latest version of the MongoDB database on the Debian 8 Jessie server. For additional help or useful information, we recommend you check the official MongoDB website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button