After installing docker in ubuntu 16.04, execute in the directory where the docker-compose.yml file is located.
jing@ubuntu:/tmp/docker$ docker-compose up -d
error:
ERROR: Couldn’t connect to Docker daemon at http+docker://localunixsocket – is it running?
If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Solution:
The correct one is to add the current user to the docker group
jing@ubuntu:/tmp/docker$ sudo gpasswd -a ${USER} docker
Then quit the current user, switch to root for example, switch to jing again, and run docker-compose up -d and you’re done.
jing@ubuntu:/tmp/docker$ sudo su
root@ubuntu:/tmp/docker$ su jing
jing@ubuntu:/tmp/docker$ docker-compose up -d
Similar Posts:
- Docker-compose Run Error: Couldn’t connect to Docker daemon at http+docker://localhost – is it running?
- [Ubuntu18.04] Docker Start Error: Got permission denied while trying to connect to the Docker daemon socket
- Ubuntu20.04 server Error: Failed to restart docker.service: Unit docker.service not found
- When Docker installs an Mirror: failed to get default registry endpoint from daemon
- [How to]docker http: server gave HTTP response to HTTPS client
- [Solved] “/usr/local/bin/docker-compose: Permission denied”
- An error is reported when the docker command is executed in Jenkins
- [Solved] cannot kill Docker container – permission denied
- Error: unsupported locale setting