# 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.

<span class="text-sky-700 font-black">P</span>ostgres <span class="text-blue-400 font-black">I</span>n <span class="text-orange-500 font-black">G</span>reat <span class="text-gray-500 font-black">S</span><span class="text-red-700 font-black">T</span><span class="text-green-600 font-black">Y</span>le ——
<span class="text-sky-700 font-black">P</span>ostgres
<span class="text-blue-400 font-black">I</span>nfra
<span class="text-orange-500 font-black">G</span>raphic
<span class="text-gray-500 font-black">S</span>ervice
<span class="text-red-700 font-black">T</span>oolbox,
<span class="text-green-600 font-black">Y</span>ours



## Introduction

<span class="text-black font-black">Pigsty</span> <span class="text-fd-muted-foreground text-sm">(/ˈpɪɡ staɪ/)</span>
is a Battery-Included, FOSS <a href="/docs/intro/distro"><span class="text-sky-700 font-black">PostgreSQL Distribution</span></a>
as a Local-First <a href="/docs/intro/rds"><span class="text-amber-600 font-black">RDS Alternative</span></a>.



**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**](/docs/install/start): [Prepare](/docs/prepare) an [ssh-accessible](/docs/prepare/admin#check-accessibility) [node](/docs/prepare/hardware#node) with fresh installed [Linux](/docs/prepare/linux),
run as [user](/docs/prepare/admin#user) with nopass [`ssh`](/docs/prepare/admin#ssh) and [`sudo`](/docs/prepare/admin#sudo-privileges) privileges:

```bash {title="install"}
curl -fsSL https://repo.pigsty.io/get | bash -s v3.7.0;
cd ~/pigsty; ./configure; ./install.yml;
```

[**Download**](/docs/prepare/software#pigsty), [**Configure**](/docs/config/configure) and [**Install**](/docs/install). Pigsty [**Installed**](/docs/install)! You can [**add more**](/docs/install/multinode) nodes and database clusters later.

Explore the [**User Interface**](/docs/install/interface), check port `5432` for [Postgres](/docs/pgsql) [Service](/docs/pgsql/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](/docs/pgsql/kernel/postgres) kernels into RDS: [Citus](/docs/pgsql/kernel/citus), [WiltonDB](/docs/pgsql/kernel/babelfish), [IvorySQL](/docs/pgsql/kernel/ivorysql), [OpenHalo](/docs/pgsql/kernel/openhalo), [Percona](/docs/pgsql/kernel/percona), [OrioleDB](/docs/pgsql/kernel/orioledb), [PolarDB](/docs/pgsql/kernel/polardb), and [Supabase](/docs/pgsql/kernel/supabase).

--------

## Modules

Pigsty consists of multiple [**Modules**](/docs/intro/module). The `PINE` stack: `PGSQL` / `INFRA` / `NODE` / `ETCD` are <span class="text-sky-700 font-black">REQUIRED</span> 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 <span class="text-emerald-500 font-black">OPTIONAL</span> "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&#39;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&#39;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.

---

Section pages:

- [Installation](/docs/install/): Getting started with Pigsty
- [Preparation](/docs/prepare/): Prepare resources for a serious deployment
- [Configuration](/docs/config/): Describe your environment with config
- [Administration](/docs/admin/): Manage your deployment
- [About](/docs/about/): Information and service about pigsty itself
- [Values Proposition](/docs/value/): Pigsty's 8 core value propositions that deliver infinite possibilities
- [Key Features](/docs/feat/): Key features and highlights
- [Reference](/docs/intro/): Architecture, use cases, comparison, etc...
- [Releases](/docs/release/): Release notes for pigsty, pig, pg_exporter, rpm, deb, and other related projects.
- [Service](/docs/service/): Expert Consultation and Subscription Plans
- [PostgreSQL](/docs/pgsql/): The most advanced open source relational database in the world!
- [Infra](/docs/infra/): The portal and observability stack
- [Node](/docs/node/): Enroll linux machine hosts into desired state
- [ETCD](/docs/etcd/): The distributive consensus storage
- [MinIO](/docs/minio/): The open source object storage service
- [Redis](/docs/redis/): The open source in-memory data structure store
- [FERRET](/docs/ferret/): Ferret, the mongo over postgres
- [Docker](/docs/docker/): Docker, the open container service
- [APP](/docs/app/): Run self-hosting application templates with pigsty and docker composes
