Free, self-hosted PostgreSQL backup tool with Point-in-Time Recovery, automated restore verification, and a web UI.
pgsty/pigsty
Open-source PostgreSQL distribution that deploys HA clusters, point-in-time recovery, monitoring and 575 extensions on bare Linux.
Open-source alternative to:Amazon RDS
- Stars
- 5,834
- Forks
- 392
- Open issues
- 35
- Last commit
- 22 days ago
What is it?
Pigsty is an open-source distribution for deploying and operating PostgreSQL on your own servers. It bundles Patroni for high availability, pgBackRest for point-in-time recovery, PgBouncer and HAProxy for connection pooling and service routing, and a Victoria and Grafana based monitoring stack. Deployment is driven by a declarative YAML inventory and Ansible playbooks, so a single node or a multi-node cluster can be described in one config file and built with one command.
The project packages 575 PostgreSQL extensions and 12 alternative kernels, including Citus, Supabase, Babelfish and OrioleDB, across a range of EL, Debian and Ubuntu releases on x86_64 and aarch64. It also includes optional modules for MinIO, Redis or Valkey, Docker, etcd and JuiceFS. The README states that it runs on bare Linux without Docker or Kubernetes.
Key features
- 01Patroni-based high availability with automatic failover.
- 02Point-in-time recovery through pgBackRest, with optional MinIO or S3 backup targets.
- 03PgBouncer connection pooling and HAProxy service routing.
- 04Prebuilt monitoring and alerting dashboards built on Victoria and Grafana.
- 05Declarative YAML configuration and one-command deployment via Ansible playbooks.
Use cases
- Self-hosting production PostgreSQL clusters as an alternative to managed RDS.
- Running a PostgreSQL HA setup on bare-metal or VM infrastructure without Kubernetes.
- Evaluating or deploying PostgreSQL kernel forks and many extensions in one stack.
- Building a local or on-premises database platform with monitoring and backups included.
Quick start
- 1
Install Pigsty with the get script
curl -fsSL https://repo.pigsty.io/get | bash; cd ~/pigsty; - 2
Generate config with random passwords
./configure -g - 3
Deploy everything on the current node
./deploy.yml
Things to know
- Requires a fresh Linux node; supported distributions are listed for EL, Debian and Ubuntu only.
- Expects an admin user with passwordless ssh and sudo before deployment.
- Deployment is an Ansible-driven, multi-component setup that takes some operational effort to self-host.
Topics
FAQ
- What is pigsty?
- Open-source PostgreSQL distribution that deploys HA clusters, point-in-time recovery, monitoring and 575 extensions on bare Linux. Pigsty is an open-source distribution for deploying and operating PostgreSQL on your own servers. It bundles Patroni for high availability, pgBackRest for point-in-time recovery, PgBouncer and HAProxy for connection pooling and service routing, and a Victoria and Grafana based monitoring stack. Deployment is driven by a declarative YAML inventory and Ansible playbooks, so a single node or a multi-node cluster can be described in one config file and built with one command.
- Is pigsty free to use? What license does it have?
- pigsty is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is pigsty still maintained?
- Actively maintained. The last commit to pigsty was on Sep 28, 2026.
- What can I use pigsty for?
- Self-hosting production PostgreSQL clusters as an alternative to managed RDS. Running a PostgreSQL HA setup on bare-metal or VM infrastructure without Kubernetes. Evaluating or deploying PostgreSQL kernel forks and many extensions in one stack. Building a local or on-premises database platform with monitoring and backups included.
- How do I install pigsty?
- Install Pigsty with the get script: curl -fsSL https://repo.pigsty.io/get | bash; cd ~/pigsty; Generate config with random passwords: ./configure -g Deploy everything on the current node: ./deploy.yml
- Where can I get pigsty?
- The source code and installation instructions are on GitHub: https://github.com/pgsty/pigsty
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Self-hosted uptime monitoring tool that tracks HTTP, TCP, DNS, ping, Docker and other services with alerts and status pages.
A self-hosted, all-in-one software development service written in Go, covering Git hosting, code review, issues, packages and CI/CD.
Open-source, OpenTelemetry-native observability platform that brings logs, metrics, traces, alerts and dashboards into one self-hostable tool.
A self-hosted, Docker-powered mini-Heroku that deploys and manages web apps on your own server from a git push.
Lightweight self-hosted server monitoring with a web dashboard, Docker container stats, historical data and alerts.