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.
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.
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.
bashdocker run --detach --name postgresql-container -p 30432:5432 -e TZ=UTC -e POSTGRES_PASSWORD=My:S3cr3t ubuntu/postgres:16-24.04_edge
!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 Tags | Supported until | Currently | Architectures | |
|---|---|---|---|---|
14-22.04_beta | 14-22.04_edge, edge, latest | - | postgres 14 on Ubuntu 22.04 LTS | s390x, amd64, ppc64le, arm64 |
13-21.10_beta | 13-21.10_edge | - | postgres 13 on Ubuntu 21.10 | amd64, s390x, arm64, ppc64le |
13-21.04_beta | 13-21.04_edge | - | postgres 13 on Ubuntu 21.04 | s390x, ppc64le, amd64, arm64 |
12-20.04_beta | 12-20.04_edge | - | postgres 12 on Ubuntu 20.04 LTS | s390x, arm64, ppc64le, amd64 |
16-24.04_edge | 16-24.04_edge | - | postgres 16 on Ubuntu 24.04 LTS | amd64, 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.
If your usage includes commercial redistribution, or requires ESM or unavailable channels/versions, please get in touch with the Canonical team (or using ***).
Launch this image locally:
shdocker 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
| Parameter | Description |
|---|---|
-e TZ=UTC | Timezone. |
-e POSTGRES_PASSWORD=my_secret_password | Set 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=john | Create a new user with superuser privileges. This is used in conjunction with POSTGRES_PASSWORD. |
-e POSTGRES_DB=db_test | Set 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/location | Set 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=trust | Set 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/location | Set the location of the database files. The default is '/var/lib/postgresql/data'. |
-p 30432:5432 | Expose Postgres on localhost:30432. |
-v /path/to/postgresql.conf:/etc/postgresql/postgresql.conf | Local configuration file 'postgresql.conf'. |
-v /path/to/persisted/data:/var/lib/postgresql/data | Persist data instead of initializing a new database every time you launch a new container. |
Testing/Debugging
To debug the container:
shdocker logs -f postgres-container
To get an interactive shell:
shdocker exec -it postgres-container /bin/bash
To debug the container:
bashdocker logs -f postgresql-container docker exec -it postgresql-container pebble logs
To get an interactive shell:
bashdocker exec -it postgresql-container /bin/bash
If you find a bug in our image or want to request a specific feature, please file a bug here:
[***]
Please title the bug "postgres: <issue summary>". Make sure to include the digest of the image you are using, from:
shdocker images --no-trunc --quiet ubuntu/postgres:<tag>
These channels (tags) are not updated anymore. Please upgrade to newer channels, or reach out if you can't upgrade.
| Track | Version | EOL | Upgrade Path |
|---|---|---|---|
track |
以下是 ubuntu/postgres 相关的常用 Docker 镜像,适用于 关系型数据库、复杂查询、数据完整性 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务