Public Repository

Last pushed: a month ago
Short Description
Crunchy PostgreSQL is an open source, unmodified PostgreSQL object-relational database system.
Full Description

Crunchy Postgres

The Crunchy Postgres docker image contains the following packages (versions vary depending on PostgreSQL version):

  • PostgreSQL (9.5, 9.6 and 10)
  • pgBackRest

Using the Image

Start PostgreSQL Instance

The following starts a PostgreSQL container:

$ docker run \
    --name=postgres \
    --hostname=postgres \
    --publish=5432:5432 \
    --env=PG_MODE=primary \
    --env=PG_PRIMARY_USER=primaryuser \
    --env=PG_PRIMARY_PASSWORD=password \
    --env=PG_PRIMARY_HOST=localhost \
    --env=PG_PRIMARY_PORT=5432 \
    --env=PG_DATABASE=userdb \
    --env=PG_USER=testuser \
    --env=PG_PASSWORD=password \
    --env=PG_ROOT_PASSWORD=password \
    --detach crunchydata/crunchy-postgres:centos7-10.3-1.8.2

Connect via psql

$ docker exec -ti postgres psql -U postgres -d postgres -h

Environment Variables

See the official documentation for a list of environment variables available for this container.


The following files can be mounted to /pgdata to apply custom configuration:

  • postgresql.conf
  • pg_hba.conf
  • pgbackrest.conf

In addition to configuration files, custom SQL can be executed by mounting a setup.sql
file to /pgdata.

More Examples

For more examples, see the official Crunchy Containers GitHub repository.

Docker Pull Command