> ## 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.

# Add a database

> Add a database, cache or queue, self-hosted or managed, and wire it to your app

Add a database, cache or message queue to your app. You choose whether it runs as a container on your cluster or as a managed service in a provider account.

## Before you start

* Your app is deployed, or you have a plan. See [Deploy an existing app](/guides/deploy-existing-app).
* For a managed service, an account with that provider. Monk asks for its credentials through a form.

## Ask Monk

If your code already uses a database, Monk finds it when it plans:

```
/monk plan a deployment for this app
```

To add one, or to pick how it runs, say so:

```
/monk add a Postgres database for the api
/monk use AWS RDS for Postgres
/monk use MongoDB Atlas instead of a self-hosted MongoDB
/monk add Redis as a cache
```

Your coding agent adds any code the app needs to use the new service. Monk adds the service to the `MANIFEST` and connects it.

## Self-hosted or managed

| | Self-hosted | Managed |
| - | - | - |
| Runs | As a container on your cluster | In the provider's account (for example RDS, Cloud SQL, Atlas, Neon, DigitalOcean, Redis Cloud) |
| You pay | For the cluster machines | The provider, on top of the cluster |
| Backups | Your responsibility | The provider's backup features, where available |
| Credentials | None beyond your cloud | A provider API key, entered in a form |

See the [integrations catalog](https://monk.io/integrations) for what Monk can run.

## What you review

The plan in the [local dashboard](/getting-started/local-dashboard) shows the new service, its size, which services connect to it and the estimated cost. Database passwords are generated or entered through a secret form, never in chat. Nothing is created until you approve.

## What you get

* The database running, self-hosted or managed
* Connection settings (host, port, user, password or a connection string) injected into the services that use it
* The database in Monk's model of your app, so later requests about logs, backups or costs include it

## Limits

* Monk does not move data between databases. Copying data from an old database is a separate step. See [Back up and restore](/guides/backup-and-restore).
* Self-hosted databases have no automatic backups unless you add them.

## Next

* [MongoDB Atlas](/guides/mongodb-atlas)
* [Back up and restore](/guides/backup-and-restore)
* [Services and data](/concepts/services-and-data)


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