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

# Databases

> Create a managed database and connect your app to it.

Pxxl runs managed databases next to your apps. Create one, copy its URL into your project, and redeploy.

## Engines

| Engine | Good for |
| - | - |
| **PostgreSQL** | Most apps and APIs. |
| **MySQL** | Existing MySQL apps. |
| **MariaDB** | MySQL-compatible apps. |
| **MongoDB** | Document data. |
| **Redis** | Cache, queues, sessions. |
| **KeyDB** | Redis-compatible, multi-threaded. |
| **DragonflyDB** | Redis-compatible cache and queues. |
| **ClickHouse** | Analytics and large column queries. |

PostgreSQL and MySQL are on the Free plan. The other engines depend on your plan.

## Create a database

**1. Open Database**

In the dashboard, open **Database** and choose **New Database**.

**2. Pick an engine and name**

Use a name that says what it holds, such as `orders-production`.

**3. Turn on backups (optional)**

Paid plans can take daily encrypted backups. See [Backups](https://docs.pxxl.app/databases/backups.md).

**4. Wait until it's running**

Connect your app once the status shows healthy or running.

From the CLI:

```bash theme={null}
pxxl db create
```

See [CLI commands](https://docs.pxxl.app/cli/commands.md#databases) for the options.

## Connect your app

Open the database and select **Connection**. Copy the **Database URL**, or the host, port, user, and password.

Add it to your project as an environment variable, then redeploy:

```bash theme={null}
DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DATABASE
```

When you create a database from inside a project, turn on **Add DATABASE\_URL** and Pxxl adds the variable for you.

> [!WARNING]
>
> Don't use `localhost`. Inside your app's container, `localhost` is the container itself. Use the host Pxxl shows you.

> [!TIP]
>
> Running apps don't pick up new variables until they restart. Redeploy after you add or change `DATABASE_URL`.

## Database page tabs

| Tab | What it does |
| - | - |
| **Connection** | Shows the URL and credentials. Secrets are hidden until you reveal them. |
| **Monitoring** | Health, connections, storage, transfer, latency. |
| **Visualise** | Browse tables, rows, relationships (ERD), and run queries. |
| **Backup** | Daily and manual backups, download, and restore. |
| **Settings** | Resources, networking, transfer, start, stop, restart, delete. |

## Stop, restart, delete

Open **Settings**. **Stop** pauses the database and your app's connections fail until you start it again. **Delete** is permanent. Take a backup first.

## Next steps

* [Backups](https://docs.pxxl.app/databases/backups.md)
* [Private networking](https://docs.pxxl.app/networking/private-networking.md)
* [Database troubleshooting](https://docs.pxxl.app/troubleshooting/databases.md)


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