Note: only work for 4.4, 5, 6 doesn’t work on Raspberry Pi

Install & Configure MongoDB on the Raspberry Pi | MongoDB (new)

Install, reference MongoDB / Raspberry Pi (tutorama.info)

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

Start fail, the error is related to socket, remove file /tm/mongodb-27017.sock

Untitled

root@Tindecken:~# rm -rf /tmp/mongodb-27017.sock

Update bind IP to current IPaddress, allow remote connect

root@Tindecken:~# nano /etc/mongod.conf

Untitled

Create folder /data/db

Untitled

Start mongod with specific IP

mongod --bind_ip 192.168.1.17

Untitled

Start OK

root@Tindecken:~# sudo service mongod status
● mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-12-22 20:02:17 +07; 11s ago
       Docs: <https://docs.mongodb.org/manual>
   Main PID: 5834 (mongod)
        CPU: 1.976s
     CGroup: /system.slice/mongod.service
             └─5834 /usr/bin/mongod --config /etc/mongod.conf

Dec 22 20:02:17 Tindecken systemd[1]: Started MongoDB Database Server.

Connect with Robo 3T

Untitled