Craftsman at Work

I'm Artur Karbone, coding software architect and independent IT consultant and this is my blog about craftsmanship, architecture, distributed systems, management and much more.

Learn MongoDB Part 1: Environment Setup

For experimenting with on-premises software, my tool of choice nowadays is Docker. There is a bare minimum to start playing with MongoDB: mongo shell to enter commands and mongod (deamon or service if You will). In addition to that, there is an amazing GUI tool called MongoDB Compass. So let's quickly setup our bare minimum container.:

docker run --name learn-mongo -d  -p 27017:27017 mongo

Now we've got a container called learn-mongo for further reference. From this point we can either execute bash commands in the container (we will use this feature later on for installing additional software or running optional mongo commands):

docker exec -it learn-mongo bash  

or run mongo shell directly:

docker exec -it learn-mongo mongo  

The real benefit of named containers is that it is possible to start one without memorizing initial parameters like ports, flags, etc:

docker start learn-mongo  

That's it. Happy Learning!

Blog posts in this series

comments powered by Disqus