How to Run MongoDB on Your Local Network Using a Raspberry Pi and Docker

Kunal Patel
The Startup
Published in
5 min readAug 24, 2020

--

Photo by Stefan Cosma on Unsplash

NoSQL databases have been trending upward in popularity and adoption in recent years. MongoDB has separated itself from the NoSQL pack because it is a highly scalable and easy to learn technology. Its flexible data model allows for adding and changing fields easily, allowing applications to decide the data schema instead of forcing an application to fit a data schema. In this post I want to walk through my experience of setting up MongoDB on a local network so that multiple devices can communicate with the same database. To accomplish this, I’m going to configure a Raspberry Pi, running the recently supported Ubuntu Server, to run a MongoDB Docker container that will be configured so that it is accessible to any machine on my network. Of course you don’t need to use Docker to run MongoDB. I found the tradeoff between performance overhead and ease of use to be acceptable for my use case, at least to start things off.

Why on a Raspberry Pi?

There are a number of reasons why you could want MongoDB running on a Raspberry Pi. Firstly, the Raspberry Pi was designed as an affordable learning device, so you could be using it as a sandbox for learning a new technology like MongoDB. You could also be trying to cut costs if you have low resource requirements by hosting your own database. You…

--

--

Kunal Patel
The Startup

Software Developer/SRE/Operations @ IBM. Trying to learn more about Kubernetes, Machine Learning and Finance every day! https://www.linkedin.com/in/kpatel17