Failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid

Answer:

The error message “failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid” is encountered when starting the Docker daemon. This error indicates that the Docker daemon is already running or there is a stale PID (process identifier) file present.

To resolve this issue, you can follow these steps:

  1. Ensure Docker is not already running:
  2.       sudo service docker stop
        
  3. Delete the PID file:
  4.       sudo rm /var/run/docker.pid
        
  5. Start the Docker daemon:
  6.       sudo service docker start
        

The first step stops the Docker service if it is already running. The second step removes the PID file, if present. Finally, the third step starts the Docker daemon.

Here is an example scenario where this error can occur:

Let’s say you have previously started the Docker daemon and it has been running without any issues. However, due to a system crash or unexpected shutdown, the Docker daemon process did not properly stop and left a stale PID file. Now when you try to start the Docker daemon again, it detects the presence of the PID file and assumes that Docker is already running, resulting in the “failed to start daemon” error.

Read more

Leave a comment