---
title: "Installing PostgreSQL 14 on CentOS 7"
url: https://michalasobczak.pl/posts/installing-postgresql-14-on-centos-7.html
author: "Michał Sobczak"
description: "PostgreSQL 14 has few improvements over previous versions, especially older ones, like 9.6. This includes automatic data direction using partitioning. So, let’s install it on CentOS 7. Then you should login to the database and set password: Basic configuration includes firewall setup (if it’s active), access control and performance settings:"
published: 2022-08-16T14:17:39.000Z
updated: 2022-09-06T10:44:53.000Z
language: en
categories: ["Technology"]
tags: ["CentOS", "PostgreSQL"]
license: CC BY-NC-ND 4.0 (https://creativecommons.org/licenses/by-nc-nd/4.0/)
---
# Installing PostgreSQL 14 on CentOS 7

PostgreSQL 14 has few improvements over previous versions, especially older ones, like 9.6. This includes automatic data direction using partitioning. So, let’s install it on CentOS 7.

```bash
yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql14-server postgresql14
/usr/pgsql-14/bin/postgresql-14-setup initdb
systemctl enable postgresql-14
service postgresql-14 start
```

Then you should login to the database and set password:

```text
sudo -u postgres -i
psql
\password
```

Basic configuration includes firewall setup (if it’s active), access control and performance settings:

```text
/var/lib/pgsql/14/data/pg_hba.conf
/var/lib/pgsql/14/data/postgresql.auto.conf
```

I strongly recommend visiting [pgtune.leopard.in.ua](http://pgtune.leopard.in.ua) for tuning parameters. Last thing is to set interface address on which server will be listening, it’s set in:

```text
/var/lib/pgsql/14/data/postgresql.conf
```

Now you are good to go.
