> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pgxman.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing a PostgreSQL extension

## Individual Extension

Installing an extension, such as `pgvector`, is as simple as running:

```console theme={null}
pgxman install pgvector
```

pgxman will install the latest version of pgvector into the local detected version of Postgres. On MacOS, it will use
[container install](container) with PG 15 by default.

You can also specify the desired version of the extension by using `=version`:

```console theme={null}
pgxman install pgvector=0.5.0
```

You can also specify the desired target Postgres version.

```console theme={null}
pgxman install pgvector=0.5.0 --pg 15
```

Both the version number of the extension and Postgres version are optional:

* **Version**: If not provided, pgxman defaults to installing the latest version of the specified extension.
* **PostgreSQL Version**: The Postgres version is specified by using the `--pg` flag. Currently, PostgreSQL 13-16 are supported. If not provided, pgxman detects the version using the `pg_config` command.

As `pgxman` harnesses system's package manager for extension management,
admin privilleges might be required. To install extensions with `sudo`,
append the `--sudo` flag:

```console theme={null}
pgxman install pgvector=0.5.0@15 --sudo
```

## Batch Installation using a pgxman file

You can also utilize a [pgxman pack](spec/pack) file to install or upgrade
multiple extensions at once:

```console theme={null}
$ cat <<EOF >pgxman.yaml
apiVersion: v1
extensions:
  - name: "pgvector"
    version: "0.5.0"
  - name: "pg_ivm"
    version: "1.5.1"
pgVersions:
  - "15"
EOF

$ pgxman pack install -f pgxman.yaml
```

## Next steps

Now you're ready to start [using the extensions](using_extensions)!
