Rails: A server is already running (pid: 12345, file: /app/tmp/pids/server.pid). Exiting
Rails thinks another server is running because a stale server.pid exists (often after a crash or in Docker).
A server is already running. Check /tmp/pids/server.pid.A server is already running (pid: 12345, file: /app/tmp/pids/server.pid)A server is already running. Check /app/tmp/pids/server.pidExiting rails server already running pidPuma pid file exists Meaning
If no server runs, delete tmp/pids/server.pid and start again. In Docker add rm -f tmp/pids/server.pid to the entrypoint. If a server does run, find it (lsof -i :3000) and stop it, or use another port (-p 3001).
Common causes
- Stale pid file after crash/forced stop
- Container restart reusing a volume with the pid file
- Another Rails server really running
- Port 3000 in use
- Mounted
tmpshared between containers
⚡ Quick fix
rm -f tmp/pids/server.pid- Docker entrypoint:
rm -f /app/tmp/pids/server.pid - Check
lsof -i :3000for a real process
Detailed fix by platform
Linux
lsof -i :3000; rm -f tmp/pids/server.pid; bin/rails s
How to diagnose
- Process — Really running?
- Pid file — Stale?
- Docker — Entrypoint cleans?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 57P03 FATAL: the database system is starting up
- ActiveRecord::AssociationTypeMismatch Rails: ActiveRecord::AssociationTypeMismatch: User(#1234) expected, got "42" which is an instance of String(#5678)
- ActiveRecord::ConnectionNotEstablished Rails: ActiveRecord::ConnectionNotEstablished: No connection pool for 'ActiveRecord::Base' found
Most viewed in Ruby / Rails
- ActiveRecord::PendingMigrationError Rails: ActiveRecord::PendingMigrationError — Migrations are pending. To resolve this issue, run: bin/rails db:migrate
- ActionController::InvalidAuthenticityToken Rails: ActionController::InvalidAuthenticityToken (Can't verify CSRF token authenticity)
- undefined method for nil Ruby: NoMethodError: undefined method `x' for nil (nil:NilClass)
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 5 Nov 2026