Configure
The configure configuration wizard generates pigsty.yml for your current environment.
This script is optional. If you know how to configure Pigsty, edit pigsty.yml directly and skip the wizard.
Quick Start
Enter the Pigsty source directory and run ./configure to start the wizard. Without arguments, it uses the meta single-node template:
The command starts with the selected template. It detects the current node IP address and region, then generates pigsty.yml for that environment.
Features
The configure script makes these adjustments from your environment and input. By default, it generates pigsty.yml in the Pigsty directory.
- Detect the current node IP address. If the node has multiple addresses, ask you to select a primary IP address as its identity.
- Replace
10.10.10.10in the template with this address. Setadmin_ipto the same value. - Detect the region. Set
regiontodefaultfor global software repositories orchinafor Chinese mirrors. - For instances with fewer than four vCPUs, use the
tinytemplate fornode_tuneandpg_conf. This reduces resource use. - With
-v, changepg_versionandpg18-*package-group aliases to the specified major version. Exclude the fixed-kernel templatesmssql,polar, andpg19. - With
-g, replace recognized default passwords with strong random passwords. This is strongly recommended. Review other values against the Default Credentials Checklist. - For PG major versions ≥ 17, prefer the built-in
C.UTF-8locale, or the OS-supportedC.UTF-8. - Check that the core deployment dependency
ansibleis available. - Check that the deployment target accepts SSH connections and can run commands with sudo. Use
-sto skip these checks.
Usage Examples
Command Arguments
Argument Details
| Argument | Description |
|---|---|
-c, --conf | Generate config from conf/<template>.yml, supports subdirectories like ha/full |
-i, --ip | Replace placeholder 10.10.10.10 in config template with specified IP |
-v, --version | Specify PostgreSQL major version (14-19); PG19 is Beta, so prefer the dedicated pg19 template |
-r, --region | Set software repo mirror region: default, china (Chinese mirrors), europe (European) |
-o, --output | Output path, default pigsty.yml; relative paths use Pigsty home, absolute paths are used as given |
-s, --skip | Skip IP probing, target SSH/Sudo checks, and effective IP replacement; keep 10.10.10.10 |
-x, --proxy | Write current environment proxy variables (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) to config |
-n, --non-interactive | Non-interactive mode; a single/demo IP is auto-selected, while ambiguous multi-IP hosts require -i |
-p, --port | SSH port used by readiness checks only; it does not write ansible_port into the generated config |
-g, --generate | Generate random values for passwords in config file, improving security (strongly recommended) |
Execution Flow
The configure script detects and configures settings in this order:
Automatic Behaviors
Region Detection
The script tests network access to detect mainland China behind the GFW:
- If Google is reachable, use
region: defaultrepositories. - If Google is unreachable but
https://pigsty.ccis reachable, setregion: china. - If neither endpoint is reachable, use
region: defaultand warn that internet access is unavailable. - To set the region manually, use
-r.
IP Address Handling
The script selects the primary IP address in this order:
- Command line argument: Use the address specified with
-i. - Single IP detection: If the node has only one IP address, select it automatically.
- Demo IP detection: If
10.10.10.10exists, select it automatically for the sandbox environment. - Interactive input: If multiple addresses remain, ask you to select or enter one.
Low-End Hardware Optimization
If the script detects fewer than four CPU cores (1–3), it changes these settings:
These settings support operation on virtual machines with limited resources.
Locale Settings
The script enables C.UTF-8 as the default locale if either condition applies:
- PostgreSQL version is ≥ 17, with built-in Locale Provider support.
- The operating system supports the
C.UTF-8orC.utf8locale.
China Region Special Handling
For region china, the script automatically enables:
docker_registry_mirrorsfor faster Docker downloads through mirrors.PIP_MIRROR_URLfor faster Python downloads through mirrors.
Password Generation
With -g, the script generates a random 24-character string for each of these passwords:
| Password Parameter | Description |
|---|---|
grafana_admin_password | Grafana admin password |
pg_admin_password | PostgreSQL admin password |
pg_monitor_password | PostgreSQL monitor user password |
pg_replication_password | PostgreSQL replication user password |
patroni_password | Patroni API password |
haproxy_admin_password | HAProxy admin password |
minio_secret_key | Silo Root Secret |
etcd_root_password | ETCD Root password |
It also replaces the following placeholder passwords:
DBUser.Meta→ random passwordDBUser.Viewer→ random passwordS3User.Backup→ random passwordS3User.Meta→ random passwordS3User.Data→ random passwordDBUser.Supa→ random passwordVibe.Coding→ random password
Configuration Templates
The script reads templates from conf/. Set -c to a relative path without the .yml suffix, such as ha/full or app/immich.
Core Templates
| Template | Description |
|---|---|
meta | Default template: Single-node installation with INFRA + NODE + ETCD + PGSQL |
rich | Feature-rich version: Includes almost all extensions, Silo, local repo |
slim | Minimal version: PostgreSQL + ETCD only, no monitoring infrastructure |
fat | Complete version: rich base with more extensions installed |
pgsql | Pure PostgreSQL template |
pg19 | Single-node PostgreSQL 19 Beta evaluation template |
infra | Pure infrastructure template |
HA Templates (ha/)
| Template | Description |
|---|---|
ha/dual | 2-node HA cluster |
ha/trio | 3-node HA cluster |
ha/full | 4-node complete sandbox environment |
ha/safe | Security-hardened HA configuration |
ha/octo | Compact 8-node HA simulation |
ha/simu | 20-node production simulation environment |
ha/citus | 13-node Citus distributed cluster |
Application Templates
| Template | Description |
|---|---|
supabase | Supabase self-hosted configuration |
app/dify | Dify AI platform configuration |
app/odoo | Odoo ERP configuration |
app/electric | Electric sync engine configuration |
app/insforge | Insforge backend platform configuration |
app/hindsight | Hindsight application configuration |
app/teable | Teable table database configuration |
app/mattermost | Mattermost collaboration platform configuration |
app/maybe | Maybe finance application configuration |
app/registry | Docker Registry configuration |
app/immich | Immich photo and video management |
app/jumpserver | JumpServer bastion host |
Special Kernel Templates
| Template | Description |
|---|---|
ivory | IvorySQL: Oracle-compatible PostgreSQL |
mssql | Babelfish: SQL Server-compatible PostgreSQL |
polar | PolarDB: Alibaba Cloud open-source distributed PostgreSQL |
ha/citus | Citus: Distributed PostgreSQL HA cluster |
mysql | OpenHalo: MySQL protocol-compatible PostgreSQL |
pgtde | Percona PostgreSQL Server: transparent encryption |
oriole | OrioleDB: Next-generation storage engine |
agens | AgensGraph: graph database kernel |
pgedge | pgEdge: distributed PostgreSQL kernel |
mongo | MongoDB-compatible stack template |
Demo and Build Templates
| Template | Description |
|---|---|
vibe | Vibe Coding development environment |
docker | Run Pigsty inside a Docker container |
demo/bare | Minimal readable single-node example |
demo/el | Full parameter example for EL distributions |
demo/debian | Full parameter example for Debian/Ubuntu |
demo/demo | Multi-module demo environment |
demo/kernel | Ten-node database-kernel matrix |
demo/redis | Redis replica, Sentinel, and native Cluster demo |
demo/minio | Multi-node, multi-drive Silo demo (source default) |
demo/kafka | Kafka KRaft development and secure-cluster demo |
demo/mysql | Native MySQL 8.4 pilot demo |
demo/remote | Remote PostgreSQL/RDS monitoring example |
demo/saas | Legacy single-node SaaS component bundle |
demo/wool | Small cloud-instance example for China |
build/oss | Cross-distribution open-source package build env |
build/dev | Three-node development and build environment |
Output Example
Environment Variables
The script supports the following environment variables:
| Environment Variable | Description | Default |
|---|---|---|
PIGSTY_HOME | Pigsty installation directory | ~/pigsty |
METADB_URL | Metabase connection URL | service=meta |
HTTP_PROXY | HTTP proxy | - |
HTTPS_PROXY | HTTPS proxy | - |
ALL_PROXY | Universal proxy | - |
NO_PROXY | Proxy whitelist | Built-in default |
Notes
Passwordless access: Before you run
configure, the current user must have passwordless sudo and passwordless SSH access to localhost. Thebootstrapscript can configure both.IP address selection: Select an internal IP as the primary address. Do not select a public IP or
127.0.0.1.Password security: In production, always change default passwords. Use
-gto randomize recognized credentials. Review the Default Credentials Checklist for remaining values.Configuration review: After the script completes, review the generated
pigsty.yml. Check that it meets your requirements.Multiple executions: You can run
configureagain to regenerate configuration. Each run overwrites the existingpigsty.yml.macOS limitations: On macOS, the script skips some Linux checks and uses placeholder IP
10.10.10.10. macOS can serve only as an administration node.
FAQ
How to use a custom configuration template?
Place your configuration file in the conf/ directory, then specify it with the -c argument:
How to generate different configurations for multiple clusters?
Use the -o argument to specify different output files:
Then specify the configuration file when running playbooks:
How to handle multiple IPs in non-interactive mode?
You must explicitly specify the IP address using the -i argument:
How to keep the placeholder IP in the template?
Use the -s argument to skip IP replacement:
Related Documentation
- Inventory: Understand the Ansible inventory structure
- Parameters: Understand Pigsty parameter hierarchy and priority
- Templates: View all available configuration templates
- Installation: Understand the complete installation process
- Metabase: Use PostgreSQL as a dynamic configuration source
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)