Docker can’t connect to docker daemon

Linux

The Post-installation steps for Linux documentation reveals the following steps:

  1. Create the docker group.
    sudo groupadd docker
  2. Add the user to the docker group.
    sudo usermod -aG docker $(whoami)
  3. Log out and log back in to ensure docker runs with correct permissions.
  4. Start docker.
    sudo service docker start

Mac OS X

As Dayel Ostraco says is necessary to add environments variables:

docker-machine start # Start virtual machine for docker
docker-machine env  # It's helps to get environment variables
eval "$(docker-machine env default)" # Set environment variables

The docker-machine start command outputs the comments to guide the process.

Leave a Comment