> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MongoDB with Atlas

> Run your app's MongoDB on Atlas, DigitalOcean or as a container, and wire it to your app

Choose how your app's MongoDB runs and let Monk create it and connect it to your services. This guide covers MongoDB Atlas in detail, plus the other two options.

## Before you start

* Your app already uses MongoDB (a driver such as `mongodb`, `mongoose` or `pymongo`). Monk runs the database. Your code connects to it.
* For Atlas: an Atlas organization API key. See [MongoDB Atlas credentials](/getting-started/obtaining-credentials#mongodb-atlas) for the permissions it needs. Monk asks for it through a form.
* For DigitalOcean: [DigitalOcean credentials](/getting-started/credentials-digitalocean).

## Pick an option

| Option | Runs | Backups |
| - | - | - |
| Self-hosted | A MongoDB container on your cluster | Your responsibility (`mongodump`, volume snapshots) |
| DigitalOcean managed | DigitalOcean's managed MongoDB | DigitalOcean's backups |
| MongoDB Atlas | An Atlas cluster in your Atlas organization | Atlas backups on dedicated tiers (M10 and up) |

Atlas tiers include a free shared tier (M0), dedicated clusters (M10 and up) and Flex. Check Atlas's own pricing for each.

## Ask Monk

```
/monk plan a deployment for this app with MongoDB on Atlas
```

Or be specific:

```
/monk use an Atlas M10 cluster on AWS in eu-west-1 for MongoDB
/monk use DigitalOcean managed MongoDB
/monk run MongoDB as a container on the cluster
```

## What you review

1. **Credentials.** The Atlas API key form opens in the [local dashboard](/getting-started/local-dashboard). Enter the keys there, never in chat.
2. **The plan.** For Atlas it shows the project, cluster tier, cloud and region, the database user Monk creates and the network access it adds for your cluster. Nothing is created until you approve.

## What you get

* A MongoDB database on the option you chose
* A database user for your app and a connection string injected into the services that use it
* For Atlas: a project in your organization, and network access for your cluster's addresses

## Backups

On Atlas dedicated tiers, the integration provides snapshot and restore actions. Ask Monk to run them and approve each one:

```
/monk which backup actions does the Atlas cluster have?
/monk take a snapshot of the Atlas cluster
```

The free tier (M0) has no backup actions. See [Back up and restore](/guides/backup-and-restore).

## Switching options later

```
/monk switch MongoDB from the container to Atlas
```

Monk creates the new database and updates connection settings after you approve the plan. It does not copy your data. Export from the old database and import into the new one (for example with `mongodump` and `mongorestore`) before you switch, then remove the old database.

## Next

* [Add a database](/guides/add-a-database)
* [Services and data](/concepts/services-and-data)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.