Skip to main content
SQL Developer — help/connect-postgresql.md
port 5432 · built-in driver

How to Connect SQL Developer to PostgreSQL

Set up a PostgreSQL connection in SQL Developer in just a few clicks. No complex configuration required — the PostgreSQL driver is built-in.

~/connections/postgresql.spec setup overview

# Connection target

database = PostgreSQL 9.6+ / 12.x / 14.x / 16.x

driver = PostgreSQL JDBC (bundled)

port = 5432 # default; configurable

protocol = TCP # SSL recommended for remote

auth = username/password

# Setup info

time = 5 minutes

difficulty = Beginner

steps = 4

prereq = SQL Developer installed (driver included)

// 4 setup steps + 4 connection examples + troubleshooting below

Before You Start

What you'll need before opening the New Connection dialog.

  • SQL Developer installed — download free if you haven't yet
  • PostgreSQL server running and accessible from your machine
  • Connection details: hostname, port, username, password, database name

Good news: Unlike MySQL, you don't need to download a separate JDBC driver. SQL Developer includes PostgreSQL support out of the box.

Connect to PostgreSQL Step by Step

Four steps to a working connection. Total time: about 5 minutes.

STEP_01

Open Connection Dialog

Click the green + icon in the Connections panel on the left side of SQL Developer. This opens the New Database Connection dialog.

STEP_02

Select PostgreSQL

In the connection dialog, click the PostgreSQL tab on the left side. The form will update to show PostgreSQL-specific fields.

STEP_03

Enter Connection Details

Connection Name: any name (e.g., "My Postgres DB")
Username: postgres (or your user)
Password: your password
Hostname: localhost or server IP
Port: 5432 (default)
Database: postgres (or your DB name)

STEP_04

Test and Connect

Click Test to verify the connection works. If successful, click Save then Connect.

PostgreSQL Connection Examples

Four common configurations — local, Heroku, Amazon RDS, and DigitalOcean managed databases.

~/connections/local.conflocal Postgres

# Local PostgreSQL Server

hostname = localhost

port = 5432

database = postgres

username = postgres

~/connections/heroku.confHeroku Postgres

# Heroku Postgres add-on

hostname = ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com

port = 5432

database = (from Heroku dashboard)

ssl = required

~/connections/aws-rds.confAmazon RDS

# Amazon RDS PostgreSQL endpoint

hostname = your-instance.xxxx.region.rds.amazonaws.com

port = 5432

database = postgres

username = your_master_user

~/connections/digitalocean.confDigitalOcean Managed DB

# DigitalOcean Managed Database

hostname = your-db-do-user-xxxxx-0.db.ondigitalocean.com

port = 25060

database = defaultdb

ssl = required

PostgreSQL Connection Troubleshooting

Fixes for the three errors most often hit during PostgreSQL setup.

~/downloads ready.sh

Next: Connect to MySQL Too?

If you also need MySQL, the setup is nearly identical to PostgreSQL — same New Connection dialog, port changes to 3306, and you need to add the MySQL JDBC .jar once (PostgreSQL ships with its driver built in).

// next.specconnect-mysql.md · port 3306
// see-alsofirst-query.md · schema-explorer.md