# Software

> Locale, Firewall, Ansible, Pigsty...
---

------

## Linux

Pigsty runs on <span class="text-xl text-amber-500 font-black">Linux</span> Operating System, it supports **14** mainstream Linux distros: [**Compatible OS List**](/docs/prepare/linux)

We recommend using **RockyLinux 9.6**, **Debian 12.11**, or **Ubuntu 24.04.5** as the default OS options.

**Run pigsty on macOS?**

You can install pigsty on macOS, and initiate control from your local laptop with `ansible`. (use as admin node)
But the database / infra / node / etcd services are still running on Linux nodes.

We **strongly recommend** using a clean installed OS environment with `en_US` set as the primary language.

**How to enable en_US locale?**

To ensure the `en_US` locale is available when using other primary language:

```bash
localedef -i en_US -f UTF-8 en_US.UTF-8
localectl set-locale LANG=en_US.UTF-8
```


Pigsty **DOES NOT** use containers, main components are packed for specific distro major version.

**Use the same OS version on all nodes**

Please use the same major and minor version of the OS on all nodes in a single deployment.


--------

## File System

Pigsty suggests using `ext4` or `xfs` file systems, both of which have the best performance for PostgreSQL use cases.
If you know what you are doing, you can also consider using file systems like `zfs`, but never run database services on network file systems like `nfs`.

If you need to use MinIO, it is recommended to use the `xfs` file system, which is the only file system recommended by MinIO.
It performs better in scenarios with a large number of small files, but the tool ecosystem (e.g., data recovery) is slightly inferior to `ext4`.

The default recommendation for running standard PostgreSQL services is to use the `ext4` file system.


--------

## Firewall

Your security policy and firewall setup should allow access to the required ports.

To access the WebUI services, you'll have to allow the HTTP (`80`) / HTTPS (`443`) access.

To access the PostgreSQL database services, you'll have to allow the `5432` port for postgres.

**You may access postgres services via other ports**

- `5432`: PostgreSQL database
- `6432`: Pgbouncer Connection Pooler
- `5433`: PG Primary Service
- `5434`: PG Replica Service
- `5436`: PG Default Service
- `5438`: PG Offline Service

If you are accessing the postgres services via other ports, allow them accordingly


In a typical public cloud VPS setup, port `22/80/443/5432` are usually opened.

**Expose database ports with caution**

Exposing database service ports directly to the Internet is very dangerous.
If you need to do this, consider consulting [Security Best Practices](/docs/config/security/) and proceed with caution.

In a typical production setup, port `22/80/443` are opened to DBA/OPS from LAN / Jumpserver.
And other ports are accessed from intranet. You have to make sure they are opened internally: [used ports](/docs/node/arch).




--------

## Ansible

Pigsty uses [**Ansible**](/docs/admin/ansible) to initiate control from admin node to all managed nodes.

You don't need to care about details, ansible is installed during the [**Bootstrap**](/docs/install/offline#bootstrap) stage.

**Install Ansible Manually**

```bash tab=&#34;Debian / Ubuntu&#34;
sudo apt install -y ansible python3-jmespath
```
```bash tab=&#34;EL 9&#34;
sudo dnf install -y ansible python3-jmespath
```
```bash tab=&#34;EL 8&#34;
sudo dnf install -y ansible python3.12-jmespath
```
```bash tab=&#34;EL 7&#34;
sudo yum install -y ansible python-jmespath
```
```bash tab=&#34;macOS&#34;
brew install ansible
pip3 install jmespath
```

Ansible is only required on admin node, you can run ansible on macOS to use your laptop as admin node.




------

## Pigsty

(<span class="text-sky-500 font-black">RECOMMENDED</span>) You can get & extract the latest stable version of pigsty source with:

```bash tab="Default"
curl -fsSL https://repo.pigsty.io/get | bash -s v3.7.0; cd ~/pigsty
```
```bash tab="Mirror"
curl -fsSL https://repo.pigsty.cc/get | bash -s v3.7.0; cd ~/pigsty   # china mirror
```

To install a specific version, pass the version string as the first parameter:

```bash tab="Default"
curl -fsSL https://repo.pigsty.io/get | bash -s v3.7.0; cd ~/pigsty
```
```bash tab="Mirror"
curl -fsSL https://repo.pigsty.cc/get | bash -s v3.7.0; cd ~/pigsty # china mirror
```

You can also use `git` to clone the Pigsty source repo from [GitHub](https://github.com/pgsty/pigsty):

```bash {title="clone the latest"}
git clone https://github.com/pgsty/pigsty.git; cd ~/pigsty; git checkout v3.7.0
```

**Checkout a specific version before using**

The default `main` branch may in an unstable development status, `git checkout v3.7.0` before using.

```bash
$ curl -fssL https://repo.pigsty.cc/get | bash -s v3.7.0
[v3.7.0] ===========================================
$ curl -fsSL https://repo.pigsty.cc/get | bash -s v3.7.0
[Docs] https://doc.pgsty.com
[Demo] https://g.pgsty.com
[Repo] https://github.com/pgsty/pigsty
[Download] ===========================================
[ OK ] version = v3.7.0 (from arg)
curl -fSL https://repo.pigsty.cc/src/pigsty-v3.7.0.tgz -o /tmp/pigsty-v3.7.0.tgz
[WARN] tarball = /tmp/pigsty-v3.7.0.tgz exists, size = 1472486, use it
[ OK ] md5sums = df64ac0c2b5aab39dd29698a640daf2e  /tmp/pigsty-v3.7.0.tgz
[Install] ===========================================
[ OK ] install = /home/vagrant/pigsty, from /tmp/pigsty-v3.7.0.tgz
[Bootstrap] ===========================================
[ OK ] ansible = ready
[ OK ] bootstrap = skip
you can run ./bootstrap to extrac offline package and install ansible
[TodoList] ===========================================
cd /home/vagrant/pigsty
./configure      # [OPTIONAL] preflight-check and config generation
./install.yml    # deployment everything described by your config
```

You can also download the pigsty src (`pigsty-<version>.tar.gz`) from [GitHub Release Page](https://github.com/pgsty/pigsty/releases/latest) manually:

```bash tab="Default"
wget https://repo.pigsty.io/src/pigsty-v3.7.0.tgz
```
```bash tab="Mirror"
wget https://pigsty.cc/pgsty/pigsty/releases/download/v3.7.0/pigsty-v3.7.0.tgz
```
```bash tab="GitHub"
wget https://github.com/pgsty/pigsty/releases/download/v3.7.0/pigsty-v3.7.0.tgz
```



If your environment does not have Internet access, consider downloading offline packages along with source tarball and upload them to your nodes.

Check [Offline Installation](/docs/install/offline) for details.
