MongoStudio is a lightweight, stunning MongoDB UI that runs in a single Docker container.
2.4K
MongoStudio is a lightweight, stunning MongoDB GUI that runs in a single Docker container. Connect with just a connection string and start browsing your data instantly.
mongo / mongosh with auto-version routingADMIN_ACCESS_KEY to gate Console and Server ManagementDemo: https://beztebya666.github.io/mongostudio/
Github: https://github.com/beztebya666/mongostudio
If you pull from a registry, use the same fully qualified image name in docker run.
Also you may sometimes need argument: --security-opt seccomp=unconfined
Examples below use mongostudio for a locally built image or a local tag alias.
# Pull from ghcr
docker pull ghcr.io/beztebya666/mongostudio:latest
# Run ghcr image
docker run -d -p 3141:3141 --name mongostudio ghcr.io/beztebya666/mongostudio:latest
# Pull from docker.hub
docker pull beztebya666/mongostudio:latest
# Run docker.hub image
docker run -d -p 3141:3141 --name mongostudio beztebya666/mongostudio:latest
Open http://localhost:3141 and paste your connection string.
Optional local alias if you prefer shorter commands:
docker tag ghcr.io/beztebya666/mongostudio:latest mongostudio
# or
docker tag beztebya666/mongostudio:latest mongostudio
# Build
docker build -t mongostudio .
# Run
docker run -d -p 3141:3141 --name mongostudio mongostudio
Open http://localhost:3141 and paste your connection string.
If MongoDB runs on your host machine or in another Docker container:
# Linux opt 1 (recommended if MongoDB is in Docker too, same custom network)
docker run -d --name mongostudio --network mongo-net -p 3141:3141 mongostudio
# Then connect with container DNS name, for example: mongodb://mongo:27017
# Linux opt 2 (if MongoDB runs on Linux host machine)
docker run -d -p 3141:3141 --add-host=host.docker.internal:host-gateway mongostudio
# Then connect with: mongodb://host.docker.internal:27017
# macOS / Windows - works automatically
docker run -d -p 3141:3141 mongostudio
# Connect with: mongodb://host.docker.internal:27017
docker run -d -p 8080:3141 mongostudio
# Open http://localhost:8080
docker run -d \
-p 3141:3141 \
--name mongostudio \
--restart unless-stopped \
--memory 512m \
--cpus 1 \
mongostudio
Set ADMIN_ACCESS_KEY to require a key for Console and Server Management features:
docker run -d -p 3141:3141 \
-e ADMIN_ACCESS_KEY="your-secret-key" \
--name mongostudio mongostudio
When set, users must enter the key in Settings before accessing Console or Server Management. When not set, all features are accessible without a key.
MongoStudio auto-detects your MongoDB server version on connect and adapts its behavior:
| MongoDB Version | Support Level | Notes |
|---|---|---|
| 8.x | ✅ Full | All features |
| 7.x | ✅ Full | All features |
| 6.x | ✅ Full | All features |
| 5.x | ✅ Full | All features |
| 4.4 | ✅ Full | All features |
| 4.2 | ✅ Full | $unionWith unavailable |
| 4.0 | ✅ Full | $merge, $unionWith unavailable |
| 3.6 | ⚡ Good | Uses legacy count(), no transactions |
| < 3.6 | ❌ | Upgrade required (driver limitation) |
The UI shows a version badge and warnings banner when connected to older versions.
buildInfo to get the exact versionhello / isMastercountDocuments() on 3.6+, legacy count() on older)MongoStudio ships two shell binaries in Docker:
mongosh1) — for MongoDB 3.6–4.0Regardless of which Console tab the user selects, the server automatically routes to the correct binary based on the connected MongoDB version. Old servers always get mongosh 1.x, new servers always get mongosh 2.x.
Server tools (mongodump, mongoexport, etc.) ship in two variants:
mongodb-database-tools (MongoDB 4.2+)*_legacy binaries)The server probes both and automatically falls back to legacy if the modern binary reports wire version incompatibility.
db.collection.find({}), .aggregate([]), .distinct()), templates, and execution time tracking.mongo legacy / mongosh) when binaries are installed.Ctrl/Cmd+Enter to save, Esc to cancel), and syntax validation.HTML: index.html (SPA, #root)
CSS: Tailwind CSS + custom index.css (CSS variables, dark/light)
JS/Frontend: React 18 (JSX), no TypeScript
Build: Vite + PostCSS + Autoprefixer
API client: fetch (custom src/utils/api.js)
Backend: Node.js + Express
MongoDB: official MongoDB driver (no ORM)
Security/API middleware: helmet, cors, compression, express-rate-limit
Deployment: Docker (multi-stage, node:20-bookworm-slim)
Shell binaries: mongosh 2.x, mongosh 1.x, mongodb-database-tools, legacy mongo tools (all via tarballs)
npm install
npm run dev
# Frontend: http://localhost:5173
# Backend: http://localhost:3141
Use this command to verify that both shell binaries are available for real Console mode:
npm run check:shells
Optional JSON output:
node server/check-shells.mjs --json
Readiness endpoint (no X-Connection-Id required):
curl http://localhost:3141/api/health
# { status: "ok", ready: true, ... }
Status endpoint requires active connection and supports shell-probe refresh:
curl http://localhost:3141/api/status \
-H "X-Connection-Id: <connectionId>"
curl "http://localhost:3141/api/status?refresh=1" \
-H "X-Connection-Id: <connectionId>"
MongoStudio does not silently remap mongo to mongosh.
Each mode is checked independently and reported as available/unavailable.
/api/service-config is connection-gated; PUT requires execution mode power.filter / sort / projection now returns 400 validation (no silent {} fallback on critical routes).exact_total_start, exact_total_done|timeout|error)./api/health, so container readiness is independent from active Mongo session./api/admin-access/*) gate Console and Server Management when ADMIN_ACCESS_KEY is set.server/service-config.json.| Variable | Default | Description |
|---|---|---|
PORT | 3141 | Server port |
NODE_ENV | development | Set to production in Docker |
MONGO_BIN | mongo | Legacy shell binary used by Console legacy mode |
MONGOSH_BIN | mongosh | Modern shell binary used by Console mongosh mode |
ADMIN_ACCESS_KEY | (none) | When set, requires this key to access Console and Server Management |
STATUS_SHELL_RUNTIME_TTL_MS | 15000 | TTL cache for runtime shell probe in /api/status |
MONGOSTAT_BIN | mongostat | Path to mongostat binary |
MONGOTOP_BIN | mongotop | Path to mongotop binary |
MONGODUMP_BIN | mongodump | Path to mongodump binary |
MONGORESTORE_BIN | mongorestore | Path to mongorestore binary |
MONGOEXPORT_BIN | mongoexport | Path to mongoexport binary |
MONGOIMPORT_BIN | mongoimport | Path to mongoimport binary |
MONGOFILES_BIN | mongofiles | Path to mongofiles binary |
MONGOSTAT_LEGACY_BIN | mongostat_legacy | Legacy mongostat for MongoDB < 4.2 |
MONGOTOP_LEGACY_BIN | mongotop_legacy | Legacy mongotop for MongoDB < 4.2 |
MONGODUMP_LEGACY_BIN | mongodump_legacy | Legacy mongodump for MongoDB < 4.2 |
MONGORESTORE_LEGACY_BIN | mongorestore_legacy | Legacy mongorestore for MongoDB < 4.2 |
MONGOEXPORT_LEGACY_BIN | mongoexport_legacy | Legacy mongoexport for MongoDB < 4.2 |
MONGOIMPORT_LEGACY_BIN | mongoimport_legacy | Legacy mongoimport for MongoDB < 4.2 |
MONGOFILES_LEGACY_BIN | mongofiles_legacy | Legacy mongofiles for MongoDB < 4.2 |
MIT — use it however you want.
Content type
Image
Digest
sha256:ade53933f…
Size
275.3 MB
Last updated
6 months ago
docker pull beztebya666/mongostudio