PostgreSQL with PostGIS, TimescaleDB, pgvector, pgRouting, pg-stat-kcache, and OSM tools.
1.5K
postgres-ext is a PostgreSQL image based on the official postgres:<major>
image, with common spatial, routing, vector, time-series, and diagnostic
extensions installed at build time.
The image installs extension packages only. You still enable the extensions per
database with CREATE EXTENSION.
Docker Hub image:
svcops/postgres-ext:<major>
Supported tags:
15 16 17 18
Each PostgreSQL major tag includes:
| Package | Purpose |
|---|---|
postgresql-<major>-postgis-3 | Spatial data support with PostGIS. |
postgresql-<major>-pgrouting | Routing and graph algorithms for PostGIS data. |
postgresql-<major>-pg-stat-kcache | Kernel-level CPU and I/O statistics for queries. |
postgresql-<major>-pgvector | Vector type and similarity search support. |
postgresql-contrib-<major> | PostgreSQL contrib extensions such as pg_trgm, uuid-ossp, and pg_stat_statements. |
osm2pgrouting | Import OpenStreetMap data into pgRouting-ready tables. |
timescaledb-2-postgresql-<major> | TimescaleDB time-series extension, enabled by default at build time. |
The image also includes basic operational tools: ca-certificates, curl,
wget, gnupg, lsb-release, and vim.
Start a PostgreSQL 16 container:
docker run --rm --name postgres-ext \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 \
svcops/postgres-ext:16
Some extensions, including TimescaleDB and query statistics extensions, require
shared_preload_libraries before they can be created:
docker run --rm --name postgres-ext \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 \
svcops/postgres-ext:16 \
-c shared_preload_libraries=timescaledb,pg_stat_statements,pg_stat_kcache
Connect to the target database and enable only the extensions you need:
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS pgrouting;
CREATE EXTENSION IF NOT EXISTS vector;
CREATE EXTENSION IF NOT EXISTS timescaledb;
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
CREATE EXTENSION IF NOT EXISTS pg_stat_kcache;
Useful contrib extensions are also available:
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS unaccent;
List available extensions:
select name, default_version, installed_version
from pg_available_extensions
where name in (
'postgis',
'postgis_topology',
'pgrouting',
'vector',
'timescaledb',
'pg_stat_statements',
'pg_stat_kcache'
)
order by name;
Check PostGIS:
select postgis_full_version();
Check pgvector:
select '[1,2,3]'::vector;
Check osm2pgrouting:
osm2pgrouting --help
CREATE EXTENSION succeeds.Content type
Image
Digest
sha256:21acb4458…
Size
410.9 MB
Last updated
11 days ago
docker pull svcops/postgres-ext:18