Skip to content

Instantly share code, notes, and snippets.

@kjprice
Last active May 21, 2023 22:04
Show Gist options
  • Save kjprice/d233856093fd3a89fd19f1372aba7ba8 to your computer and use it in GitHub Desktop.
Save kjprice/d233856093fd3a89fd19f1372aba7ba8 to your computer and use it in GitHub Desktop.
Installing MongoDB 4.4 on Raspberry Pi (Raspbian 11 arch64 - Bullsey)
# To Make sure this setup is right for you, these should help:
# Should return "arm64"
sudo dpkg --print-architecture
# Should return "aarch64"
uname -m
# Should contain: `VERSION="11 (bullseye)"`
cat /etc/os-release
# After many attempts to Install MongoDB for Raspberry Pi, I decided to add this for Posterity
# See https://github.com/mongodb/mongo/blob/r4.4.0/docs/building.md
cd /tmp
sudo apt-get install -y gcc-10 g++-10
sudo apt-get install -y libssl-dev libcurl4-openssl-dev
git clone -b r4.4.0 https://github.com/mongodb/mongo.git
cd mongo
python3 -m venv ~/.python_env/mongo_env
source ~/.python_env/mongo_env/bin/activate
python3 -m pip install -r etc/pip/compile-requirements.txt
time python3 buildscripts/scons.py install-core --disable-warnings-as-errors --ssl CC=/usr/bin/aarch64-linux-gnu-gcc-10 CXX=/usr/bin/aarch64-linux-gnu-g++-10 CCFLAGS="-march=armv8-a+crc -mtune=cortex-a72"
@kjprice
Copy link
Author

kjprice commented May 21, 2023

After following many different tutorials to setup MongoDB on my Raspaberry Pi, I decided to build from source and provide details which hopefully can help others.

Note that this will take a very long time to complete.

Instructions that almost worked: https://www.mongodb.com/community/forums/t/add-mongodb-4-2-arm64-builds-for-raspberry-pi-os-64-bit-debian-buster/5046

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment