Search code examples
ubuntudockersudo

Not able to start a Docker in Ubuntu


ubuntu-gnome@ubuntu-gnome:~$ docker images

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.30/images/json: dial unix /var/run/docker.sock: connect: permission denied


ubuntu-gnome@ubuntu-gnome:~$ sudo docker images

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ubuntu-gnome@ubuntu-gnome:~$ 

Solution

  • After install docker, it is not running by default. Assuming this is Ubuntu 16.04

    You need to run below to start docker

    $ sudo systemctl start docker
    

    And below to set it to start on boot

    $ sudo systemctl enable docker