Skip to content

Instantly share code, notes, and snippets.

@pskopek
Last active July 19, 2022 10:48
Show Gist options
  • Save pskopek/08066c27c19abe008200766702134164 to your computer and use it in GitHub Desktop.
Save pskopek/08066c27c19abe008200766702134164 to your computer and use it in GitHub Desktop.
How to setup PostgreSQL Database on Fedora 36 for use with Keycloak

How to setup PostgreSQL Database on Fedora 36 for use with Keycloak

  1. Install postgresql-server package: sudo dnf install postgresql-server
  2. Switch to postgres user using: sudo su - postgres
  3. Initialize the PostgreSQL Data Cluster: initdb
  4. Start PostgreSQL DB instance: pg_ctl -D /var/lib/pgsql/data -l logfile start
  5. Create user 'keycloak' with password: createuser keycloak -d -P
  6. Created database for use with keycloak: createdb -O keycloak keycloak
  7. Exit the postgres user shell: exit

PostgreSQL Operation

  • Start|Stop|Restart|Status the server sudo systemctl start|stop|restart|status postgresql
  • Get JDBC driver: sudo dnf install postgresql-jdbc
    For jar files look to sudo dnf repoquery -l postgresql-jdbc
  • Start client for a quick query in DB: psql postgresql://localhost/keycloak -U keycloak

Useful links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment