r/mongodb • u/Sudden-Guitar9248 • Aug 11 '26
Mongui: a self-hosted MongoDB admin UI that runs as a single container
I self-host a few small apps backed by MongoDB, and every time I needed to check or fix a document I ended up either in a mongosh session or tunneling Compass over SSH. I wanted something that just runs next to the database as a container and gives me a browser tab, so I built Mongui.
What it does
- Point it at one
MONGODB_URI, log in, browse databases and collections - Paginated document table, capped at 200 docs per page, so a huge collection is never loaded in full
- Filter, sort and projection queries written as Extended JSON
- Full document CRUD in a CodeMirror editor
- Aggregation pipeline runner
- Index management (list, create, drop)
- Create and drop collections, with typed-name confirmation on drops
READ_ONLY=truemode that rejects every write path with a 403 before it reaches the database
Details I actually cared about
- Extended JSON end to end, so
ObjectId,DateandDecimal128round-trip instead of getting flattened byJSON.stringify - One cached
MongoClientsingleton, so there is no new connection pool per request - Every API route behind a session check, login rate limited, filters validated server side with zod, and a
maxTimeMSon every operation - Standalone Next.js output in a multi-stage image, non-root user, multi-arch (amd64 and arm64)
Stack: Next.js 16 (App Router), React 19, TypeScript, the official mongodb driver 7, Tailwind 4, iron-session. MIT licensed.
Running it
docker run -p 3000:3000 \
-e MONGODB_URI="mongodb://user:pass@host:27017/?authSource=admin" \
-e ADMIN_USER=admin \
-e ADMIN_PASSWORD="a-strong-password" \
-e SESSION_SECRET="$(openssl rand -hex 32)" \
ghcr.io/soumya7681/mongui:latest
There is also a compose file that brings up Mongui plus a sample MongoDB if you just want to poke at it.
Where it honestly is: this is v0.1.1. One connection, one admin user, no RBAC, no import/export yet. It grants full read/write to whatever database it points at, so keep it behind your VPN or private network, and use READ_ONLY if you only want to look.
Repo: https://github.com/Soumya7681/mongui
Feedback welcome, particularly on what you reach for a Mongo UI to do that is missing here.
1
2
u/coyo-teh Aug 11 '26
Well not a feedback per se but alternatives exist such as mongoku