ubuntu/postgres

Verified Publisher

By Canonical

Updated about 22 hours ago

PostgreSQL is an open source object-relational database. Long-term versions maintained by Canonical.

Image
Databases & storage
42

500K+

ubuntu/postgres repository overview

postgres | Ubuntu

Current postgres Docker Image from Canonical, based on Ubuntu. Receives security updates and rolls to newer postgres or Ubuntu release. This repository is free to use and exempt from per-user rate limits.

About postgres

Current PostgreSQL software Docker Image from Canonical based on Ubuntu. Receives security updates and rolls to newer PostgreSQL software or Ubuntu release. This repository is free to use and exempted from per-user rate limits.

About PostgreSQL™

PostgreSQL is a powerful, open source object-relational database system. It has more than 20 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. Read more on the PostgreSQL website.

docker run --detach --name postgresql-container -p 30432:5432 -e TZ=UTC -e POSTGRES_PASSWORD=My:S3cr3t ubuntu/postgres:16-24.04_edge

Tags and Architectures

LTS Up to 5 years of free security maintenance on LTS channels.

ESM Up to 10 years of customer security maintenance from Canonical's restricted repositories.

Channel TagsSupported untilCurrentlyArchitectures
14-22.04_beta14-22.04_edge, edge, latest-postgres 14 on Ubuntu 22.04 LTSs390x, amd64, ppc64le, arm64
13-21.10_beta13-21.10_edge-postgres 13 on Ubuntu 21.10 amd64, s390x, arm64, ppc64le
13-21.04_beta13-21.04_edge-postgres 13 on Ubuntu 21.04 s390x, ppc64le, amd64, arm64
12-20.04_beta12-20.04_edge-postgres 12 on Ubuntu 20.04 LTSs390x, arm64, ppc64le, amd64
16-24.04_edge16-24.04_edge-postgres 16 on Ubuntu 24.04 LTSamd64, arm64
track_risk

Channel Tags shows the most stable channel for that track ordered stable, candidate, beta, edge. More risky channels are always implicitly available. So if beta is listed, you can also pull edge. If candidate is listed, you can pull beta and edge. When stable is listed, all four are available. Images are guaranteed to progress through the sequence edge, beta, candidate before stable.

Commercial use and Extended Security Maintenance channels

If your usage includes commercial redistribution, or requires ESM or unavailable channels/versions, please get in touch with the Canonical team (or using [email protected]).

Usage

Launch this image locally:

docker run -d --name postgres-container -e TZ=UTC -e TZ=UTC -e POSTGRES_PASSWORD=My:S3cr3t -p 30432:5432 ubuntu/postgres:14-22.04_beta

Access your PostgreSQL server at localhost:55432.

Parameters
ParameterDescription
-e TZ=UTCTimezone.
-e POSTGRES_PASSWORD=my_secret_passwordSet the password for the superuser which is postgres by default. Bear in mind that to connect to the database in the same host the password is not needed but to access it via an external host (for instance another container) the password is needed. This option is mandatory and must not be empty.
-e POSTGRES_USER=johnCreate a new user with superuser privileges. This is used in conjunction with POSTGRES_PASSWORD.
-e POSTGRES_DB=db_testSet the name of the default database.
-e POSTGRES_INITDB_ARGS="--data-checksums"Pass arguments to the postgres initdb call.
-e POSTGRES_INITDB_WALDIR=/path/to/locationSet the location of the Postgres transaction log. By default it is stored in a subdirectory of the main Postgres data folder (PGDATA).
-e POSTGRES_HOST_AUTH_METHOD=trustSet the auth-method for host connections for all databases, all users, and all addresses. The following will be added to the pg_hba.conf if this option is passed 'host all all all $POSTGRES_HOST_AUTH_METHOD'.
-e PGDATA=/path/to/locationSet the location of the database files. The default is '/var/lib/postgresql/data'.
-p 30432:5432Expose Postgres on localhost:30432.
-v /path/to/postgresql.conf:/etc/postgresql/postgresql.confLocal configuration file 'postgresql.conf'.
-v /path/to/persisted/data:/var/lib/postgresql/dataPersist data instead of initializing a new database every time you launch a new container.
Testing/Debugging

To debug the container:

docker logs -f postgres-container

To get an interactive shell:

docker exec -it postgres-container /bin/bash
Testing / Debugging

To debug the container:

docker logs -f postgresql-container
docker exec -it postgresql-container pebble logs

To get an interactive shell:

docker exec -it postgresql-container /bin/bash

Bugs and feature requests

If you find a bug in our image or want to request a specific feature, please file a bug here:

https://bugs.launchpad.net/ubuntu-docker-images/+filebug

Please title the bug "postgres: <issue summary>". Make sure to include the digest of the image you are using, from:

docker images --no-trunc --quiet ubuntu/postgres:<tag>

Deprecated channels & tags

These channels (tags) are not updated anymore. Please upgrade to newer channels, or reach out if you can't upgrade.

TrackVersionEOLUpgrade Path
track

Tag summary

Content type

Image

Digest

sha256:d8a369b24

Size

200.1 MB

Last updated

about 22 hours ago

Requires Docker Desktop 4.37.1 or later.

This week's pulls

Pulls:

3,142

Last week