More Docker. Easy Access. New Streamlined Plans. Learn more.

mongodb/mongodb-atlas-local

Verified Publisher

By MongoDB

Updated 5 days ago

Create, manage, and automate MongoDB Atlas Local resources from docker

Image
Databases & Storage
Gen AI
4

500K+

This is the Docker image for the Atlas Local experience.

Use the MongoDB Atlas Local Docker image to build applications with MongoDB Atlas in your preferred local environment and access features like Atlas Search and Atlas Vector Search throughout the entire software development lifecycle.

Getting Started
  1. Pull the Docker image.

To pull the latest Docker image, run docker pull mongodb/mongodb-atlas-local.

If you run docker pull mongodb/mongodb-atlas-local without specifying a version tag, Docker automatically pulls the latest version of the Docker image (mongodb/mongodb-atlas-local:latest).

To pull a specific version of the Docker image, run the following command, replacing tag with the version tag: docker pull mongodb/mongodb-atlas-local:<tag>.

  1. Run the database docker run -p 27017:27017 mongodb/mongodb-atlas-local

  2. Connect to the database mongosh "mongodb://localhost/?directConnection=true"

Authentication

To setup authentication for your local deployment, specify the following environment variables:

  • MONGODB_INITDB_ROOT_USERNAME: The username for the root user.
  • MONGODB_INITDB_ROOT_PASSWORD: The password for the root user.

You may also set it via filename mappings for an extra layer of security. Specify the following environment variables:

  • MONGODB_INITDB_ROOT_USERNAME_FILE: The path to the file containing the username for the root user.
  • MONGODB_INITDB_ROOT_PASSWORD_FILE: The path to the file containing the password for the root user.
Seeding

Map a volume to /docker-entrypoint-initdb.d containing .sh or .js files, they will be executed in alphabetical order.

The default db connected will be test unless the environment variable MONGODB_INITDB_DATABASE is set.

Logs

By default we only redirect mongod logs to stdout and stderr. You can set the extra environment variables to enable more logging:

  • MONGOT_LOG_FILE: The path to the file where you want to store the logs of Atlas Search (mongot).
  • RUNNER_LOG_FILE: The path to the file where you want to store the logs of runner.

Note: both of these variables can be set to /dev/stdout or /dev/stderr for convenience.

Telemetry

This image collects anonymous telemetry data to help us improve the product and to provide you with a better user experience. You can opt out of telemetry by setting the DO_NOT_TRACK environment variable to 1.

Documentation

For more information, see Create a Local Atlas Deployment with Docker.

Docker Pull Command

docker pull mongodb/mongodb-atlas-local