Tuesday, May 30, 2017

Debian: Install MongoDb on Debian 8 Jessie

MongoDB is one of the popular NO-SQL database to date. One of the easiest way to install MongoDB is by installing it on apt repository. In this tutorial, we are going to install MongoDB on Debian 8 Jessie using apt repository. 

1. Add this line in our source list of the system. Take note that I'm using vi editor in editing files, but you can use other editing tools that you preferred like nano or pico.  After inserting the codes to our apt repository, we can now save it. 

vi /etc/apt/sources.list



deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main


2. Download the key and add the key to our system. The wget command download the link on our system and apt-key command add the key to our system. Take note that if you are using proxy, you need to alter the files in /etc/wgetrc to enable proxy environment so that wget command will work perfectly. 

wget https://www.mongodb.org/static/pgp/server-3.4.asc
apt-key add server-3.4.asc



3. Reload local package database. We need to update our system to enable the repository that we inserted earlier. 


apt-get update



4. You can now install MongoDb. By using the command apt-get install mongodb-org, we will now able to install mongodb in our system. Press the Y to continue the installation of mongodb and wait for a second or minutes depending on your internet speed to finish installing MongoDB.


apt-get install mongodb-org



5. Start MongoDb. By using the command service mongodb start, we will able to start our MongoDB server and to be able to access our database.

service mongod start

1 comment: