PostgreSQL extensions
as stackable layers
The official PostgreSQL Docker images include only a handful of ready-to-use extensions. pglayers gives you pre-built extensions that stack on top of the official images. No compilers, no dependencies, no waiting.
Includes pgvector for AI embeddings, PostGIS for geospatial queries, pg_lake for Iceberg/data lake access, and much more. Extension availability varies by PostgreSQL version.
# PostgreSQL 19 GA: 62 extensions, pre-configured docker run -d -e POSTGRES_PASSWORD=secret \ ghcr.io/pglayers/pglayers-full:19 # Azure profile on PG19: 24 extensions docker run -d -e POSTGRES_PASSWORD=secret \ ghcr.io/pglayers/pglayers-azure:19 # Or compose your own PG19 image (Dockerfile) FROM postgres:19 COPY --from=ghcr.io/pglayers/pgx-pgvector:19 / /extensions/pgvector/ RUN echo "extension_control_path = '/extensions/pgvector/share:\$system'" \ >> /usr/share/postgresql/postgresql.conf.sample \ && echo "dynamic_library_path = '/extensions/pgvector/lib:\$libdir'" \ >> /usr/share/postgresql/postgresql.conf.sample
PostgreSQL 19 is ready
Built on the official GA images, including postgres:19. Choose your PostgreSQL major and the extension set you need. Every published image supports amd64 and arm64.
| PostgreSQL (GA) | Individual layers | Full profile | Azure profile |
|---|---|---|---|
| 19 | 62 | 62 | 24 |
| 18 | 84 | 83 | 31 |
| 17 | 84 | 83 | 31 |
The catalog has 84 extensions, not 84 in every image. PG19 currently has 62 compatible layers; others are waiting on upstream support or packages. On PG17/18, the full profile includes 83 extensions: pg_lake is excluded because it conflicts with pg_duckdb, but remains available as an individual layer.
CI builds both architectures, tests layer loading and functionality on each supported major, and validates Azure profiles, the PG19 full profile, and Kubernetes/CloudNativePG on PG18/19. See the extension catalog and PG19 compatibility notes.
Extensions without the pain
Stop wrestling with build dependencies. Each extension is a minimal Docker image layer you stack on top of the official PostgreSQL image.
Composable Layers
Each extension is a self-contained Docker layer. Copy the layers you need and configure PostgreSQL to discover them. Choose compatible extensions for your workload.
Official Base Images
Built on top of the official postgres Docker images. Same security patches, same update cadence, same trust chain.
Instant Builds
No compilation, no waiting. Docker pulls pre-built layers from the registry and overlays them in seconds.
Tested & Verified
Each supported extension/version pair is tested for dependency resolution, isolation, loading, and functionality. Profile images also get startup-log and server-crash checks.
Multi-Architecture
All images support linux/amd64 and linux/arm64. Docker automatically pulls the right architecture for your platform.
License-Checked
Automated license checks enforce the project's open-source policy, with documented exceptions for PostGIS and pgRouting. No proprietary client dependencies.
Profile images
Pre-configured images for PostgreSQL 17, 18, and 19, with extension paths and preload libraries already set. Pick a major version using the image tag.
Azure
A curated subset of extensions available in Azure Database for PostgreSQL Flexible Server, for local development. Versions and managed-service behavior can differ. DocumentDB's MongoDB wire protocol is included on PG17/18 only, not PG19.
docker run -d -e POSTGRES_PASSWORD=secret ghcr.io/pglayers/pglayers-azure:19
Why does PG19 include fewer extensions?
These seven Azure-profile members are not yet available in pglayers for PG19: age, documentdb, pg_duckdb, pg_failover_slots, rum, tds_fdw, and timescaledb. Their upstream code, packages, or images still need compatible releases and validation.
Full
The broadest compatible extension set for each PostgreSQL major. PG19 includes pgvector, PostGIS, pg_cron, pg_textsearch, pg_lake, and more. PG17/18 keep pg_duckdb instead of the conflicting pg_lake layer.
docker run -d -e POSTGRES_PASSWORD=secret ghcr.io/pglayers/pglayers-full:19
Runtime extensions via ImageVolumes
PostgreSQL 18 introduced extension_control_path. PG18 and PG19 use isolated extension directories, so you can mount layers at deploy time with no custom image build.
Kubernetes ImageVolumes
Each extension image mounts as a read-only volume at /extensions/<name>/. Add or remove extensions by changing Pod volumes -- no image rebuild needed.
CloudNativePG Compatible
Images use the CNPG-standard layout (/lib/ + /share/extension/). Generate a ClusterImageCatalog with one command and let the operator handle the rest.
OCI Labels for Discovery
Every image includes standard OCI labels (name, version, license, PG version) for machine-readable discovery via registry APIs or docker inspect.
Isolated Files & Libraries
Each extension has its own directory and private bundled libraries, avoiding file overwrites and dependency leaks. Runtime incompatibilities still matter; see the compatibility notes.
# Stock postgres:19 + extensions as Kubernetes ImageVolumes # Requires the ImageVolume feature enabled on your cluster apiVersion: v1 kind: Pod metadata: name: pg-extensions spec: volumes: - name: ext-pgvector image: reference: ghcr.io/pglayers/pgx-pgvector:19-0.8.7 - name: ext-postgis image: reference: ghcr.io/pglayers/pgx-postgis:19-3.7.0 containers: - name: postgres image: postgres:19 env: - name: POSTGRES_PASSWORD value: "local-demo-only" args: - "postgres" - "-c" - "extension_control_path=/extensions/pgvector/share:/extensions/postgis/share:$system" - "-c" - "dynamic_library_path=/extensions/pgvector/lib:/extensions/postgis/lib:$libdir" volumeMounts: - name: ext-pgvector mountPath: /extensions/pgvector - name: ext-postgis mountPath: /extensions/postgis
Tested on PG18 and PG19 with Kubernetes 1.33+ and CloudNativePG. ImageVolumes must be enabled on your cluster. The password above is for a local demo; use a Secret in production. After startup, run CREATE EXTENSION vector; and CREATE EXTENSION postgis;. See the Kubernetes setup guide.
Layer composition
pglayers publishes each extension as a minimal FROM scratch image containing only the compiled binaries at the correct filesystem paths.
Start from official image
Your Dockerfile starts with the official postgres image -- same as always.
Stack extension layers
Each COPY --from line pulls a pre-built extension layer and overlays it onto the image.
Run with extensions
The result is a single image with exactly the extensions you chose. CREATE EXTENSION and go.