- Install MongoDB >
- Install MongoDB Enterprise >
- Install MongoDB Enterprise with Docker
Install MongoDB Enterprise with Docker¶
Important
The recommended solutions for using containers with MongoDB are:
- For development and testing use the MongoDB Community Docker container.
- For MongoDB Enterprise production installations use Kubernetes through the MongoDB Ops Manager.
Note
This procedure uses Docker’s official mongo image, which is supported by the Docker community and not MongoDB.
If the above recommended solutions do not satisfy your needs, follow the steps in this tutorial to manually install MongoDB Enterprise with Docker.
Considerations¶
A full description of Docker is beyond the scope of this documentation. This page assumes prior knowledge of Docker.
This documentation only describes installing MongoDB Enterprise with Docker, and does not replace other resources on Docker. We encourage you to thoroughly familiarize yourself with Docker and its related subject matter before installing MongoDB Enterprise with Docker.
Important
This procedure uses Docker’s official mongo image, which is supported by
the Docker community and not MongoDB. It supports only the major
versions listed in their repositiory, and only a specific
minor version for each major version. The minor version can be found
in the Dockerfile
in the folder for each major version.
Create a Docker Image with MongoDB Enterprise¶
Download the Docker build files for MongoDB Enterprise.¶
After you have installed
Docker and set up a
Docker Hub account, download
the build files from the
Docker Hub mongo project
with the following commands. Set MONGODB_VERSION
to your major
version of choice.
Docker Hub Mongo Project
The Docker Hub mongo project is not maintained by MongoDB. Any support requests should go to Docker.
Build the Docker container.¶
Use the downloaded build files to create a Docker container image wrapped around
MongoDB Enterprise. Set DOCKER_USERNAME
to your Docker Hub username.
Test your image.¶
The following commands run mongod locally in a Docker container and check the version.
This should output the shell and server version for MongoDB.
Push the Image to Docker Hub¶
Optionally, you can push your Docker image to a remote repository, like Docker
Hub, to use the image on other host machines. If you push the image to Docker
Hub, you can then run docker pull
for each host machine on
which you want to install MongoDB Enterprise via Docker. For complete guidance
on using docker pull
, reference its documentation
here.
Check your local images.¶
The following command displays your local Docker images:
You should see your MongoDB Enterprise image in the command output. If you do not, try Create a Docker Image with MongoDB Enterprise.
Push to Docker Hub.¶
Push your local MongoDB Enterprise image to your remote Docker Hub account.
If you log into the Docker Hub site, you should see the image listed under your repositories.