DEV Community

Bien Aime
Bien Aime

Posted on

How to fix Docker permission denied error in linux

The best for solution for docker credential error like:

A. dial unix /var/run/docker.sock: connect: permission denied

B. WARN[0000] not reading global config file because running with root privileges
Not populating custom commands or hostadditions because running with root privileges
ddev is not designed to be run with root privileges, please run as normal user and without sudo

Step 1:
Run sudo groupadd docker. This creates a docker group

Step 2:
sudo usermod -aG docker $USER. This added a user in the docker group to easily access docker without using sudo
step 3: newgrp docker . This saves the changes with no need to logout and login back again.
Step 4: Test by running docker run hello-world

Top comments (0)