# Install

> Database preparation and installation on Linux and macOS.

---

LLMS index: [llms.txt](/llms.txt)

---

> [!IMPORTANT]
> Installation packages for the `pgsilo` PostgreSQL backend have **not yet been publicly released** (`MVP in progress`). No public download URLs exist yet. When released with Silo, the MVP targets `linux/amd64` and `linux/arm64` DEB and RPM packages (`darwin/arm64` is used for local verification). The frozen October 8, 2026 local checkpoint (`3c7fdc03`) built only `linux/arm64` DEB and `darwin/arm64` artifacts.

This guide covers preparing the PostgreSQL database and configuring `silo server` on Linux (systemd) or macOS. For an existing database undergoing a schema change, follow [Upgrade](/docs/s3/operations/upgrade/) instead.

## 1. Prepare the PostgreSQL database {#prepare-database}

Prepare a PostgreSQL 16 or newer primary instance (`pg.example.net:5432`) with TLS enabled. Gateways must connect directly to PostgreSQL or through a session-preserving proxy; **do not** route `SILO_PG_DSN` through PgBouncer in transaction-pooling mode.

On the PostgreSQL primary, create an ordinary, non-superuser role (`silo_owner`) and a dedicated database (`silo`):

```sql
CREATE ROLE silo_owner LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION;
\password silo_owner
CREATE DATABASE silo OWNER silo_owner;
```

Require TLS and SCRAM authentication in `pg_hba.conf` for the gateway subnet:

```text
hostssl silo silo_owner 192.0.2.0/24 scram-sha-256
```

From the gateway host, verify connectivity, TLS certificate verification (`sslmode=verify-full`), and primary write status (`pg_is_in_recovery() = false`):

```bash
psql 'host=pg.example.net port=5432 dbname=silo user=silo_owner sslmode=verify-full sslrootcert=/path/to/pg-ca.crt' \
  -W -c 'SELECT current_user, current_database(), pg_is_in_recovery();'
```

## 2. Install on Linux with systemd {#install-linux}

{.steps}
### Install the package and verify the binary {#linux-package}

Once you have built or obtained the target DEB/RPM package for your architecture (`amd64` or `arm64`), verify its SHA-256 checksum and install it:

```bash
sha256sum -c SHA256SUMS
sudo dpkg -i ./silo_<version>_<arch>.deb
sha256sum /usr/bin/silo
```

The package creates the `silo` system user and group. Complete the configuration steps below before starting the service.

### Install TLS certificates and `/etc/default/silo` {#linux-config}

Create `/etc/silo` and `/etc/silo/certs`, install the PostgreSQL CA certificate and the S3 server TLS certificate/key pair (`public.crt` and `private.key`), and create `/etc/default/silo`:

```bash
sudo install -d -o root -g silo -m 0750 /etc/silo /etc/silo/certs
sudo install -o root -g silo -m 0640 /path/to/pg-ca.crt /etc/silo/postgres-ca.crt
sudo install -o root -g silo -m 0640 /path/to/s3-server.crt /etc/silo/certs/public.crt
sudo install -o root -g silo -m 0640 /path/to/s3-server.key /etc/silo/certs/private.key
```

Write `/etc/default/silo` (mode `0640`, owned by `root:silo`) using this template (`silo-pg.env.example`), replacing all placeholder values:

```ini
SILO_PG_DSN="postgresql://silo_owner:URL_ENCODED_PASSWORD@pg.example.net:5432/silo?sslmode=verify-full&sslrootcert=/etc/silo/postgres-ca.crt"
MINIO_ROOT_USER="REPLACE_WITH_ROOT_ACCESS_KEY"
MINIO_ROOT_PASSWORD="REPLACE_WITH_LONG_RANDOM_SECRET"
MINIO_REGION="us-east-1"
SILO_PG_READ_ONLY="off"
SILO_PG_MAX_CONNS="32"
SILO_PG_CONTROL_CONNS="4"
SILO_PG_COORD_CONNS="2"
SILO_PG_SEGMENT_SIZE="8MiB"
SILO_PG_MAX_OBJECT_SIZE="256MiB"
SILO_PG_ACQUIRE_TIMEOUT="5s"
SILO_PG_REQUEST_TIMEOUT="15m"
SILO_PG_QUEUE_TIMEOUT="5s"
```

`SILO_PG_QUEUE_TIMEOUT` takes effect from `1d387725c` (2026-11-08); earlier builds ignore it.

Percent-encode reserved characters in the DSN password. This file is read by systemd `EnvironmentFile`; do not execute it with `source`.

### Install the systemd drop-in and start `silo` {#linux-systemd}

Install the service override (`/etc/systemd/system/silo.service.d/postgresql.conf`, matching `silo-pg.conf`) so systemd clears any default disk-mode arguments and starts `silo server` in PostgreSQL mode:

```ini
[Service]
EnvironmentFile=
EnvironmentFile=/etc/default/silo
ExecStart=
ExecStart=/usr/bin/silo server --address :9000 --console-address :9001 --certs-dir /etc/silo/certs
```

Reload systemd and start the first writable gateway:

```bash
sudo systemctl daemon-reload
sudo systemctl enable --now silo
sudo systemctl status silo --no-pager
sudo journalctl -u silo -n 100 --no-pager
```

On first startup against an empty database, the writable gateway initializes schema 14 (migrations `0001` through `0014`) inside a transaction and persists `SILO_PG_SEGMENT_SIZE` and `SILO_PG_MAX_OBJECT_SIZE`. Wait for initialization to finish before starting additional gateways.

## 3. Run on macOS (Apple Silicon) {#install-macos}

For local verification on Apple Silicon (`darwin/arm64`), place `public.crt` and `private.key` in your certificate directory and launch `./silo-darwin-arm64` with environment variables prompted interactively so secrets stay out of shell history:

```bash
chmod +x ./silo-darwin-arm64
read -r -s -p 'PostgreSQL DSN: ' SILO_PG_DSN; printf '\n'
read -r -p 'Root access key: ' MINIO_ROOT_USER
read -r -s -p 'Root secret key: ' MINIO_ROOT_PASSWORD; printf '\n'
export SILO_PG_DSN MINIO_ROOT_USER MINIO_ROOT_PASSWORD
export SILO_PG_READ_ONLY=off MINIO_REGION=us-east-1
./silo-darwin-arm64 server --address :9000 --console-address :9001 --certs-dir /path/to/certs
```

## 4. Verify database-aware health checks {#verify-health}

From a client trusting the S3 TLS CA, verify both read and write health endpoints:

```bash
curl --fail --cacert /path/to/s3-ca.crt https://s3.example.net:9000/minio/health/cluster/read
curl --fail --cacert /path/to/s3-ca.crt https://s3.example.net:9000/minio/health/cluster
```

A healthy writable gateway returns HTTP `200` on both endpoints. Next, follow the [Quickstart](/docs/s3/quickstart/) or [SDK & CLI Access](/docs/s3/tutorial/sdk/) to create application credentials and buckets.

---

Backlinks:

- [Operations](/docs/s3/operations/)
- [Deploy with Pigsty](/docs/s3/operations/pigsty/)
- [Quick start](/docs/s3/quickstart/)
- [Reference](/docs/s3/reference/)
- [Configuration](/docs/s3/reference/configuration/)
- [Encryption](/docs/s3/tutorial/encryption/)
