Install MongoDB on Raspberry Pi

[64-bit Raspberry OS Buster]

We are going to use instructions for Ubuntu 64-bit:

ADDED OPTION -L to support re-direct… (May, 7, 2022)

curl -s -L https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt update

Now we can install MongoDB server:

sudo apt install mongodb-org

# enable and start
sudo systemctl enable mongod
sudo systemctl start mongod

(more…)

Install/Upgrade Composer on Raspberry OS

To install/upgrade the Composer:

  • make sure you are in the home directory (cd ~)
  • download the installer
  • [optional] verify the installer (the line is commented, check the current hash from the Composer website)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

(more…)

MongoDB + Python

Depends on the version you are using:

python -m pip install pymongo
python3 -m pip install pymongo

In my case, because I’ve change the default version of Python,

python -m pip install pymongo

will be installed for python3

Raspberry Pi OS (64-bit Buster) Installation

They “still recommend the 32 bit operating system for all Pis at this time, although have decided it is now time to begin the move toward a 64-bit OS. For the moment this is a ‘beta’ program, the OS is in heavy flux and its functionality is likely to change significantly over the next few months…”

Disadvantages:

  • Still beta, for how long? There is Ubuntu 64-bit, but I  just like Raspbian (Raspberry OS)
  • Almost nothing included, even repository is half full, half empty

Advantages:

  • Adventure!! You do not know what to expect!!
  • 64-bit system, so you have a chance to get newer/latest version of software (some developers/companies dropped support for 32-bit systems, for ex:
    – Visual Code
    – MongoDB
    etc.
  • I think it’s running faster
  • Overstep the limit of 4GB of the memory: Raspberry Pi 4 / 8GB

The one thing I would recommend for now, do not follow the link to download image. Just go:

https://downloads.raspberrypi.org/raspios_arm64/images/

You  should see more folders there, dig into the most recent, and download (click) .zip file with the image. Write the image on SD card, USB drive (using for ex: win32diskimager), put into the slot, since Sep 2020 Raspberry Pi 4 can boot directly from USB without SD card –  and start the system. Just install OS on ANY (small, slow, etc.) card, change the settings running

raspi-config

… remove card, burn image on USB drive, and get everything installed on it.

Source: Raspberry Pi OS (64 bit) beta test version – Raspberry Pi Forums

Install Apache Web Server

sudo apt install apache2

go to apache2.conf

sudo nano /etc/apache2/apache2.conf

and remove ‘Indexes’ to hide the content of the directory if index.html or index.php are missing:

<Directory /var/www/>
 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted
</Directory>

(more…)

Yandex.Metrica