I have raspberry pi model B. I want to build mongodb on my Linux system and want to copy build onto raspberry pi. I am using mongo-non86 to build mongodb.

I have changed compilers to compile it with arm-linux-gnueabihf-gcc and arm-linux-gnueabihf-g++. But it gives error in between as below.

 build/linux2/normal/third_party/js-1.7/jscpucfg: 1: build/linux2/normal
/third_party/js-1.7/jscpucfg: Syntax error: word unexpected (expecting ")")
 scons: *** [build/linux2/normal/third_party/js-1.7/jsautocfg.h] Error 2

So, my questions are,
1. How to solve this error?
2. Is there any alternate methodology for cross compiling on linux for Raspberry Pi.
3. What is third_party folder and js-1.7 contains (in mongodb build)?
4. Do I have to modify SConstruct file?

Note :- I have already referred this link, but didn't worked.

  • Have you considered installing it this way github.com/RickP/mongopi or c-mobberley.com/wordpress/index.php/2013/10/14/… Dec 6, 2013 at 2:41
  • I am already following c-mobberley.com/wordpress/index.php/2013/10/14/… for installing mongodb directly on R-Pi. I have tried github.com/RickP/mongopi but getting same error. Dec 9, 2013 at 8:59
  • Unfortunately, still it is unsolved. Getting work done with compiling stuff once on raspberry pi. Then copy-paste compiled file 'mongod' to raspberry pi. After copy-paste, it requires some housekeeping mentioned in this link. Apr 8, 2014 at 4:17
  • Compiling software is not really relevant to the Raspberry Pi, it is more OS specific. Please try on Ubuntu Stack. Compilation issues for WindowsIOT will need a new home too
    – Piotr Kula
    Aug 27, 2015 at 7:49
  • IMHO atleast two arm based sources for MongoDB is available so definitely I cannot take normal ubuntu version of MongoDB and start compiling. Since, RPi is not having more processing power, easiest way is to cross compile using arm based gcc. FYKI it's working fine if you directly compile on RPI board. Aug 27, 2015 at 8:15

1 Answer 1


Arch Linux for Pi has MongoDB v3+ in its repos I believe.

If you are staying with Rasbian, at least Jessie (not sure about Wheezy) has a version too but it is only v2.4

All you need to do is:

sudo apt-get update && sudo apt-get install mongodb

Then edit the config:

sudo nano /etc/mongodb.conf

Make sure you add the external IP address to the bind so it is accessible across your network (assuming you want that).

To check if it is running:

sudo systemctl status mongodb

To restart

sudo systemctl restart mongodb

Those last 2 commands are for Rasbian Jessie. For wheezy it would be:

sudo service mongodb restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.