Configuration parameter

listen_addresses — PostgreSQL Configuration Parameter

Category Connections Default 'localhost' Unit boolean / enum / numeric Change scope Restart required

TCP/IP addresses the server listens on.

At a glance

Property Value
Parameter listen_addresses
Category Connections
Default 'localhost'
Value type boolean / enum / numeric
Change scope Restart required

What it does

Specifies the host names or IP addresses on which the server accepts TCP connections. The special value * means all interfaces; an empty string disables TCP entirely (Unix sockets only).

How to apply a change

Requires a full server restart (postmaster context). Set it in postgresql.conf and restart PostgreSQL.

Inspect the current value and source with SHOW listen_addresses; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'listen_addresses';.

Tuning guidance

Set to * (or a specific bind address) to accept remote connections — and only then; leaving it at localhost is the safe default. Opening the listener is separate from authorization: you still need matching pg_hba.conf rules and a firewall.

Reference

PostgreSQL documentation — Connections configuration.

Was this helpful?

← All configuration parameters