Install MongoDB on Raspberry Pi

As of 03/02 updated: version 4.2 replaced with 4.4

[64-bit Raspberry OS Buster]

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

curl -s 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

To check the status run the command:

service mongod status

or just run MongoDB shell:

mongo

Source:
Installing MongoDB to the Raspberry Pi
MongoDB 3.4 (64 bit) running on a Raspberry Pi 3

[32-bit]

It will install outdated 32-bit version 2* of MongoDB:

apt install mongodb
service mongod start

[64-bit and 32-bit]

To get access from other computer on your network, change the bind_ip in config file, do not forget to restart a service:

nano /etc/mongod.conf

# find the line
bind_ip = 0.0.0.0

#save and restart
service mongod restart

4 thoughts on “Install MongoDB on Raspberry Pi

  1. Hi,

    I am also trying to install MongoDB (4.4) on Raspberry OS 64bits.

    But when running the command:

    # apt install mongodb-org

    I get this error:

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package mongodb-org

    Though running this command:

    # apt search mongodb-org
    gives me the following result:

    Sorting… Done
    Full Text Search… Done
    mongodb-org/focal 4.4.4 amd64
    MongoDB open source document-oriented database system (metapackage)
    ……….

    Would you have any idea, what the solution might be?
    Or where the problem is?

    1. 64-bit “fresh” installation:
      $ mongo
      MongoDB shell version v4.4.4
      connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb

Leave a Reply

Your email address will not be published. Required fields are marked *

Yandex.Metrica