Menu

Blog from a passionate developer

Install MongoDB and Node.js on a Raspberry Pi

This tutorial is the second part of the series on raspberry pi. In this part we will focus on the installation of MongoDB and Node.js that will run at startup. MongoDB is a popular NOSQL database that is often used with Node.js which is a JavaScript runtime mainly used to build server-side applications.

MongoDB

Let’s get started with the MongoDB installation which is pretty simple:

Hello guys, been using this tutorial to install NodeJS on my Raspberry Pi 3 and all work except the “service” part. I put the app.js file exactly as said and place the node file in /etc/init.d/ but as i try to run it by using sudo service node start i got the following :

Failed to start node.service: Unit node.service failed to load: No such file or directory.

sudo service mongod start
doesn’t work for me, I keep getting:
Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.
Any idea?
Setup: Raspberry 3 with a fresh+unaltered install of Raspbian 4.4 (download today).

pi@raspberrypi ~ $ sudo apt-get install mongodb-server
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package mongodb-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Thanks for the post, for me this worked fine on my Pi 3, but maybe it’s because I tried earlier in June when there’s wasn’t an Arm7 release for the Pi. AT that time I followed Andy Felong’s setup recommendations which may have paved the way for this success.

I had compiled a Mongo 3 release, but the binary was 160 times the size of this Mongo 2 release.

My advice to others would be to review any setup prerequisites in the Mongo install docs first. It’s likely that in time these issues will be baked into the package.

Hello
I’m a complete beginner to MEAN stack and would like to work with Raspberry Pi with MEAN stack For IOT project. What’s the most simplest project i can do which satisfies the title “Using the MEAN Stack to Implement a RESTful Service for an Internet of Things Application”.
Kindly Reply
Thanks