PostgreSQL Docker Container Image
April 17, 2026 · View on GitHub
Docker Images
❗For better reliability we release images with stability tags (wodby/postgres:18-X.X.X) which correspond to git tags. We strongly recommend using images only with stability tags.
Overview:
- All images are based on Alpine Linux
- Base image: postgres
- GitHub actions builds
- Docker Hub
Supported tags and respective Dockerfile links:
18,latest(Dockerfile)18-postgis,postgis(Dockerfile)17(Dockerfile)17-postgis(Dockerfile)16(Dockerfile)16-postgis(Dockerfile)15(Dockerfile)15-postgis(Dockerfile)14(Dockerfile)14-postgis(Dockerfile)
All images built for linux/amd64 and linux/arm64
PostGIS Tags
Plain tags (18, 17, and so on) stay lean and do not include PostGIS.
PostGIS tags (18-postgis, 17-postgis, and so on) bundle PostGIS and default POSTGRES_DB_EXTENSIONS to:
postgis,postgis_raster,postgis_sfcgal,fuzzystrmatch,address_standardizer,address_standardizer_data_us,postgis_tiger_geocoder,postgis_topology
That means a container started from wodby/postgres:18-postgis or wodby/postgres:postgis will create the PostGIS extension set during initialization by default.
To override the default set:
docker run --rm \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB_EXTENSIONS=postgis \
wodby/postgres:18-postgis
Bundled PostGIS versions for the *-postgis tags:
- PostgreSQL
14-17: PostGIS3.5.5 - PostgreSQL
18: PostGIS3.6.2
Environment Variables
| Variable | Default Value | Description |
|---|---|---|
POSTGRES_CHECKPOINT_COMPLETION_TARGET | 0.7 | |
POSTGRES_CHECKPOINT_SEGMENTS | 32 | <=9.4 |
POSTGRES_DATESTYLE | iso, mdy | |
POSTGRES_DB | postgres | |
POSTGRES_DEFAULT_STATISTICS_TARGET | 100 | |
POSTGRES_DEFAULT_TEXT_SEARCH_CONFIG | pg_catalog.english | |
POSTGRES_EFFECTIVE_CACHE_SIZE | 1GB | |
POSTGRES_DB_EXTENSIONS | Separated by comma | |
POSTGRES_LC_MESSAGES | en_US.utf8 | |
POSTGRES_LC_MONETARY | en_US.utf8 | |
POSTGRES_LC_NUMERIC | en_US.utf8 | |
POSTGRES_LC_TIME | en_US.utf8 | |
POSTGRES_LOG_TIMEZONE | UTC | |
POSTGRES_MAINTENANCE_WORK_MEM | 128MB | |
POSTGRES_MAX_CONNECTIONS | 100 | |
POSTGRES_MAX_WAL_SIZE | 2GB | >=9.5 |
POSTGRES_MIN_WAL_SIZE | 1GB | >=9.5 |
POSTGRES_SHARED_BUFFERS | 512MB | |
POSTGRES_SHARED_MEMORY_TYPE | posix | >=9.4 |
POSTGRES_TIMEZONE | UTC | |
POSTGRES_PASSWORD | REQUIRED | |
POSTGRES_USER | postgres | |
POSTGRES_WAL_BUFFERS | 16MB | |
POSTGRES_WORK_MEM | 5MB |
Orchestration Actions
Usage:
make COMMAND [params ...]
commands:
import source=</path/to/dump.zip or http://example.com/url/to/dump.sql.gz> [user password db host binary]
backup filepath=</path/to/backup.sql.gz> [user password host db ignore=<"table1;table2"> nice ionice]
query query=<SELECT 1> [user password db host]
query-silent query=<SELECT 1> [user password db host]
create-db name enconding lc_collate lc_ctype
also creates a schema with the same name inside the database
drop-db name
drops the database; the same-name schema is removed with it
create-user username password
drop-user username
grant-user-db username db
also grants access to the same-name schema inside that database
and sets the user's search_path for that database to "<db>", public
revoke-user-db username db
also revokes access to the same-name schema inside that database
and resets the user's search_path for that database
check-ready [user password db host max_try wait_seconds delay_seconds]
default params values:
user $POSTGRES_USER
password $POSTGRES_PASSWORD
db $POSTGRES_DB
host localhost
max_try 1
wait_seconds 1
delay_seconds 0
ignore ""
binary 0
nice 10
ionice 7
Deployment
Deploy PostgreSQL to your server via Wodby.