Skip to content

Version v3.7.0 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

Pigsty v3.7.0 Documentation

Historical documentation frozen at Pigsty v3.7.0.
Note

Pigsty v4 was still a future preview at this freeze point; this archive documents the stable v3.7.0 release.

Postgres In Great STYle —— Postgres Infra Graphic Service Toolbox, Yours

Introduction

Pigsty (/ˈpɪɡ staɪ/) is a Battery-Included, FOSS PostgreSQL Distribution as a Local-First RDS Alternative.

Values
    Why use Pigsty?
    The 8 core value propositions of Pigsty
Features
    Key features, Highlights and Technical details
References
    Architecture, Use Cases, Comparisons, and other references
About
    License, Release, Community, News, Author, Service, etc...

Pigsty assembles all the superpowers from the PostgreSQL and Database world, provides everything you’ll need to build your own Data Infra.

Just use Postgres for Everything! and Self-Hosting it like a Pro!


Installation

Quick Start: Prepare an ssh-accessible node with fresh installed Linux, run as user with nopass ssh and sudo privileges:

install
curl -fsSL https://repo.pigsty.io/get | bash -s v3.7.0;
cd ~/pigsty; ./configure; ./install.yml;

Download, Configure and Install. Pigsty Installed! You can add more nodes and database clusters later.

Explore the User Interface, check port 5432 for Postgres Service, port 3000 for grafana dashboards (userpass: admin / pigsty).

Installation
    Install Pigsty on Linux Servers
Preparation
    Prepare Environment for Serious Deployment
Configuration
    Customize database clusters with Config Inventory
Administration
    Manage your environment with Ansible Playbook

You can also wrap exotic PostgreSQL kernels into RDS: Citus, WiltonDB, IvorySQL, OpenHalo, Percona, OrioleDB, PolarDB, and Supabase.


Modules

Pigsty consists of multiple Modules. The PINE stack: PGSQL / INFRA / NODE / ETCD are REQUIRED for self-hosting Postgres RDS service.

PGSQL
    HA PG Cluster with HA, PITR, IaC, ACL, Monitor, and 437 extensions
INFRA
    Nginx, Repo, DNS, NTP, Prometheus and Grafana stack for Observability
NODE
    Enroll nodes into the desired state and monitor it, and VIP, HAProxy
ETCD
    Reliable distributive consensus storage (DCS), empowering PGSQL HA

Pigsty also has some OPTIONAL “Bonus” modules, which work well with PostgreSQL, and bring extra value to your data infrastructure.

MINIO
    S3 compatible object storage compatible, optional backup storage
REDIS
    High-performance in-memory cache, optional data structure server
DOCKER
    Container runtime, optional for running stateless app and tools
FERRET
    MongoDB wire-protocol compatible on PostgreSQL, optional middleware

FAQ

What is Pigsty—and what isn't it?
    Pigsty is a PostgreSQL distribution: an open-source, local-first RDS-like solution. It isn't a database (DBMS), but rather a management tool, solution, and set of best practices. Think of a database as a car, a DBA as the driver, RDS as a taxi service, and Pigsty as self-driving software.
What problem does Pigsty solve?
    Database expertise is scarce and costly—you either hire expensive DBAs or pay a premium for cloud RDS. Now there's a new option: Pigsty (the "self-driving" equivalent). It lets you run databases without a dedicated DBA at under one-tenth the cost of typical RDS, while achieving greater performance and flexibility in a local cloud environment.
Why can Pigsty help you manage databases effectively?
    Pigsty packages hard-earned best practices from large, complex PostgreSQL deployments into a reproducible solution. It tackles everything: scalable installs, high availability, connection pooling, monitoring, backup/recovery, parameter tuning, IaC-based cluster management, one-click deployment, and automated ops—letting you avoid common pitfalls and reinventing the wheel.
Why is Pigsty better than RDS?
    Pigsty provides a richer feature set than most RDS offerings: 400+ extensions, support for 9+ Postgres kernels, a unique monitoring system, and proven architecture refined by top-tier enterprise use (Apple, Alibaba, Tantan). It's easy to use, deeply tested, and fueled by genuine passion—at a depth and maturity level typical RDS platforms can't match.
Why is Pigsty more cost-effective than RDS?
    With Pigsty, you can run what's effectively a ¥400–¥1400/core/month RDS instance on bare-metal resources costing as little as ¥10/core/month—and skip paying a DBA's salary. At scale, total cost of ownership can drop by 90% or more. Pigsty slashes license, service, and personnel costs, so you can channel your budget where it really matters.
How does Pigsty help developers?
    Pigsty integrates 400+ PG extensions for an all-in-Postgres approach—letting you replace Redis, Kafka, MySQL, Elasticsearch, vector databases, and even certain OLAP/big-data use cases with one stack. This boosts developer agility, cuts complexity, and enables self-serve DevOps without needing a dedicated DBA.
How does Pigsty help operations teams?
    Pigsty's self-healing HA ensures you don't need to scramble when hardware fails—ops and DBAs can sleep easy. Advanced monitoring aids troubleshooting and performance tuning. IaC automates large-scale cluster management. Ops can double as DBAs, and DBAs skip heavy lifting to focus on high-value tasks—or just enjoy a tea break while learning PG.
Who created Pigsty?
    Pigsty is primarily developed by @Vonng / Ruohang Feng, a PostgreSQL veteran with a decade of open-source contributions and production experience at Alibaba, Tantan, and Apple. He's the founder of a one-person company (YC China/MiraclePlus S22) offering professional postgres consultancy. He's also a top database/cloud KOL with over 100k followers.
What is Pigsty's ecosystem standing and impact?
    Pigsty is one of the most active OSS projects in the PG ecosystem (OSSRank). It prevails in extension distribution and monitoring solutions, positioning itself as a challenger to cloud RDS. It's already in wide use across military, government, healthcare, internet, finance, and manufacturing sectors.
Which user scale is Pigsty suitable for?
    Pigsty was built for massive PostgreSQL clusters, but it's also optimized for simplicity. Even solo developers or small businesses without DBA skills can get going easily. Largest known production scale: 25k vCPUs at 4.5 million QPS over six years. Smallest: a 1c1g VM demo or dev box.
Which capabilities does Pigsty offer?
    Pigsty focuses on Postgres best practices and integrates well with complementary open-source tools like Etcd, Redis, MinIO, DuckDB, Prometheus, FerretDB, Babelfish, IvorySQL, PolarDB, OrioleDB, OpenHalo, Supabase, Greenplum, Dify, Odoo, and more.
Which scenarios does Pigsty fit?
    Massive production postgres deployment, self-hosting RDS, object storage, caching, data warehousing, Supabase, etc. It can run enterprise apps like Odoo, Dify, wikis, GitLab, or serve as a monitoring hub for existing nodes and DBMS. It also excels at combining multiple PG extensions, powering interactive data apps, data visualization, and websites.
Is Pigsty open source and free?
    Yes. Pigsty is 100% free software under the AGPLv3 license. You can use it freely for commercial purposes if you comply with that license. We value software freedom; for non-DBaaS/OEM use, we apply an Apache 2.0–like approach. See the license for details.
Does Pigsty offer commercial support?
    Pigsty itself is free, but we provide commercial subscriptions for those who want assurance and expert support. Subscriptions extend coverage to more OS/PG/CPU architectures, plus consultancy. This delivers top-tier technical expertise and solutions, saving you time, reducing risk, and covering tough issues.
Can Pigsty be repackaged as multi-tenant DBaaS or rebranded?
    Yes, under the AGPLv3 license—meaning any derivative work must be open-sourced. We reserve the right to pursue violations by public cloud/database vendors. If you prefer not to open-source derivatives, consider Pigsty Service Subscriptions, which provide explicit licensing and an AGPLv3 exemption for this scenario.