HUB
Sign inSign up

Mongo Express

•

50K+

saniewski/mongo-express-docker-extension:2.0.2

By Pawel Saniewski

•

Updated 2 days ago

Run Mongo Express in Docker Desktop and connect to any MongoDB server.

Browse and manage MongoDB databases with Mongo Express inside Docker Desktop. Connect to a local or remote MongoDB server without installing Mongo Express yourself or configuring its container manually.

Features
  • Save, edit, and manage multiple MongoDB connections.
  • Connect using a hostname and optional credentials or a MongoDB connection string.
  • Test connection settings before saving, with a success message or the reason for failure.
  • Configure TLS with a custom CA and client certificate/key PEM files.
  • Limit Mongo Express to one database with database-scoped mode.
  • Open Mongo Express for a saved connection and remove its container when you return to the connections page.
Usage

Start Docker Desktop and have a running MongoDB server reachable from it. The extension starts Mongo Express; you provide the MongoDB server and any credentials it requires.

Open your first connection
  1. Open Mongo Express from the Extensions section in Docker Desktop.
  2. Select Add connection and enter a Connection name, such as Local development.
  3. Choose Host and credentials to enter a Hostname, Port (usually 27017), and optional username/password. Choose Connection string to paste a mongodb:// or mongodb+srv:// URI instead.
  4. If needed, configure Database-scoped mode or TLS settings as described below. Select Test connection to check the settings and see a success message or the reason for failure.
  5. Select Add connection to save the details, then select Open in the connections table.
  6. Wait for Starting Mongo Express… to finish. The first launch may take longer while Docker downloads the Mongo Express image.
  7. In Mongo Express, select a database and collection to browse documents. Your MongoDB account permissions determine which read and write operations are available.
  8. Select Connections at the top to end the session and return to your saved connections.

Saving a connection only stores its settings. Test connection connects and pings MongoDB using a temporary container that is removed afterward. Open starts Mongo Express using the saved settings. The first test or session may take longer while Docker downloads the Mongo Express image.

Choose a MongoDB address
  • On your computer: use host.docker.internal and the MongoDB port. For a single-host connection, localhost and 127.0.0.1 are also translated to host.docker.internal.
  • In a local Docker container: use the exact running container name, such as my-mongo, and its internal MongoDB port (usually 27017). The extension automatically joins a matching container network for the mongo, bitnami/mongodb, and circleci/mongo images. A Compose service name alone may not match the container name.
  • Through a published port: use host.docker.internal and the published host port. For a mapping of 27018:27017, enter 27018. This also works for custom images or network setups where automatic container network selection does not work.
  • On a remote server: use the server hostname and port or the connection string supplied by your provider. The server must allow connections from your network.
  • In MongoDB Atlas: use the supplied mongodb+srv:// connection string, a database user, and an allowed client IP address in Atlas network access settings.

Example connection strings (replace the example credentials and cluster hostname with your own):

  • Local server: mongodb://host.docker.internal:27017
  • Local server with credentials: mongodb://app-user:[email protected]:27017/app?authSource=admin
  • Atlas cluster: mongodb+srv://app-user:[email protected]/app?authSource=admin

In a URI, percent-encode special characters in usernames and passwords, such as @ as %40. With Host and credentials, enter credentials normally; the extension handles encoding. See the MongoDB connection string documentation⁠ for options such as authSource and replica set settings.

Manage saved connections
  • Open starts a Mongo Express session using the saved settings.
  • The pencil icon opens Edit connection. Update the fields, optionally select Test connection to check them, and select Save changes.
  • The trash icon opens a confirmation dialog. Select Delete to remove the saved connection.

Returning with Connections stops and removes the session container while keeping your saved connection. Containers left behind by an interrupted session are cleaned up when the connections page next opens. Closing or deleting a saved connection does not remove your MongoDB server or its data.

Saved connection details, including passwords and credentials in URIs, remain in the Docker Desktop extension browser localStorage and are not encrypted by the extension. Remove saved connections you no longer need, and avoid saving secrets on a shared desktop account.

Database-scoped mode

Enable Database-scoped mode when you want Mongo Express to show one database, including when your account cannot list all databases.

  • With Host and credentials, fill in Database name, for example app.
  • With Connection string, include the database in the URI path, for example mongodb://host.docker.internal:27017/app.

This disables Mongo Express admin features and limits browsing to that database. MongoDB still enforces the account read/write permissions. The mode is off by default; adding a database to a URI alone does not enable it.

Host and credentials authenticates against admin. If the user was created in another database, use Connection string with the appropriate authSource. For a user created in app, use mongodb://app-user:[email protected]:27017/app?authSource=app.

TLS settings

Enable TLS settings to turn on TLS and optionally configure a custom certificate authority or a client certificate.

  • CA certificate: an optional PEM file containing the CA certificate(s). Leave it empty to use the trusted authorities in the Mongo Express container.
  • Client certificate/key: an optional PEM file containing both the client certificate and its matching private key. If supplied separately, combine them into a private PEM file on your computer first.
  • Allow certificate hostname mismatch: off by default. Enable only for a trusted local proxy whose server certificate does not name the address used to reach it. CA verification remains enabled.

Use Browse or enter an absolute path on the Docker Desktop host. Docker Desktop must be able to access the files through its file sharing settings. The extension stores only their paths and mounts the selected files read-only into Mongo Express. Use Test connection to check the TLS settings before saving. Save the connection, then open it to apply the settings. Close and reopen the connection after renewing or replacing certificates.

Enabled TLS settings override the certificate paths and verification options in the URI. When disabled, no certificate files are mounted and TLS follows the URI, including the default TLS behavior of mongodb+srv://.

Troubleshooting

If Test connection fails, the modal shows the reason. Correct the settings and test again; changing a field clears the previous result.

If Service Unavailable appears, read the error message. Select Back to connections to edit the saved settings, or Try again to retry with the same settings after fixing the problem.

  • Startup takes more than 60 seconds: check that Docker Desktop and MongoDB are running, the address and port are correct, and Docker can download the Mongo Express image. Retry once the image download finishes.
  • Server unreachable: check the host or container address, port publishing, VPN/firewall rules, and any provider IP access list. MongoDB must listen on an interface reachable from Docker Desktop.
  • Authentication or database access fails: check credentials and authSource. For an account limited to one database, enable Database-scoped mode and supply its database name.
  • Certificate file cannot be read: choose an existing, readable PEM file using an absolute path and check Docker Desktop file sharing. A client PEM must contain both the certificate and its matching private key.
  • Certificate is untrusted, expired, or names another host: select the correct CA, renew expired certificates, and use the hostname on the server certificate. Use Allow certificate hostname mismatch only for a trusted local proxy. Reopen the connection after changes.

If the problem persists, select Report an issue on the error page and include the error message with any credentials removed.

Resources