Installing on Fedora / RHEL
The postgresql-server and postgresql-contrib packages install the server and the standard extensions. The psql client is provided by the postgresql package, usually pulled in as a dependency.
Mandatory step: initialize the cluster
Unlike Debian/Ubuntu, the data directory is not created at install time. You must initialize it explicitly:
sudo postgresql-setup --initdbOnly after this step can you enable and start the service. Forgetting this command is the most common cause of startup failure on Fedora.
Once the cluster is initialized, enable and start the service in a single command:
sudo systemctl enable --now postgresqlThe --now flag starts the service immediately while also enabling it at system boot.
First connection
The installation creates a postgres PostgreSQL role matching the system user of the same name. To open a first session, assume that system identity and launch the psql client:
sudo -u postgres psqlYou get the postgres=# prompt, from which you can create your roles and databases. Type \q to quit.
File locations
The cluster and its configuration live together under /var/lib/pgsql/data. The postgresql.conf and pg_hba.conf files are therefore located directly in the data directory, and not under /etc as on Debian.
For a specific major version (for example PostgreSQL 17), use the official PGDG repository and its versioned postgresqlNN-server packages — verify against your Fedora/RHEL version.