You can create MongoDB containers on Docker by running the Docker Pull command: longshoreman pull mongo. How do I download or extract the MongoDB Docker image? You will need a system with Docker installed, access to your command line, and an internet connection. MongoDB is a NoSQL database available for popular operating systems that provides a database without a fixed structure, making it easily scalable. Access the web interface using in your browser.įrequently Asked Questions (FAQs) 1. Step 5: Create a Mongo Express Web Interface Container (Optional)Ĭreate a web-based graphical user interface, Mongo Express, for managing MongoDB server databases using the command docker run –link mongodb:mongo -p 8081:8081 -e ME_CONFIG_MONGODB_URL=”mongodb://mongo:27017″ mongo-express. Step 4: Access the MongoDB Database Terminal (Bash Shell)Īccess the Mongo server command line to manage databases by using the command sudo docker exec -it mongodb bash. You can create as many running MongoDB containers as you need by using the command docker run -it -d -v /var/dbdata:/data/db -p 27017:27017 –name mongodb mongo to map the created folder and set the container’s port for access from the host system.
Step 3: Create MongoDB Database Server ContainerĬreate a folder to store the data from the databases created in the running MongoDB container using the command sudo mkdir /var/dbdata.