# mongo-express

mongo-express is a lightweight web interface for MongoDB. Browse databases and collections, view and edit documents, run queries, manage indexes, and import or export data, all from a browser.

On ElfHosted it gives you a ready-made admin page for a MongoDB server you already run somewhere else (*a managed cloud database, a VPS, or a home server reachable over the internet*), without installing anything on your own machines.

**Things to know before you start**

- **It connects to one MongoDB at a time**, the one you set in its connection string. To look at a different server, change the connection string.
- **It has no database of its own to show you.** Your ElfHosted apps keep their databases private to themselves, so mongo-express can only reach MongoDB servers on the internet.
- **Your MongoDB has to accept connections from the internet**, ideally over TLS with a username and password. If yours only listens on a private network, mongo-express can't reach it.

[Get a 7-day trial of ElfHosted mongo-express! 🪄](<https://store.elfhosted.com/product/mongo-express/>)

## How do I access mongo-express?

mongo-express is available:

- From your dashboard: [https://your-username.elfhosted.com](<https://your-username.elfhosted.com>)
- Directly: [https://your-username-mongoexpress.elfhosted.com](<https://your-username-mongoexpress.elfhosted.com>)

> [!NOTE]
>
> **Signed-in users see their own URLs**
>
> The addresses above show the general pattern. [Sign in](<https://docs-internal.elfhosted.com/app/mongo-express/>) and these become your personal, clickable links.

## How do I use it?

mongo-express sits behind your ElfHosted login. Its settings are environment variables, which you set with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>) (or ask Sam). mongo-express restarts to pick them up.

### Connect it to your MongoDB

Quick-paste into mongo-express's environment variables using ElfBot

```
ME_CONFIG_MONGODB_URL=mongodb+srv://<user>:<password>@<your-cluster-host>/?retryWrites=true
```

Use the connection string your MongoDB provider gives you. If the user in the string can't list every database on the server, also set this, so mongo-express sticks to the database named in the connection string:

Quick-paste into mongo-express's environment variables using ElfBot

```
ME_CONFIG_MONGODB_ENABLE_ADMIN=false
```

### Its own login

After your ElfHosted login, mongo-express asks for a username and password of its own. Out of the box these are `admin` and `pass`. Set your own:

Quick-paste into mongo-express's environment variables using ElfBot

```
ME_CONFIG_BASICAUTH_USERNAME=<username>
ME_CONFIG_BASICAUTH_PASSWORD=<a long password>
```

### Look, don't touch

To browse a production database without any risk of changing it, switch mongo-express to read-only. The editing and deleting controls disappear:

Quick-paste into mongo-express's environment variables using ElfBot

```
ME_CONFIG_OPTIONS_READONLY=true
```

## How do I get support for mongo-express?

1. For general use of mongo-express, refer to the [official site](<https://github.com/mongo-express/mongo-express>) or to one of the links in the resources section below.
2. For specific support re your ElfHosted configuration / account, see the [ElfHosted support options](</get-help/>)!

## mongo-express resources

- [mongo-express (*official site*)](<https://github.com/mongo-express/mongo-express>)
