{"id":41704532,"url":"https://github.com/woblerr/docker-pgbackrest","last_synced_at":"2026-01-24T21:22:17.130Z","repository":{"id":39899430,"uuid":"345828079","full_name":"woblerr/docker-pgbackrest","owner":"woblerr","description":"pgBackRest inside Docker.","archived":false,"fork":false,"pushed_at":"2026-01-21T07:58:52.000Z","size":200,"stargazers_count":101,"open_issues_count":1,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-21T19:08:43.731Z","etag":null,"topics":["backup","docker","inside-docker","pgbackrest","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/woblerr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-08T23:50:57.000Z","updated_at":"2026-01-21T07:19:39.000Z","dependencies_parsed_at":"2023-02-08T01:31:24.844Z","dependency_job_id":"dedf010f-e7f4-4daf-a82a-fdc70c9fdcfc","html_url":"https://github.com/woblerr/docker-pgbackrest","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/woblerr/docker-pgbackrest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woblerr%2Fdocker-pgbackrest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woblerr%2Fdocker-pgbackrest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woblerr%2Fdocker-pgbackrest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woblerr%2Fdocker-pgbackrest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woblerr","download_url":"https://codeload.github.com/woblerr/docker-pgbackrest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woblerr%2Fdocker-pgbackrest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28737112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T19:23:36.361Z","status":"ssl_error","status_checked_at":"2026-01-24T19:23:28.966Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","docker","inside-docker","pgbackrest","postgresql"],"created_at":"2026-01-24T21:22:16.588Z","updated_at":"2026-01-24T21:22:17.124Z","avatar_url":"https://github.com/woblerr.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-pgbackrest\n\n[![Actions Status](https://github.com/woblerr/docker-pgbackrest/workflows/build/badge.svg)](https://github.com/woblerr/docker-pgbackrest/actions)\n\n[pgBackRest](https://pgbackrest.org/) inside Docker can be useful for refusing to install pgBackRest as a system package (using yum or apt, for example) on your [Dedicated Repository Host](https://pgbackrest.org/user-guide.html#repo-host) or inside CI/CD systems. You can just run pgBackRest in Docker. At the same time, the PostgreSQL server side must be configured according to the pgBackRest documentation.\n\nThe repository contains information for the last 5 releases of pgBackRest. If necessary to use an older version -  do a [manual build](#build).\n\nSupported pgBackRest version tags:\n\n* `2.58.0`, `latest`\n* `2.58.0-alpine`\n* `2.57.0`\n* `2.57.0-alpine`\n* `2.56.0`\n* `2.56.0-alpine`\n* `2.55.1`\n* `2.55.1-alpine`\n* `2.55.0`\n* `2.55.0-alpine`\n\nThe repository also contains information for releases of pgBackRest fork with Greenplum support (see [pgbackrest/pull/1833](https://github.com/pgbackrest/pgbackrest/pull/1833)). Details - [build with Greenplum support](#build-with-greenplum-support).\n\nThe repository contains information for the last 2 releases of pgBackRest fork with Greenplum support. If necessary to use an older version - do a [manual build](#build).\n\nSupported pgBackRest version tags with Greenplum support:\n* `2.54-gpdb`\n* `2.54-gpdb-alpine`\n* `2.52-gpdb`\n* `2.52-gpdb-alpine`\n\nThe image is based on the official ubuntu or alpine image. For ubuntu image each version of pgBackRest builds from the source code in a separate `builder` container. For alpine image each version of pgBackRest builds from the source code in container using virtual package `.backrest-build`.\n\nThe image contains [pgbackrest-bash-completion](https://github.com/woblerr/pgbackrest-bash-completion) script. You can complete `pgbackrest` commands by pressing tab key.\n\nEnvironment variables supported by this image:\n\n* `TZ` - container's time zone, default `Etc/UTC`;\n* `BACKREST_USER` - non-root user name for execution of the command, default `pgbackrest`;\n* `BACKREST_UID` - UID of internal `${BACKREST_USER}` user, default `2001`;\n* `BACKREST_GROUP` - group name of internal `${BACKREST_USER}` user, default `pgbackrest`;\n* `BACKREST_GID` - GID of internal `${BACKREST_USER}` user, default `2001`;\n* `BACKREST_HOST_TYPE` - repository host protocol type, default `ssh`, available values: `ssh`, `tls`;\n* `BACKREST_TLS_WAIT` - waiting for TLS server startup in seconds when `BACKREST_HOST_TYPE=tls`, default `15`;\n* `BACKREST_TLS_SERVER` - start container as pgBackRest TLS server, default `disable`, available values: `disable`, `enable`.\n\n## Pull\n\nChange `tag` to to the version you need.\n\n* Docker Hub:\n\n```bash\ndocker pull woblerr/pgbackrest:tag\n```\n\n```bash\ndocker pull woblerr/pgbackrest:tag-alpine\n```\n\n* GitHub Registry:\n\n```bash\ndocker pull ghcr.io/woblerr/pgbackrest:tag\n```\n\n```bash\ndocker pull ghcr.io/woblerr/pgbackrest:tag-alpine\n```\n\n## Run\n\nYou will need to mount the necessary directories or files inside the container (or use this image to build your own on top of it).\n\n### Simple\n\n```bash\ndocker run --rm  pgbackrest:51 pgbackrest help\n```\n\n### Injecting inside\n\n```bash\ndocker run --rm -it pgbackrest:2.58.0 bash\n\npgbackrest@cac1f58b56f2:/$ pgbackrest version\npgBackRest 2.58.0\n```\n\n### Example for Dedicated Repository Host\n\nHost `USER:GROUP` - `pgbackrest:pgbackrest`, `UID:GID` - `1001:1001`. Backups are stored locally under the user `pgbackrest`.\n\n#### Use SSH\n\n```bash\ndocker run --rm \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GID=1001 \\\n    -v ~/.ssh/id_rsa:/home/pgbackrest/.ssh/id_rsa \\\n    -v /etc/pgbackrest:/etc/pgbackrest \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    pgbackrest:2.58.0 \\\n    pgbackrest backup --stanza demo --type full --log-level-console info\n```\n\nAnd and the same time for old pgBackRest version:\n\n```bash\ndocker run --rm \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GID=1001 \\\n    -v ~/.ssh/id_rsa:/home/pgbackrest/.ssh/id_rsa \\\n    -v /etc/pgbackrest:/etc/pgbackrest \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    pgbackrest:2.30 \\\n    pgbackrest backup --stanza demo-old --type full --log-level-console info\n```\n\nTo exclude simultaneous execution of multiple backup processes for one stanza:\n\n```bash\ndocker run --rm \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GID=1001 \\\n    -v ~/.ssh/id_rsa:/home/pgbackrest/.ssh/id_rsa \\\n    -v /etc/pgbackrest:/etc/pgbackrest \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    -v /tmp/pgbackrest:/tmp/pgbackrest \\\n    pgbackrest:2.58.0 \\\n    pgbackrest backup --stanza demo --type full --log-level-console info\n```\n\n#### Use TLS\n\nAvailable only for `pgBackRest version \u003e= 2.37`.\n\nThere are two mode for using TLS for communication.\n* Run container as pgBackRest TLS server.\n  \n  You need to set `BACKREST_TLS_SERVER=enable`.\n\n  The variables `BACKREST_HOST_TYPE` and `BACKREST_TLS_WAIT` do not affect this startup mode.\n\n* Run container with TLS server in background for pgBackRest execution over TLS.\n  \n  You need to set `BACKREST_HOST_TYPE=tls`.\n\n  Using `BACKREST_TLS_WAIT`, you can change the TLS server startup waiting. By default, checking that the TLS server is running will be performed after `15 seconds`.\n\n  The variable should be `BACKREST_TLS_SERVER=disable`.\n\nTLS server configuration is described in the [pgBackRest documentation](https://pgbackrest.org/user-guide-rhel.html#repo-host/config).\n\n##### Run container as pgBackRest TLS server\n\n```bash\ndocker run -d \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GID=1001 \\\n    -e BACKREST_TLS_SERVER=enable \\\n    -v /etc/pgbackrest:/etc/pgbackrest \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    -p 8432:8432 \\\n    --name backrest_server \\\n    pgbackrest:2.58.0\n```\n\n##### Run container with TLS server in background for pgBackRest execution over TLS\n\n```bash\ndocker run --rm \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GID=1001 \\\n    -e BACKREST_HOST_TYPE=tls \\\n    -v /etc/pgbackrest:/etc/pgbackrest \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    pgbackrest:2.58.0 \\\n    pgbackrest backup --stanza demo --type full --log-level-console info\n```\n\n### Example for backup to local path for PostgreSQL running locally in Chicago\n\nPostgreSQL run from user `postgres:postgres` with UID:GID `1001:1001`. PostgreSQL data path - `/var/lib/postgresql/12/main`, pgBackRest backup path - `/var/lib/pgbackrest`.\n\n```bash\ndocker run --rm \\\n    -e BACKREST_USER=postgres \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GROUP=postgres \\\n    -e BACKREST_GID=1001 \\\n    -e TZ=America/Chicago \\\n    -v /etc/pgbackrest/pgbackrest.conf:/etc/pgbackrest/pgbackrest.conf \\\n    -v /var/lib/postgresql/12/main:/var/lib/postgresql/12/main \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    -v /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432 \\\n    pgbackrest:2.58.0 \\\n    pgbackrest backup --stanza demo --type full --log-level-console info\n```\n\n### Example for backup to local path for PostgreSQL running remote over TLS\n\nPostgreSQL run on remote host. Сommunication between hosts via TLS. pgBackRest path for backup and WAL files - `/var/lib/pgbackrest`.\n\nRun the container as a TLS server. After that, remote PostgreSQL will be able to archive WAL files.\n\n```bash\ndocker run -d \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GID=1001 \\\n    -e BACKREST_TLS_SERVER=enable \\\n    -v /etc/pgbackrest/pgbackrest.conf:/etc/pgbackrest/pgbackrest.conf \\\n    -v /etc/pgbackrest/cert:/etc/pgbackrest/cert \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    -p 8432:8432 \\\n    --name backrest_server \\\n    pgbackrest:2.58.0\n```\n\nPerforming a backup:\n\n```bash\ndocker run --rm \\\n    -e BACKREST_UID=1001 \\\n    -e BACKREST_GID=1001 \\\n    -e BACKREST_HOST_TYPE=tls \\\n    -v /etc/pgbackrest/pgbackrest.conf:/etc/pgbackrest/pgbackrest.conf \\\n    -v /etc/pgbackrest/cert:/etc/pgbackrest/cert \\\n    -v /var/lib/pgbackrest:/var/lib/pgbackrest \\\n    pgbackrest:2.58.0 \\\n    pgbackrest backup --stanza demo --type full --log-level-console info\n```\n\n## Build\n\n```bash\nmake build_version TAG=2.58.0\n```\n\n```bash\nmake build_version_alpine TAG=2.58.0\n```\n\nor\n\n```bash\ndocker build -f Dockerfile --build-arg BACKREST_VERSION=2.58.0 --build-arg BACKREST_COMPLETION_VERSION=v0.11 -t pgbackrest:2.58.0 .\n```\n\n```bash\ndocker build -f Dockerfile.alpine --build-arg BACKREST_VERSION=2.58.0 --build-arg BACKREST_COMPLETION_VERSION=v0.11 -t pgbackrest:2.58.0-alpine .\n```\n\n### Build pgBackRest \u003c `v2.51`\n\nSince version `v2.51`, the build system for pgBackRest is `meson`. The `autoconf/make` build will not receive any new features and will be removed in future. If you need to build pgBackRest lower than `v2.51`, use the files [Dockerfile_make](./Dockerfile_make) or [Dockerfile_make.alpine](./Dockerfile_make.alpine).\n\n```bash\nmake build_version TAG=2.49\n```\n\n```bash\nmake build_version_alpine TAG=2.49\n```\n\nor\n\n```bash\ndocker build -f Dockerfile_make --build-arg BACKREST_VERSION=2.49 --build-arg BACKREST_COMPLETION_VERSION=v0.10 -t pgbackrest:2.49 .\n```\n\n```bash\ndocker build -f Dockerfile_make.alpine --build-arg BACKREST_VERSION=2.49 --build-arg BACKREST_COMPLETION_VERSION=v0.10 -t pgbackrest:2.49-alpine .\n```\n\n## Build with Greenplum support\n\nPR [pgbackrest/pull/1833](https://github.com/pgbackrest/pgbackrest/pull/1833) is still not merged into pgBackRest. The separate tags `*-gpdb` are used for pgBackRest images with Greenplum support. When the PR is accepted, separate tags will no longer be needed.\n\nThe image completely repeats all the possibilities of the image for pgBackRest.\n\n### Pull\n\nChange `tag` to to the version you need.\n\n* Docker Hub:\n\n```bash\ndocker pull woblerr/pgbackrest:tag-gpdb\n```\n\n```bash\ndocker pull woblerr/pgbackrest:tag-gpdb-alpine\n```\n\n* GitHub Registry:\n\n```bash\ndocker pull ghcr.io/woblerr/pgbackrest:tag-gpdb\n```\n\n```bash\ndocker pull ghcr.io/woblerr/pgbackrest:tag-gpdb-alpine\n```\n\n### Run\n\n```bash\ndocker run --rm  pgbackrest:2.54-gpdb pgbackrest help\n```\n\n### Build pgBackRest \u003c `v2.51` with Greenplum support\n\nIf you need to build pgBackRest with Greenplum support lower than `v2.51`, use the files [Dockerfile_make](./Dockerfile_make) or [Dockerfile_make.alpine](./Dockerfile_make.alpine).\n\n## Running tests\n\nRun the end-to-end tests:\n\n```bash\nmake test-e2e\n```\n\nSee [tests description](./e2e_tests/README.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoblerr%2Fdocker-pgbackrest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoblerr%2Fdocker-pgbackrest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoblerr%2Fdocker-pgbackrest/lists"}