Getting Started
Recommended flow
Install with Docker or Linux packages once. Create a working instance, then insert and read a document using a shell, driver, or editor.
Choose an install path
Start with Docker on Linux, macOS, or Windows. Use Linux packages when you need a host installation.
Docker: recommended for evaluation and development
With Docker installed, run a local instance on Linux, macOS, or Windows. Replace the credential placeholders before running. The port stays on loopback.
Wait for the readiness banner in docker logs documentdb before connecting.
Linux packages
For environments without Docker, or when you need control over PostgreSQL, topology, services, and configuration. Install with apt or dnf on Ubuntu 24.04 (Noble) or EL9, then run the setup wizard.
Pre-GA, fresh installation only; in-place upgrades from earlier releases are not supported.
For the full walkthrough, see the Linux Packages Quick Start.
Insert and read your first document
Pick the client you prefer. Each guide connects to the instance you already created and verifies an insert and read. Sample data is optional.
Or go directly to Node.js Quick Start or Python Quick Start.
DocumentDB is an open-source document database platform built on PostgreSQL. It offers developers a fully permissive, open-source platform for document data stores.
DocumentDB provides a NoSQL datastore implemented using PostgreSQL, giving developers complete visibility into the architecture and implementation of the engine. It's designed to offer:
pg_documentdb_gw gatewaypg_documentdb extensionpg_documentdb_core PostgreSQL extensionpgvector PostgreSQL extensionDocumentDB consists of three primary components:
Together, these components let you use DocumentDB through MongoDB-compatible tools and drivers while still benefiting from PostgreSQL internals.
Choose your environment once, create a working instance, then connect with the client that fits your goal:
Linux packages are pre-GA and support fresh installation only, not in-place upgrades from earlier releases. Removing packages preserves database files; reinstalling does not reset data.
For advanced control, use an existing local PostgreSQL instance with administrator-managed configuration and restart, or install the PostgreSQL extension only. Extension-only installation does not install the gateway, so apps and drivers cannot connect; you use it through SQL.
Before moving on to application code, confirm that DocumentDB is reachable and can insert and read a document. For Docker, check docker ps --filter "name=documentdb" and wait for the readiness banner in docker logs documentdb; for Linux packages, inspect sudo documentdb-setup --status.
Run this shell example on the same host as DocumentDB. Use your Docker username, or admin for Linux packages, and enter your password at the prompt.
The certificate bypass is for local development only. Linux package setup binds the gateway on all interfaces by default: firewall port 10260 before setup and follow network and certificate guidance.
mongosh localhost:10260 \
-u '<YOUR_USERNAME>' \
-p \
--authenticationMechanism SCRAM-SHA-256 \
--tls \
--tlsAllowInvalidCertificatesThen run:
db.runCommand({ ping: 1 })
use quickstart
db.orders.insertOne({ item: "widget", qty: 5 })
db.orders.find({ item: "widget" })The insert should report acknowledged: true, and the query should return your document. No sample-data loading is required.
For a fuller walkthrough, use the Mongo Shell Quick Start. Driver-based examples are available in the Node.js Quick Start and Python Quick Start.
If setup does not work on the first try:
sudo documentdb-setup --status and package troubleshooting. The default PostgreSQL 18 install uses documentdb-local@18.target, not the meta-package alias.10260 is published with docker ps. Inspect startup, authentication, and TLS errors with docker logs documentdb.tlsAllowInvalidCertificates=true, follow the Linux package certificate steps or DocumentDB Local for Docker.-e DOCUMENTDB_LOG_LEVEL=debug (the --log-level flag is currently a no-op); the available runtime options are documented in DocumentDB Local.Once you can connect successfully, continue with these guides:
After you finish the initial setup: