mirror of https://github.com/postgres/postgres
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
3.6 KiB
94 lines
3.6 KiB
![]()
2 years ago
|
# Installation
|
||
|
|
||
|
## Considerations
|
||
|
|
||
|
You can use the following options to manage encryption keys:
|
||
|
|
||
|
* Use the HashiCorp Vault server. This is the recommended approach. The Vault server configuration is out of scope of this document. We assume that you have the Vault server up and running. For the `pg_tde` configuration, you need the following information:
|
||
|
|
||
|
* The secret access token to the Vault server
|
||
|
* The URL to access the Vault server
|
||
|
* (Optional) The CA file used for SSL verification
|
||
|
|
||
|
* Use the local keyfile. This approach is rather used for development and testing purposes since the keys are stored unencrypted in the specified keyfile.
|
||
|
|
||
|
## Procedure
|
||
|
|
||
|
Install `pg_tde` using one of available installation methods:
|
||
|
|
||
![]()
1 year ago
|
|
||
|
=== "Package manager"
|
||
|
|
||
![]()
10 months ago
|
The packages are available for the following operating systems:
|
||
![]()
1 year ago
|
|
||
|
- Red Hat Enterprise Linux 8 and compatible derivatives
|
||
|
- Red Hat Enterprise Linux 9 and compatible derivatives
|
||
|
- Ubuntu 20.04 (Focal Fossa)
|
||
|
- Ubuntu 22.04 (Jammy Jellyfish)
|
||
![]()
10 months ago
|
- Ubuntu 24.04 (Noble Numbat)
|
||
![]()
1 year ago
|
- Debian 11 (Bullseye)
|
||
|
- Debian 12 (Bookworm)
|
||
|
|
||
|
[Install on Debian or Ubuntu](apt.md){.md-button}
|
||
|
[Install on RHEL or derivatives](yum.md){.md-button}
|
||
|
|
||
![]()
2 years ago
|
=== "Build from source"
|
||
|
|
||
![]()
10 months ago
|
To build `pg_tde` from source code, do the following
|
||
![]()
11 months ago
|
|
||
![]()
10 months ago
|
1. On Ubuntu/Debian: Install the following dependencies required for the build:
|
||
![]()
2 years ago
|
|
||
|
```sh
|
||
![]()
10 months ago
|
sudo apt install make gcc postgresql-server-dev-17 libcurl4-openssl-dev
|
||
![]()
2 years ago
|
```
|
||
|
|
||
![]()
9 months ago
|
2. [Install Percona Distribution for PostgreSQL 17 :octicons-link-external-16:](https://docs.percona.com/postgresql/17/installing.html) or [upstream PostgreSQL 17 :octicons-link-external-16:](https://www.postgresql.org/download/)
|
||
![]()
2 years ago
|
|
||
|
3. If PostgreSQL is installed in a non standard directory, set the `PG_CONFIG` environment variable to point to the `pg_config` executable.
|
||
|
|
||
|
4. Clone the repository:
|
||
|
|
||
|
```
|
||
![]()
11 months ago
|
git clone git://github.com/percona/pg_tde
|
||
![]()
2 years ago
|
```
|
||
|
|
||
|
5. Compile and install the extension
|
||
|
|
||
|
```
|
||
![]()
2 years ago
|
cd pg_tde
|
||
![]()
2 years ago
|
make USE_PGXS=1
|
||
|
sudo make USE_PGXS=1 install
|
||
|
```
|
||
|
|
||
|
=== "Run in Docker"
|
||
|
|
||
![]()
10 months ago
|
!!! note
|
||
|
|
||
|
The steps below are for the `pg_tde` community version.
|
||
|
|
||
![]()
9 months ago
|
To run `pg_tde` version for Percona Server for PostgreSQL, [use the Percona Distribution for PostgreSQL Docker image :octicons-link-external-16:](https://docs.percona.com/postgresql/17/docker.html).
|
||
|
|
||
|
You can find Docker images built from the current main branch on [Docker Hub](https://hub.docker.com/r/perconalab/pg_tde). Images are built on top of [postgres:16](https://hub.docker.com/_/postgres) official image.
|
||
![]()
2 years ago
|
|
||
|
To run `pg_tde` in Docker, use the following command:
|
||
|
|
||
|
```
|
||
![]()
2 years ago
|
docker run --name pg-tde -e POSTGRES_PASSWORD=mysecretpassword -d perconalab/pg_tde
|
||
![]()
2 years ago
|
```
|
||
|
|
||
![]()
9 months ago
|
It builds and adds `pg_tde` extension to PostgreSQL 16. The `postgresql.conf` contains the required modifications. The `pg_tde` extension is added to `template1` so that all new databases automatically have the `pg_tde` extension loaded.
|
||
![]()
1 year ago
|
|
||
|
Keys are not created automatically. You must configure a key provider and a principal key for each database where you wish to use encrypted tables. See the instructions in the [Setup](setup.md) section, starting with the 4th point, as the first 3 steps are already completed in the Docker image.
|
||
![]()
2 years ago
|
|
||
|
See [Docker Docs](https://hub.docker.com/_/postgres) on usage.
|
||
|
|
||
|
You can also build a Docker image manually with:
|
||
|
|
||
|
```
|
||
|
docker build . -f ./docker/Dockerfile -t your-image-name
|
||
|
```
|
||
|
|
||
|
## Next steps
|
||
|
|
||
![]()
1 year ago
|
[Setup](setup.md){.md-button}
|