# Self-host Mongo Express

> A web admin console for MongoDB, bundled with its own MongoDB 7 instance and basic auth.

- Page: https://levelrail.com/templates/mongo-express/
- JSON: https://levelrail.com/templates/mongo-express.json
- Category: Database Tools
- Licence: MIT (Permissive license)
- Source: https://github.com/mongo-express/mongo-express
- Upstream docs: https://github.com/mongo-express/mongo-express

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 7

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| mongo | mongo | 7 | none | mongo_data -> /data/db |
| mongo-express | mongo-express | 1.0.2-20-alpine3.19 | 8081 | none |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| mongo | MONGO_INITDB_ROOT_PASSWORD | generated |
| mongo | MONGO_INITDB_ROOT_USERNAME | preset |
| mongo-express | ME_CONFIG_BASICAUTH_PASSWORD | generated |
| mongo-express | ME_CONFIG_BASICAUTH_USERNAME | generated |
| mongo-express | ME_CONFIG_MONGODB_ENABLE_ADMIN | preset |
| mongo-express | ME_CONFIG_MONGODB_URL | generated |

## Deploy

### CLI

```bash
levelrail-cli templates deploy mongo-express --name my-mongo-express
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/mongo-express/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy Mongo Express on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Mongo Express, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image mongo:7, mongo-express:1.0.2-20-alpine3.19 is what you deploy there.

Self-host Mongo Express, Mongo Express docker compose file, deploy Mongo Express on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
