TCPRegistered PortFirewall: Usually Closed
5432

PostgreSQL

What is Port 5432?

Port 5432 is the default port for PostgreSQL, the world's most advanced open-source relational database. Originally developed at UC Berkeley in the 1980s as POSTGRES and later renamed PostgreSQL, it has become the database of choice for many modern applications due to its robustness, standards compliance, extensibility, and advanced features. PostgreSQL supports ACID transactions, complex queries, JSON/JSONB data types, full-text search, PostGIS for geospatial data, and a rich extension ecosystem. Major companies including Apple, Instagram, Spotify, Reddit, and Twitch rely on PostgreSQL. Cloud providers offer managed PostgreSQL services — AWS RDS, Google Cloud SQL, Azure Database for PostgreSQL, and specialized providers like Supabase and Neon.

Common Uses

  • Web application database backends
  • Geospatial data with PostGIS extension
  • Data warehousing and analytics
  • Time-series data with TimescaleDB extension
  • Enterprise application data storage

Technical Details

Port Number5432
ProtocolTCP
CategoryRegistered
Service NamePostgreSQL
Default FirewallUsually Closed
Port Test Commands

Copy-paste commands to check port 5432 (PostgreSQL) from your terminal

Test connectivity

Netcat (nc)Check if TCP port is reachable
nc -zv example.com 5432
curl (HTTP)Test HTTP response on this port
curl -v --max-time 5 http://example.com:5432/
TelnetBasic TCP port connectivity check
telnet example.com 5432
nmapScan port 5432 with service detection
nmap -p 5432 -sV example.com
Bash /dev/tcpPure bash TCP check (no extra tools needed)
(echo > /dev/tcp/example.com/5432) 2>/dev/null && echo "open" || echo "closed"

Open port in firewall

UFW (Ubuntu / Debian)
sudo ufw allow 5432/tcp
iptables
sudo iptables -A INPUT -p tcp --dport 5432 -j ACCEPT
firewalld (RHEL / CentOS)
sudo firewall-cmd --permanent --add-port=5432/tcp && sudo firewall-cmd --reload

Security Considerations

!

Never expose PostgreSQL to the internet without proper controls. Configure pg_hba.conf to restrict connections by IP and authentication method. Use SSL/TLS for encrypted connections. Use strong passwords and scram-sha-256 authentication. Implement row-level security for multi-tenant applications. Enable audit logging with pgAudit. Regularly backup with pg_dump or pg_basebackup.

Popular Ports Reference

The most commonly used and referenced network ports

Related Ports