---
title: "Docker: Changing database credentials"
description: When your Docker container uses /opt to store the policy database on a separate volume, you can change the database credentials.
component: pingauthorize
version: 11.0
page_id: pingauthorize:pingauthorize_server_administration_guide:paz_docker_change_db_creds
canonical_url: https://docs.pingidentity.com/pingauthorize/11.0/pingauthorize_server_administration_guide/paz_docker_change_db_creds.html
revdate: April 28, 2025
section_ids:
  steps: Steps
  example: Example
---

# Docker: Changing database credentials

When your Docker container uses `/opt` to store the policy database on a separate volume, you can change the database credentials.

Given that you are changing the credentials, you already have a Docker container running with a mounted volume.

## Steps

1. Stop the Docker container.

2. Start the Docker container. In the `docker run` command, specify the desired following environment variables using the `--env` command-line option:

   * `--dbAdminUsername`

   * `--dbAdminPassword`

   * `--dbAppUsername`

   * `--dbAppPassword`

   Also specify `-p`, `-d`, `--env-file`, `--volumes-from`, and `--env PING_H2_FILE`.

## Example

For example, if you have a container named `pap` with a mounted volume as shown in the example in [Deploying the Policy Editor using Docker](../installing_and_uninstalling_pingauthorize/paz_install_server_pe_docker.html#pe_install_docker), the following command changes the credentials for the admin and application accounts from their default values to `admin`/ `Passw0rd` and `app`/ `S3cret`, respectively.

|   |                                                                                                                                                                                                                                           |
| - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | For proper communication between containers, create a Docker network using a command such as `docker network create --driver <network_type> <network_name>`, and then connect to that network with the `--network=<network_name>` option. |

```shell
docker run --network=<network_name>  -p 443:1443 -d \
  --env-file ~/.pingidentity/config \
  --volumes-from pap \
  --env PING_DB_ADMIN_USERNAME=admin \
  --env PING_DB_ADMIN_PASSWORD=Passw0rd \
  --env PING_DB_APP_USERNAME=app \
  --env PING_DB_APP_PASSWORD=S3cret \
  --env PING_H2_FILE=/opt/out/Symphonic \
  pingidentity/{PAP_CONTAINER_NAME}:<TAG>
```

The Docker image *\<TAG>* used in the example is only a placeholder. For actual tag values, see Docker Hub (<https://hub.docker.com/r/pingidentity/pingauthorize>).
