A server is already running. Check /tmp/pids/server.pid Ruby / Rails Origin: Application & API OSI layer 7 · Application Last updated 5 Nov 2026

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).

Exact message you may see 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
Seen on: Ruby Docker Linux

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 tmp shared between containers

⚡ Quick fix

  1. rm -f tmp/pids/server.pid
  2. Docker entrypoint: rm -f /app/tmp/pids/server.pid
  3. Check lsof -i :3000 for a real process

Detailed fix by platform

Linux

  1. lsof -i :3000; rm -f tmp/pids/server.pid; bin/rails s

How to diagnose

  1. Process — Really running?
  2. Pid file — Stale?
  3. 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:

Where this error sits

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

57P03 — FATAL: the database system is starting up (PostgreSQL)57P03ActiveRecord::AssociationTypeMismatch — Rails: ActiveRecord::AssociationTypeMismatch: User(#1234) expected, got "42" which is an instance of String(#5678) (Ruby / Rails)ActiveRecord::Associa…ActiveRecord::ConnectionNotEstablished — Rails: ActiveRecord::ConnectionNotEstablished: No connection pool for 'ActiveRecord::Base' found (Ruby / Rails)ActiveRecord::Connect…ActiveRecord::Deadlocked: PG::TRDeadlockDetected — Rails: ActiveRecord::Deadlocked: PG::TRDeadlockDetected: ERROR: deadlock detected (Ruby / Rails)ActiveRecord::Deadloc…ActiveRecord::IrreversibleMigration — Rails: ActiveRecord::IrreversibleMigration — This migration uses remove_column without a type; db:rollback can't reverse it (Ruby / Rails)ActiveRecord::Irrever…bind() failed (98: Address already in use) — nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) (Linux)bind() failed (98: Ad…data directory permissions — FATAL: data directory "/var/lib/postgresql/data" has invalid permissions — Permissions should be u=rwx (0700) or u=rwx,g=rx (0750). (PostgreSQL)data directory permis…Docker Desktop requires privileged access (vmnetd) — macOS: Docker Desktop needs privileged access / com.docker.vmnetd could not be started (macOS)Docker Desktop requir…A server …

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.