Getting Started
Use DocumentDB for VS Code to set up a local DocumentDB instance, browse sample data, and create your first database without leaving the editor.
The extension can create the instance for you: it pulls the official image, creates a container and persistent data volume, generates credentials, waits until the database accepts connections, and saves the connection. It does not install Docker.
Already running DocumentDB? Skip provisioning and connect your existing instance.
Docker must be reachable from the environment VS Code runs in. If you work in WSL, a dev container, an SSH remote, or Codespaces, Docker needs to be available there rather than only on your host machine. Setup runs a readiness check and explains what to fix if it cannot reach Docker.
Install the extension from the VS Code marketplace, or run:
code --install-extension ms-azuretools.vscode-documentdbTo update an older install, add --force; without it the command keeps the version you have. Reload VS Code after installing or updating, because the running window keeps using the previous version until then.
Use guided setup to let the extension provision DocumentDB Local and save its connection. There are no Docker commands for you to run.
vscode://ms-azuretools.vscode-documentdb/local from your browser and confirm the prompts. This needs extension version 0.10.1 or later, so install or update the extension first; the link cannot always install it for you.10260), generated credentials, the latest official image, and optional sample data. Expand the advanced options to set the port, image tag, or credentials yourself.vscode-documentdb-local with a persistent volume, then waits until the database accepts connections.Sample data is enabled by default. If you keep it enabled, expand the saved connection to browse the sample database and collections.
Right-click the DocumentDB Local entry to Start, Stop, Restart, or Delete Container, and to Copy Connection String, Copy Password, or View Logs. Stopping and starting preserves your data; deleting removes the volume and the generated credentials permanently.
Use this if you want to manage the container yourself. If DocumentDB is already running, skip this step and connect your existing instance.
Start it with Docker:
docker run -dt --name documentdb \
-p 127.0.0.1:10260:10260 \
ghcr.io/documentdb/documentdb/documentdb-local:latest \
--username '<YOUR_USERNAME>' \
--password '<YOUR_PASSWORD>'If you prefer a host installation instead of Docker, use the Linux Packages Quick Start on a distribution in the current release matrix.
Use this for a DocumentDB instance that is already running. You only add a connection; you do not need to run the setup wizard or create another container. Have the instance's port, username, and password ready.
10260 for the command above), username, and password.Guided setup loads sample data by default unless you turn that option off. The manual Docker command above starts without sample data; the Docker Quick Start shows how to enable it.
{
"name": "VS Code Quick Start",
"source": "vscode",
"status": "connected"
}Switch between the Table, Tree, and JSON views to confirm the extension can read the document.
If you prefer to validate outside the extension first, use Mongo Shell Quick Start.
After the connection works, the extension can help you continue without leaving VS Code:
If setup or the connection does not work on the first try:
code --install-extension ms-azuretools.vscode-documentdb --force, reload VS Code, and open the link againcode --install-extension ms-azuretools.vscode-documentdb, then open the link againdocker ps and docker logs documentdbsudo documentdb-setup --status; for a manually built gateway, confirm its process is listening on the port you enteredmongosh to confirm the endpoint works independently of VS CodeFor extension-specific help or bugs: