Port 5432: What's Using It and Is It Safe to Kill?

Port 5432 is the default PostgreSQL port. Here's what listens on it on a Mac, whether it's safe to stop, and how to find it.

Port 5432 is the default port for PostgreSQL. If it’s in use on your Mac, you have a Postgres server running, almost always a local one for development.

What typically listens on port 5432

  • PostgreSQL: The default server port. Homebrew’s postgresql formula, Postgres.app, and Docker images all use it.
  • Docker and dev environments: Containers map Postgres to 5432 on the host.
  • Connection poolers: Tools like PgBouncer sometimes sit in front, though often on a different port.

By default Postgres binds to 127.0.0.1, so it’s reachable from your Mac but not the network.

Is it safe to kill?

Stopping it won’t hurt macOS, but a database deserves a clean shutdown rather than a force-kill mid-write. Stop it properly:

brew services stop postgresql@16

Homebrew uses versioned formulae, so match the version you installed (run brew services list to check), or quit Postgres.app from the menu bar. Only kill the PID if the server is genuinely hung.

Is it suspicious?

On a machine where you do database work, no. It’s expected. Check two things: whether you meant to leave Postgres running (it can sit in the background using memory), and whether it’s bound to localhost only. A 5432 listener on your LAN IP means the database is exposed, which you rarely want on a laptop.

How to find what’s on port 5432 on macOS

lsof -i :5432

To stop a stuck instance by PID:

kill $(lsof -ti :5432)

Use a plain kill (SIGTERM) first so Postgres can shut down cleanly. Reserve kill -9 for a server that won’t respond.

Portie shows port 5432 alongside the postgres process in its live view, so you can confirm whether your database is running and which install owns the port.

Common questions

What is using port 5432 on my Mac?

Port 5432 is the default for PostgreSQL. A listener means a local Postgres server is running, usually started by Homebrew, Postgres.app, or Docker. Run lsof -i :5432 to confirm.

Is it safe to kill the process on port 5432?

It stops your local PostgreSQL server, which is safe for macOS. Stop it gracefully with brew services stop postgresql@16 (match your installed version) or by quitting Postgres.app rather than force-killing it, so the database closes cleanly.

Should port 5432 be open to the internet?

No. PostgreSQL should listen on localhost only. A 5432 port reachable from outside your machine is a security risk and a common scan target.

Try Portie Free

See every open port on your Mac, which app owns it, and kill processes from the list.

Download Free