---
title: "Deploy Mongo Express 1.0 with MongoDB 8.0"
description: "MongoDB web admin behind a password login, plus a ready MongoDB 8.0."
category: "Storage"
url: https://railway.com/deploy/mongo-express-10-with-mongodb-80
---

# Deploy Mongo Express 1.0 with MongoDB 8.0

MongoDB web admin behind a password login, plus a ready MongoDB 8.0.

**[Deploy Mongo Express 1.0 with MongoDB 8.0 on Railway](https://railway.com/template/mongo-express-10-with-mongodb-80)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/mongo-express-10-with-mongodb-80/manifest.json

- **Creator:** Tracklayer
- **Category:** Storage
- **Total deploys:** 1

## Template content

### MongoDB https://devicons.railway.app/i/mongodb.svg

- **Image:** mongo:8.0.38@sha256:479e85ced54ffb8a40dade1dcde2da2a9ae858515b9415e9cc54bfb8f0575d01
- **Start command:** `docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0 --setParameter diagnosticDataCollectionEnabled=false`

### Mongo Express https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mongodb.svg

- **Image:** mongo-express:1.0.2-20-alpine3.19@sha256:1aae0077525133249133d42980ba23998712a1077e02ac0ac295b50a7a79d550
- **Start command:** `/bin/bash -c 'set -e; export ME_CONFIG_BASICAUTH=true; U="${ME_CONFIG_BASICAUTH_USERNAME:-}"; if [ -z "$U" ]; then echo "me-start: ME_CONFIG_BASICAUTH_USERNAME is empty, using admin"; export ME_CONFIG_BASICAUTH_USERNAME=admin; fi; P="${ME_CONFIG_BASICAUTH_PASSWORD:-}"; if [ ${#P} -lt 8 ] || [ ${#P} -gt 128 ]; then echo "me-start: WARNING ME_CONFIG_BASICAUTH_PASSWORD must be 8-128 characters (got ${#P}). The login is locked with a random password."; echo "me-start: Fix: set ME_CONFIG_BASICAUTH_PASSWORD to 8-128 characters and redeploy."; export ME_CONFIG_BASICAUTH_PASSWORD="$(head -c 48 /dev/urandom | base64 | tr -dc A-Za-z0-9 | head -c 40)"; fi; unset P; case "${PORT:-}" in ""|*[!0-9]*) echo "me-start: PORT=${PORT:-} is not a number, using 8081"; export PORT=8081 ;; esac; export ME_CONFIG_CONNECT_RETRIES="${ME_CONFIG_CONNECT_RETRIES:-300}"; case "$ME_CONFIG_CONNECT_RETRIES" in ""|*[!0-9]*) export ME_CONFIG_CONNECT_RETRIES=300 ;; esac; W="${ME_CONFIG_MONGODB_URL:-}"; H=""; case "$W" in *,*|mongodb+srv:*|"") ;; *) W=${W#*://}; W=${W%%/*}; W=${W%%[?]*}; W=${W##*@}; H=${W%:*}; P=${W##*:} ;; esac; if [ "$H" = "$W" ]; then P=27017; fi; case "${P:-}" in ""|*[!0-9]*) P=27017 ;; esac; N=0; if [ -n "$H" ]; then echo "me-start: waiting for $H:$P"; until timeout 3 bash -c "exec 6<>/dev/tcp/$H/$P" 2>/dev/null; do N=$((N + 1)); if [ $N -ge $ME_CONFIG_CONNECT_RETRIES ]; then echo "me-start: $H:$P still unreachable after $N attempts, starting anyway"; break; fi; sleep 1; done; fi; echo "me-start: basic auth on (user $ME_CONFIG_BASICAUTH_USERNAME), listening on ${VCAP_APP_HOST:-0.0.0.0}:$PORT"; cd /app; exec /sbin/tini -- node app' me-start`
- **Health check:** /status
- **Public domain:** Yes

## Documentation

# Deploy and Host Mongo Express with Railway

Mongo Express is a lightweight web-based admin interface for MongoDB, built with Node.js and Express. This template deploys Mongo Express 1.0 behind a mandatory password login, connected over Railway's private network to a bundled MongoDB 8.0 database, so you can browse collections and edit documents minutes after you deploy.

## About Hosting Mongo Express

Mongo Express is a single Node.js process that talks to MongoDB with a connection string and serves a small web UI. It keeps no data of its own. Hosting it safely is mostly about access: the UI can read, edit and drop everything its MongoDB user can, so it must never be reachable without a login, and the database itself should stay off the internet. This template turns on Mongo Express's HTTP basic auth with a generated password (a missing or weak password never falls back to the built-in default), keeps MongoDB on Railway's private network only, waits for MongoDB at start, and pins both images to exact digests.

## Common Use Cases

- Browse databases and collections of a Railway MongoDB from the browser
- Insert, edit and delete documents with a JSON editor
- Run queries and simple aggregations, add and drop indexes
- Import and export collections as JSON or CSV
- View GridFS files

## Dependencies for Mongo Express Hosting

- Mongo Express web UI (`mongo-express` official image)
- A MongoDB server to manage (bundled: MongoDB 8.0)

### Deployment Dependencies

- Mongo Express source and configuration: https://github.com/mongo-express/mongo-express
- Mongo Express Docker image: https://hub.docker.com/_/mongo-express
- MongoDB 8.0 manual: https://www.mongodb.com/docs/manual/
- Railway private networking: https://docs.railway.com/guides/private-networking

### Implementation Details

| Service | Image | Purpose | Public |
|---|---|---|---|
| Mongo Express | `mongo-express:1.0.2-20-alpine3.19` (digest-pinned) | Web UI on port 8081, basic auth | HTTPS domain |
| MongoDB | `mongo:8.0.38` (digest-pinned) | Database, volume `/data/db` | No (private network only) |

**First login**: open the Mongo Express service → Variables, copy `ME_CONFIG_BASICAUTH_USERNAME` (default `admin`) and `ME_CONFIG_BASICAUTH_PASSWORD`, open the public domain and enter them when the browser asks. To rotate the password, change the variable and redeploy. If the password is empty or shorter than 8 characters, the start log says so and the login is locked with a random password until you set a valid one; the deploy never falls back to a default password.

**Manage another MongoDB** (same project): set `ME_CONFIG_MONGODB_URL` on Mongo Express to that database's private URL, for example `${{MongoDB.MONGO_URL}}` or `mongodb://{user}:{password}@{service}.railway.internal:27017/?authSource=admin`, then redeploy. For a database user without admin rights, include the database name in the URL and set `ME_CONFIG_MONGODB_ENABLE_ADMIN=false`. Replica-set URLs (several hosts) work too. A database in another project or provider needs its TCP proxy host and port (or `mongodb+srv://` for Atlas). You can delete the bundled MongoDB service if you only manage other databases.

**Connect your apps to the bundled MongoDB**: reference `${{MongoDB.MONGO_URL}}` in your app's variables. MongoDB has no public port; enable a TCP proxy on the MongoDB service to reach it from outside Railway.

**Read-only mode**: set `ME_CONFIG_OPTIONS_READONLY=true` to hide every write action, useful for production data.

**Scaling and upgrades**: Mongo Express is stateless and light; one replica is plenty. To upgrade, change the image tag and digest in the service settings. MongoDB minor updates (8.0.x) are drop-in; a major upgrade (8.0 → 9.0) needs `setFeatureCompatibilityVersion` steps from the MongoDB manual, so take a `mongodump` first.

**Good to know**: Mongo Express 1.0.2 is the latest stable release and the project changes slowly; use it as an admin tool behind its login, not as an app for end users. Basic auth sends the password with every request, which is safe here because Railway serves the domain over HTTPS only. This is a community template and is not affiliated with the Mongo Express project or MongoDB, Inc.

### Why Deploy Mongo Express on Railway?

Railway runs Mongo Express and MongoDB side by side on a private network with a persistent volume, HTTPS and logs handled for you. One click gives you a working MongoDB plus a password-protected browser admin for it, and the same UI can be pointed at the other MongoDB services in your project.


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/mongo-express-10-with-mongodb-80
