How do I rotate the credentials for a Heroku Postgres database?


I want to rotate the credentials used to access a Heroku Postgres instance.


You can rotate the credentials for a database by following the instructions here: Provided that your application is using the value of the DATABASE_URL environment variable this should not cause any disruption, as the app will be restarted to pick up the new credentials. You can find instructions on connecting in various languages here:

If you are connecting to these databases externally you would need to manually re-enter the new credentials or setup a system to poll for changes using the Heroku Platform API

Heroku does not perform and scheduled credential rotation for Common Runtime databases. However, during certain types of maintenance events (for example patching for security) the credentials will be rotated automatically.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support