Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Ubuntu 18

Hi all,

After installing docker on ubuntu 18, I can not use it.

Receiving the following error when executing any command.

sudo docker version
Client:
Version: 0.0.0-20180828050111-3bb99a8
API version: 1.39
Go version: go1.10.3
Git commit: 3bb99a8
Built: Tue Aug 28 07:08:13 2018
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I searched here but did not find the answer.
follows settings

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
#Install containerd-shim-process if it’s not already installed
ExecStartPre=/usr/libexec/containerd-offline-installer /var/lib/containerd-offline-installer/containerd-shim-process.tar docker.io/docker/containerd-shim-process
ExecStart=/usr/bin/dockerd
TimeoutSec=0
Restart=always
#On RPM Based distributions PATH isn’t defined so we define it here
#/opt/containerd/bin is in front so dockerd grabs the correct runc binary
Environment=“PATH=/opt/containerd/bin:/sbin:/usr/bin:/usr/local/bin:$PATH”

[Install]
WantedBy=multi-user.target

thank you all for helping me.

I was using this version

Version: 0.0.0-20180828050111-3bb99a8
API version: 1.39

I uninstalled and changed to that version and now it works normal for min

Version: 18.06.1-ce
API version: 1.38

Hi, Marcelo.

Before install your same Linux 18 (Bionic) i just used this commands bellow (with root user):

apt-get update --> Update S.O.

curl -fsSL get.docker.com -o get-docker.sh --> Download the script of the latest version of docker

sh get-docker.sh --> Execute the script

usermod -aG docker docker --> Set permissions for my linux user docker on Docker

base=https://github.com/docker/machine/releases/download/v0.14.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && sudo install /tmp/docker-machine /usr/local/bin/docker-machine

curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-'uname -s’-‘uname -m’ -o /usr/local/bin/docker-compose --> Installed Docker-Compose

chmod +x /usr/local/bin/docker-compose --> Set permissions on directory compose

So my Docker is Working very well. I hope this can help you.
Unfortunely i don’t know nothing about your issue but probably is your version of Docker builded in another place.