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

# Database access and security

> Limit which IP addresses can reach a database, reset its password, and transfer it.

By default, anyone with a database's host, port and password can connect to it. That's convenient while you build, and it's how most apps on Pxxl reach their database. For production, you can narrow it down: allow only certain IP addresses, rotate the password, and move the database to a team.

All of this is in the database's **Settings > Networking** and **Settings > Ownership**.

## Allowed IPs

An allowlist makes the database refuse connections from every address that isn't on it, even with the right password.

![The Allowed IPs card in a database's Networking settings, with an Addresses box and the Allow apps on Pxxl switch turned on.](https://mintcdn.com/pxxl/jmHqW1Ax8HZi8e3v/images/databases/allowed-ips.jpeg?fit=max\&auto=format\&n=jmHqW1Ax8HZi8e3v\&q=85\&s=a89c295a6bc4bfa464f063b7298e97f9)

**1. Open Networking**

Open the database, select **Settings**, then **Networking**.

**2. Add addresses**

In **Addresses**, put one IPv4 address, IPv6 address or CIDR range per line, for example `203.0.113.7` or `198.51.100.0/24`. **Add my IP** adds the address you're browsing from.

**3. Decide about apps on Pxxl**

Keep **Allow apps on Pxxl** on if your Pxxl projects use this database. See [below](#allow-apps-on-pxxl).

**4. Save**

Choose **Save access**. The new list applies to new connections straight away.

| Rule | Detail |
| - | - |
| **Entries** | Up to 100. A bare IP is saved as a single address (`/32` or `/128`). Duplicates are removed. |
| **Empty list** | The default. Anyone with the password can connect. |
| **`0.0.0.0/0` or `::/0`** | Refused. Leave the list empty instead. |
| **Stopped database** | The list is saved and applied when the database starts. |
| **If saving fails** | Nothing changes. The previous list stays in force. |

### Allow apps on Pxxl

Your projects on Pxxl connect from Pxxl's servers, not from a fixed address of your own. **Allow apps on Pxxl** adds those servers' addresses, and the [static outbound IP](https://docs.pxxl.app/networking/static-outbound-ip.md), to your list for you. It's on by default.

Those addresses are shared by every app on Pxxl, so with it on, the password is still what keeps other workloads out. Turn it off if only outside systems connect to this database, such as an app hosted elsewhere or your office network.

### From the API

```bash theme={null}
# Read the current list (also returns the IP you're calling from)
curl https://server.pxxl.app/api/v3/databases/db_123/access \
  --header "Authorization: Bearer $PXXL_API_KEY"

# Replace it
curl --request PUT https://server.pxxl.app/api/v3/databases/db_123/access \
  --header "Authorization: Bearer $PXXL_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"allowedIps":["203.0.113.7","198.51.100.0/24"],"allowPxxlApps":true}'
```

## Reset the password

Under **Settings > Networking > Reset password**, type a new password of at least 12 characters, or choose **Generate**, then **Change password**.

Every app or tool still using the old password stops connecting at once. Update `DATABASE_URL` in your projects (or the [Vault](https://docs.pxxl.app/vault/overview.md) secret they reference) and redeploy.

| Engine | Can reset |
| - | - |
| PostgreSQL | Yes |
| MySQL, MariaDB, MongoDB, Redis, KeyDB | Only databases created with their own app user. The card is hidden otherwise. |
| DragonflyDB, ClickHouse | No. Create a new database and move the data if the password leaks. |

## Require SSL

The **Require SSL** switch is shown for MySQL only, and managed SSL enforcement isn't available yet for any engine. See [encryption in transit](https://docs.pxxl.app/databases/connect.md#encryption-in-transit).

## Transfer ownership

**Settings > Ownership** transfers the database to another owner, such as a team. Check the new owner's plan has room for another database first.

## Where to go next

> [card] [Connect to a database](https://docs.pxxl.app/databases/connect.md)
>
> URL formats and code examples.

> [card] [Backups](https://docs.pxxl.app/databases/backups.md)
>
> Keep restorable copies of your data.


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