> For the complete documentation index, see [llms.txt](https://docs.monolithforensics.com/monolith/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.monolithforensics.com/monolith/deployment-and-security/on-premises-deployments/using-external-mysql-database.md).

# Using External MySQL Database

Monolith can use an external MySQL database instead of the MySQL Docker container included with the standard on-premises deployment.

This can be used when your organization prefers to host and manage the Monolith database separately from the application containers.

### Configure the External Database

To configure an external MySQL database, update the database connection values in the `.env` file included with your Monolith deployment.

The following values define the connection:

```
MONOLITH_DB_NAME=
MONOLITH_DB_USER=
MONOLITH_DB_PORT=
MONOLITH_DB_HOST=
MONOLITH_DB_PASSWORD=
```

Configure each value using the connection information for the MySQL database that will store your Monolith data.

* **MONOLITH\_DB\_NAME:** Name of the Monolith database
* **MONOLITH\_DB\_USER:** MySQL user used by Monolith
* **MONOLITH\_DB\_PORT:** Port used by the MySQL server
* **MONOLITH\_DB\_HOST:** Hostname or IP address of the MySQL server
* **MONOLITH\_DB\_PASSWORD:** Password for the configured MySQL user

When using an external MySQL database, database hosting, backup, and recovery should be planned according to your organization's infrastructure requirements.

See **Backups** for additional guidance on protecting Monolith data.

### Related Documentation

* [**On-Premises Deployments**](/monolith/deployment-and-security/on-premises-deployments.md)
* [**Monolith Containers (Docker)**](/monolith/deployment-and-security/on-premises-deployments/monolith-containers-docker.md)
* [**Deployment**](/monolith/deployment-and-security/on-premises-deployments/deployment.md)
* [**Monolith Data**](/monolith/deployment-and-security/on-premises-deployments/monolith-data.md)
* [**Backups**](/monolith/deployment-and-security/on-premises-deployments/backups.md)
