How to Find Your PostgreSQL Database Credentials

Locating connection details for your PostgreSQL database based on common setups.

What You'll Need:

  • Hostname (or Server Address): Server address (e.g., IP, domain name).
  • Port: Network port (default: 5432).
  • Database Name: The specific database to connect to.
  • Username (or Role): The user account/role with database access.
  • Password: The password for the specified Username/Role.

Where to Look Based on Your Setup:

Cloud Database Service

(e.g., AWS RDS, Google Cloud SQL, Azure, Heroku Postgres, DigitalOcean)

Web Hosting with Control Panel

(e.g., cPanel, Plesk - Less common for PostgreSQL)

  • Log in to your hosting control panel.
  • Look for "PostgreSQL Databases" or similar sections.
  • Should list Database Names and associated Usernames (Roles).
  • Hostname is often localhost, but *verify* with host.
  • Port is usually 5432.
  • Password set during user creation; use panel tools for reset.
  • Important: Remote access rules may need configuration (IP allowlisting). Check host docs.
  • Helpful Links:

Self-Hosted / Custom Server

(e.g., VPS, Dedicated Server, On-Premise)

  • Ask the administrator/developer/DevOps person managing the server.
  • Check application config files (.env, settings.py, database.yml, etc.) carefully.
  • Check PostgreSQL config files: postgresql.conf (for listen_addresses, port) and potentially pg_hba.conf (for access control rules).
  • Refer to installation documentation.
  • Passwords can be reset via psql commands by an admin (e.g., ALTER USER ...).
  • Helpful Links:

Using a Database Management Tool

(e.g., pgAdmin, DBeaver, TablePlus, Postico)

  • Open your PostgreSQL management tool.
  • Find the connection manager ("Servers," "Connections," "Edit," "Properties").
  • The saved settings will display Hostname, Port, Username (User/Role), and potentially the default Database Name.
  • Password might be masked or stored in your system keychain.

Still Stuck?

If you need further assistance finding these details, please consult the relevant technical contact (developer, hosting support, IT admin).