How to Install Postgres on Fedora

By | 2016/05/02

Here is a quick how-to for getting postgres going on Fedora!

1. Install the following packages:
$ sudo dnf install postgresql postgresql-server postgresql-contrib

2. Initialize the data database, otherwise postgres will not start
$ sudo postgresql-setup --initdb --unit postgresql
 * Initializing database in '/var/lib/pgsql/data'
 * Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log

3. Start the postgres server
$ sudo systemctl start postgresql

4. If desired to have postgres server start at boot, enable with systemd:
$ sudo systemctl enable postgresql


To manage postgres on Fedora, switch to the postgres user and run psql:

$ sudo su - postgres
-bash-4.3$ psql
psql (9.4.7)
Type "help" for help.


Rock on,