How to connect to my WunderPreview database

WunderPreview gives to the ability to add a PostgreSQL database to your account. Each GitHub organization that you have added to your WunderPreview can have one database.

The database runs in the same cloud infrastructure as your previews and is only accessible by your previews.

But: How can I connect to this database?

The answer is as so often: environment variables!

There are a number of environment variables injected into your previews containing the information necessary to connect to your database.

The environment variables are available during build-time of the container that will power your preview and also during run-time of your preview.

Here is the list of environment variables and what they contain:

  • WDPR_DB_USERNAME the username to use when connecting to your database. (e.g.: myorga)
  • WDPR_DB_PASSWORD the password to use when connecting to your databse. (e.g.: j235h23l4j234h2klhfdlakf)
  • WDPR_DB_HOST the host where your database is running. (e.g.:
  • WDPR_DB_PORTthe port on which the database is running. (e.g.: 5432)
  • WDPR_DB_DATABASE the name of your database. (e.g.: myorga)
  • WDPR_DB_CONNECTION_STRING a database connection string containing all information necessary to connect to your database. (e.g.: postgres:// )

You can also find this information in the settings screen of your database:

WunderPreview database settings screen showing how to connect to PostgreSQL database.
WunderPreview database settings

Do you have any questions or remarks? Just send us an email to We are happy to hear from you!

Keep things moving with automated previews.

Screenshot of WunderPreview Dashboard