postmaster.pid PostgreSQL Origin: Data OSI layer 7 · Application Last updated 13 Oct 2026

FATAL: lock file "postmaster.pid" already exists — Is another postmaster running in data directory?

PostgreSQL won’t start because a stale postmaster.pid file remains (or another instance really is running).

Exact message you may see lock file "postmaster.pid" already existsIs another postmaster
Seen on: PostgreSQL

Meaning

After a crash or unclean shutdown (common with Homebrew on macOS), the PID file stays behind.

Common causes

  • Unclean shutdown/crash
  • Another PostgreSQL instance using the same data directory

⚡ Quick fix

  1. Make sure no postgres process is running (ps aux | grep postgres)
  2. Then delete the stale postmaster.pid and start again

Detailed fix by platform

Linux

  1. brew services stop postgresql@16 && rm /opt/homebrew/var/postgresql@16/postmaster.pid && brew services start postgresql@16

How to diagnose

  1. Process — Is postgres running?
  2. PID — Does the PID in the file exist?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

500.30 — HTTP Error 500.30 - ASP.NET Core app failed to start (.NET)500.3057P03 — FATAL: the database system is starting up (PostgreSQL)57P03ExceptionInInitializerError — java.lang.ExceptionInInitializerError (Java)ExceptionInInitialize…Exited (0) — Docker container exits immediately (Exited (0) / Exited (1) right after start) (Docker)Exited (0)Init:CrashLoopBackOff — Pod status Init:CrashLoopBackOff / Init:Error (Kubernetes)Init:CrashLoopBackOffMySQL won't start — Job for mysql.service failed because the control process exited with error code (MySQL)MySQL won't startnodemon crashed — [nodemon] app crashed - waiting for file changes before starting... (Node.js)nodemon crashedORA-01034 — ORA-01034: ORACLE not available (ORA-27101: shared memory realm does not exist) (SQL)ORA-01034postmaste…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.